From 48352cac5b475a9ccef0429bd5a221e78b272228 Mon Sep 17 00:00:00 2001 From: John Lu Date: Thu, 18 Jul 2024 03:59:14 -0400 Subject: [PATCH] added 2019 winter midterm --- .../comp2804/2019-fall-final/1/solution.md | 2 ++ .../comp2804/2019-fall-final/10/solution.md | 2 ++ .../comp2804/2019-fall-final/11/solution.md | 5 ++++- .../comp2804/2019-fall-final/12/solution.md | 13 +++++++---- .../comp2804/2019-fall-final/15/solution.md | 5 ++++- .../comp2804/2019-fall-final/16/solution.md | 4 +++- .../comp2804/2019-fall-final/17/solution.md | 16 +++++++++----- .../comp2804/2019-fall-final/18/solution.md | 16 +++++++++----- .../comp2804/2019-fall-final/2/solution.md | 3 +++ .../comp2804/2019-fall-final/20/solution.md | 9 ++++++++ .../comp2804/2019-fall-final/24/solution.md | 22 +++++++++++++------ .../comp2804/2019-fall-final/7/solution.md | 3 +++ .../comp2804/2019-fall-final/9/solution.md | 4 ++++ .../2019-winter-midterm/1/solution.md | 2 ++ .../2019-winter-midterm/10/solution.md | 8 +++++-- .../2019-winter-midterm/14/solution.md | 1 + .../2019-winter-midterm/15/solution.md | 21 +++++++++++++----- .../2019-winter-midterm/2/solution.md | 8 +++++++ .../2019-winter-midterm/3/solution.md | 8 +++++++ .../2019-winter-midterm/4/solution.md | 1 + .../2019-winter-midterm/5/solution.md | 9 ++++++++ .../2019-winter-midterm/6/solution.md | 5 +++++ .../2019-winter-midterm/7/solution.md | 1 + .../2019-winter-midterm/9/solution.md | 3 +++ 24 files changed, 139 insertions(+), 32 deletions(-) diff --git a/src/content/questions/comp2804/2019-fall-final/1/solution.md b/src/content/questions/comp2804/2019-fall-final/1/solution.md index bcf4031c..a52ed02b 100644 --- a/src/content/questions/comp2804/2019-fall-final/1/solution.md +++ b/src/content/questions/comp2804/2019-fall-final/1/solution.md @@ -1,3 +1,5 @@ We choose 5 of the 85 positions to be c: $ \binom{85}{5} $ + The remaining 80 positions can be any of the 3 letters: $ 3^{80} $ + Thus, the total number of strings is $ \binom{85}{5} \cdot 3^{80} $ diff --git a/src/content/questions/comp2804/2019-fall-final/10/solution.md b/src/content/questions/comp2804/2019-fall-final/10/solution.md index b049f1fd..b02306b7 100644 --- a/src/content/questions/comp2804/2019-fall-final/10/solution.md +++ b/src/content/questions/comp2804/2019-fall-final/10/solution.md @@ -1,3 +1,5 @@ Let's just draw the tree, man + Warning: Do Later + In total, O Canada is sung 8 times. diff --git a/src/content/questions/comp2804/2019-fall-final/11/solution.md b/src/content/questions/comp2804/2019-fall-final/11/solution.md index 088bc216..f6ac898a 100644 --- a/src/content/questions/comp2804/2019-fall-final/11/solution.md +++ b/src/content/questions/comp2804/2019-fall-final/11/solution.md @@ -6,6 +6,9 @@ The remaining 8 each have 3 possible incorrect answers: $ 3^{8} $
$ |A| = \binom{25}{17} \cdot 3^{8} $ -$ Pr(A) = \frac{|A|}{|S|} $ + +$ Pr(A) = \frac{|A|}{|S|} $ + $ Pr(A) = \frac{\binom{25}{17} \cdot 3^{8}}{4^{25}} $ + $ Pr(A) = \binom{25}{17} \cdot {( \frac{3}{4})}^8 \cdot {( \frac{1}{4})}^{17} $ diff --git a/src/content/questions/comp2804/2019-fall-final/12/solution.md b/src/content/questions/comp2804/2019-fall-final/12/solution.md index bd7c09d6..e6482af6 100644 --- a/src/content/questions/comp2804/2019-fall-final/12/solution.md +++ b/src/content/questions/comp2804/2019-fall-final/12/solution.md @@ -19,8 +19,13 @@ I've been playing an MMO RPG called Orna recently. It uses GPS and forces me to $ |A \cap B| = 1 $
$ Pr(A \cap B) = \frac{1}{32} $ -Now, let's check whether it's independent -$ Pr(A \cap B) = Pr(A) \cdot Pr(B) $ -$ \frac{1}{32} = \frac{1}{4} \cdot \frac{1}{8} $ -$ \frac{1}{32} = \frac{1}{32} $ + +Now, let's check whether it's independent + +$ Pr(A \cap B) = Pr(A) \cdot Pr(B) $ + +$ \frac{1}{32} = \frac{1}{4} \cdot \frac{1}{8} $ + +$ \frac{1}{32} = \frac{1}{32} $ + BOOM. THE RESULTS SPEAK FOR THEMSELVES. HAPPY INDEPENDENCE DAY. MURICAAAA diff --git a/src/content/questions/comp2804/2019-fall-final/15/solution.md b/src/content/questions/comp2804/2019-fall-final/15/solution.md index 701de0db..22b9787f 100644 --- a/src/content/questions/comp2804/2019-fall-final/15/solution.md +++ b/src/content/questions/comp2804/2019-fall-final/15/solution.md @@ -7,6 +7,9 @@ We can choose 2 of the red balls: $ \binom{4}{2} $
$ |A \cap B| = \binom{4}{2} = 6 $ + Now, let God do the rest -$ Pr(A|B) = \frac{|A \cap B|}{|B|} = $ + +$ Pr(A|B) = \frac{|A \cap B|}{|B|} = $ + $ Pr(A|B) = \frac{ \binom{5}{2} + \binom{4}{2} }{ \binom{4}{2} } $ diff --git a/src/content/questions/comp2804/2019-fall-final/16/solution.md b/src/content/questions/comp2804/2019-fall-final/16/solution.md index b67bd3cd..8c618472 100644 --- a/src/content/questions/comp2804/2019-fall-final/16/solution.md +++ b/src/content/questions/comp2804/2019-fall-final/16/solution.md @@ -6,5 +6,7 @@ There is only 1 number that is both even and divisible by 3, which is 6: 1
$ |A \cap B| = 1 $ -I enjoy Jujutsu Kaisen and Donal/Joe/Obama AI voice skits + +I enjoy Jujutsu Kaisen and Donal/Joe/Obama AI voice skits + $ Pr(A|B) = \frac{|A \cap B|}{|B|} = \frac{1}{3} $ diff --git a/src/content/questions/comp2804/2019-fall-final/17/solution.md b/src/content/questions/comp2804/2019-fall-final/17/solution.md index d15715c7..2303faf1 100644 --- a/src/content/questions/comp2804/2019-fall-final/17/solution.md +++ b/src/content/questions/comp2804/2019-fall-final/17/solution.md @@ -14,9 +14,15 @@ $ |A \cap B| = 2 $
$ Pr(A \cap B) = \frac{2}{10} = \frac{1}{5} $ -Avatar: The Last Airbender is pretty high tier -Let's check for independence -$ Pr(A \cap B) = Pr(A) \cdot Pr(B) $ -$ \frac{1}{5} = \frac{1}{2} \cdot \frac{1}{2} $ -$ \frac{1}{5} = \frac{1}{4} $ + +Avatar: The Last Airbender is pretty high tier + +Let's check for independence + +$ Pr(A \cap B) = Pr(A) \cdot Pr(B) $ + +$ \frac{1}{5} = \frac{1}{2} \cdot \frac{1}{2} $ + +$ \frac{1}{5} = \frac{1}{4} $ + The equation is not false; therefore, they're dependent diff --git a/src/content/questions/comp2804/2019-fall-final/18/solution.md b/src/content/questions/comp2804/2019-fall-final/18/solution.md index 04562a7f..cd67a8d9 100644 --- a/src/content/questions/comp2804/2019-fall-final/18/solution.md +++ b/src/content/questions/comp2804/2019-fall-final/18/solution.md @@ -14,9 +14,15 @@ $ |A \cap B| = 3 $
$ Pr(A \cap B) = \frac{3}{10} $ -Caedrel is the best rat -Let's check for independence -$ Pr(A \cap B) = Pr(A) \cdot Pr(B) $ -$ \frac{3}{10} = \frac{1}{2} \cdot \frac{3}{5} $ -$ \frac{3}{10} = \frac{3}{10} $ + +Caedrel is the best rat + +Let's check for independence + +$ Pr(A \cap B) = Pr(A) \cdot Pr(B) $ + +$ \frac{3}{10} = \frac{1}{2} \cdot \frac{3}{5} $ + +$ \frac{3}{10} = \frac{3}{10} $ + Therefore, it is independent diff --git a/src/content/questions/comp2804/2019-fall-final/2/solution.md b/src/content/questions/comp2804/2019-fall-final/2/solution.md index b0265d5b..3b8a38bc 100644 --- a/src/content/questions/comp2804/2019-fall-final/2/solution.md +++ b/src/content/questions/comp2804/2019-fall-final/2/solution.md @@ -1,4 +1,7 @@ We choose 15 of the 85 positions to be a: $ \binom{85}{15} $ + We choose 30 of the 70 remaining positions to be d: $ \binom{70}{30} $ + The remaining 40 positions can be any of the 2 letters: $ 2^{40} $ + Thus, the total number of strings is $ \binom{85}{15} \cdot \binom{70}{30} \cdot 2^{40} $ diff --git a/src/content/questions/comp2804/2019-fall-final/20/solution.md b/src/content/questions/comp2804/2019-fall-final/20/solution.md index f3b319d0..fa14a907 100644 --- a/src/content/questions/comp2804/2019-fall-final/20/solution.md +++ b/src/content/questions/comp2804/2019-fall-final/20/solution.md @@ -1,10 +1,19 @@ Let $X_1$ be the amount of dollars you win if the first coin comes up tails: $-1$ + There's a 50/50 chance of it landing tails + $ Pr(X_1 = -1) = \frac{1}{2} $ + Let $X_2$ be the amount of dollars you win if the second coin comes up heads: $2$ + There's a 50/50 chance of it landing heads + $ Pr(X_2 = 2) = \frac{1}{2} $ + $ E(X) = (-1) \cdot Pr(X_1 = -1) + 2 \cdot Pr(X_2 = 2) $ + $ E(X) = (-1) \cdot \frac{1}{2} + 2 \cdot \frac{1}{2} $ + $ E(X) = -\frac{1}{2} + 1 $ + $ E(X) = \frac{1}{2} $ diff --git a/src/content/questions/comp2804/2019-fall-final/24/solution.md b/src/content/questions/comp2804/2019-fall-final/24/solution.md index 7d3832ec..d5e5e21f 100644 --- a/src/content/questions/comp2804/2019-fall-final/24/solution.md +++ b/src/content/questions/comp2804/2019-fall-final/24/solution.md @@ -19,11 +19,19 @@ Let $X_i$ be 1 if the students at positions $i$ and $2i$ are politically correct $ Pr (X_i=1 ) = \frac{ 1 }{ 1 } \cdot \frac{k \cdot (k-1) \cdot 1 }{n \cdot (n-1) } $
$ Pr (X_i=1 ) = \frac{k \cdot (k-1) }{n \cdot (n-1) } $ -Well, $S_n$ corresponds to $S*{ \frac{n}{2} }$ -$S_{n-2}$ corresponds to $S_{ \frac{n}{2}-1}$ -$S_{n-4}$ corresponds to $S_{ \frac{n}{2}-2}$ -Half of everyone has a corresponding junior -$ E(X) = \sum*{i=1}^{n/2} Pr(X_i=1) $ -$ E(X) = \sum*{i=1}^{n/2} \frac{k \cdot (k-1) }{n \cdot (n-1) } $ -$ E(X) = \frac{k (k-1) }{n (n-1) } \cdot \frac{n}{2} $ + +Well, $S_n$ corresponds to $S*{ \frac{n}{2} }$ + +$S_{n-2}$ corresponds to $S_{ \frac{n}{2}-1}$ + +$S_{n-4}$ corresponds to $S_{ \frac{n}{2}-2}$ + +Half of everyone has a corresponding junior + +$ E(X) = \sum\*{i=1}^{n/2} Pr(X_i=1) $ + +$ E(X) = \sum\*{i=1}^{n/2} \frac{k \cdot (k-1) }{n \cdot (n-1) } $ + +$ E(X) = \frac{k (k-1) }{n (n-1) } \cdot \frac{n}{2} $ + IT'S OVER. THE PAIN. THE SUFFERING. THE NIGHTMARES. diff --git a/src/content/questions/comp2804/2019-fall-final/7/solution.md b/src/content/questions/comp2804/2019-fall-final/7/solution.md index d82a8602..732efd6f 100644 --- a/src/content/questions/comp2804/2019-fall-final/7/solution.md +++ b/src/content/questions/comp2804/2019-fall-final/7/solution.md @@ -1,6 +1,9 @@ Yeah, so this is the dividers method. Let's define some stuff I guess + Let $x_1, x_2, x_3, x_4, x_5, x_6, x_7$ be the number of bananas Nick eats on each day + Now, $x_1 + x_2 + x_3 + x_4 + x_5 + x_6 + x_7 = 25$ + Assuming you have a sea of bananas, let's put dividers to split them off into different days -There is an unlimited supply for each of these types. -There are 75 students at the party, and each of them gets one drink, which is chosen uniformly at random from these three types. + +There is an unlimited supply for each of these types. + +There are 75 students at the party, and each of them gets one drink, which is chosen uniformly at random from these three types. + Let be the event $ A = \text{\enquote{exactly 50 students get Magners Original Irish Cider}.} $ + What is Pr $ (A) $? -We need to choose 50 students to get Magners Original Irish Cider from the 75 students: $ \binom{75}{50} $ -For each of the 50 students, there is a $ \frac{1}{3} $ chance of getting Magners Original Irish Cider: $ {( \frac{1}{3})}^{50} $ -For each of the 25 students, there is a $ \frac{2}{3} $ chance of not getting Magners Original Irish Cider: $ {( \frac{2}{3})}^{25} $ -Pr $ (A) = \binom{75}{50} \cdot {( \frac{1}{3})}^{50} \cdot {( \frac{2}{3})}^{25} $ + +We need to choose 50 students to get Magners Original Irish Cider from the 75 students: $ \binom{75}{50} $ + +For each of the 50 students, there is a $ \frac{1}{3} $ chance of getting Magners Original Irish Cider: $ {( \frac{1}{3})}^{50} $ + +For each of the 25 students, there is a $ \frac{2}{3} $ chance of not getting Magners Original Irish Cider: $ {( \frac{2}{3})}^{25} $ + +Pr $ (A) = \binom{75}{50} \cdot {( \frac{1}{3})}^{50} \cdot {( \frac{2}{3})}^{25} $ + Pr $ (A) = \frac{ \binom{75}{50} \cdot 2^{25}}{3^{75}} $ diff --git a/src/content/questions/comp2804/2019-winter-midterm/2/solution.md b/src/content/questions/comp2804/2019-winter-midterm/2/solution.md index 05fb383e..3015ed99 100644 --- a/src/content/questions/comp2804/2019-winter-midterm/2/solution.md +++ b/src/content/questions/comp2804/2019-winter-midterm/2/solution.md @@ -1,9 +1,17 @@ A = Permutations that contain $ bge $ + We can treat $ bge $ as a single entity. + B = Permutations that do not contain $ bge $ + So there's $ bge, a,c,d,f $ which is 5 entities. + $ |B| = 5! $ + $ |S| = $ Total permutations without restrictions + $ |S| = 7! $ + $ |\text{Number of permutations that do not contain} bge| = |S| - |B| $ + $ |\text{Number of permutations that do not contain} bge| = 7! - 5! $ diff --git a/src/content/questions/comp2804/2019-winter-midterm/3/solution.md b/src/content/questions/comp2804/2019-winter-midterm/3/solution.md index 79c72ca5..e13b2743 100644 --- a/src/content/questions/comp2804/2019-winter-midterm/3/solution.md +++ b/src/content/questions/comp2804/2019-winter-midterm/3/solution.md @@ -1,9 +1,17 @@ A = Strings that contain at least one lowercase letter + $ \overline{A} = $ Strings that contain no lowercase letters + $ |\overline{A}| = 26^{15} $ + B = Strings that contain at least one uppercase letter + $ \overline{B} = $ Strings that contain no uppercase letters + $ |\overline{B}| = 26^{15} $ + $ |A \cap B| = \text{All Possibilities} - |\overline{A}| - |\overline{B}| $ + $ |A \cap B| = 52^{15} - 26^{15} - 26^{15} $ + $ |A \cap B| = 52^{15} - 2 \cdot 26^{15} $ diff --git a/src/content/questions/comp2804/2019-winter-midterm/4/solution.md b/src/content/questions/comp2804/2019-winter-midterm/4/solution.md index 0c469a5e..91a7833a 100644 --- a/src/content/questions/comp2804/2019-winter-midterm/4/solution.md +++ b/src/content/questions/comp2804/2019-winter-midterm/4/solution.md @@ -1,2 +1,3 @@ $ \text{All Possibilities} - \text{0 even numbers} - \text{1 even number} $ + $ \binom{n}{k} - \binom{n/2}{k} - \binom{n/2}{k-1} $ diff --git a/src/content/questions/comp2804/2019-winter-midterm/5/solution.md b/src/content/questions/comp2804/2019-winter-midterm/5/solution.md index 2b8a0448..53c28ef1 100644 --- a/src/content/questions/comp2804/2019-winter-midterm/5/solution.md +++ b/src/content/questions/comp2804/2019-winter-midterm/5/solution.md @@ -1,10 +1,19 @@ A = Like beer + $ |A| = 37 $ + B = Like cider + $ |B| = 18 $ + $ |\overline{A \cup B}| = 55 $ + $ |A \cup B| = 100-55 $ + $ |A \cup B| = 45 $ + $ |A \cap B| = |A| + |B| - |A \cup B| $ + $ |A \cap B| = 37 + 18 - 45 $ + $ |A \cap B| = 10 $ diff --git a/src/content/questions/comp2804/2019-winter-midterm/6/solution.md b/src/content/questions/comp2804/2019-winter-midterm/6/solution.md index ecf08959..64b1dc03 100644 --- a/src/content/questions/comp2804/2019-winter-midterm/6/solution.md +++ b/src/content/questions/comp2804/2019-winter-midterm/6/solution.md @@ -1,6 +1,11 @@ We can use the pigeonhole principle to solve this problem. + We need to have 1 more than the maximum number of possible grades. + That way, we can guarantee that if all students receive different grades, the last student will receive a duplicate grade. + There are 5 possible grades: $ A, B, C, D, F $ + Thus, the minimum value for $ n $ is $ 5 \cdot 3 + 1 $ + Thus, the minimum value for $ n $ is 16. diff --git a/src/content/questions/comp2804/2019-winter-midterm/7/solution.md b/src/content/questions/comp2804/2019-winter-midterm/7/solution.md index b8f1b51b..64f478a4 100644 --- a/src/content/questions/comp2804/2019-winter-midterm/7/solution.md +++ b/src/content/questions/comp2804/2019-winter-midterm/7/solution.md @@ -1,2 +1,3 @@ We can treat the largest element as a fixed element. + We need to choose 16 other elements from the remaining 29 elements that are smaller than 30: $ \binom{29}{16} $ diff --git a/src/content/questions/comp2804/2019-winter-midterm/9/solution.md b/src/content/questions/comp2804/2019-winter-midterm/9/solution.md index 9b4c564c..87d6a702 100644 --- a/src/content/questions/comp2804/2019-winter-midterm/9/solution.md +++ b/src/content/questions/comp2804/2019-winter-midterm/9/solution.md @@ -1,4 +1,7 @@ There are $ n/2 $ even positions. + We need to choose $ k $ of these positions to be $ a $'s: $ \binom{n/2}{k} $ + The remaining $ n - k $ positions must be $ b $'s or $ c $'s: $ 2^{n-k} $ + Thus, there are $ \binom{n/2}{k} \cdot 2^{n-k} $ such strings.