From 6dd5c52ce43c68c58d5442ca375006d5918abc47 Mon Sep 17 00:00:00 2001 From: John Lu Date: Thu, 18 Jul 2024 03:36:10 -0400 Subject: [PATCH] spaced out 2017 winter final --- .../comp2804/2017-winter-final/1/solution.md | 1 + .../comp2804/2017-winter-final/10/solution.md | 9 +++++++ .../comp2804/2017-winter-final/11/solution.md | 10 ++++++++ .../comp2804/2017-winter-final/12/solution.md | 10 +++++--- .../comp2804/2017-winter-final/13/solution.md | 10 +++++--- .../comp2804/2017-winter-final/14/solution.md | 13 +++++++--- .../comp2804/2017-winter-final/15/solution.md | 7 ++++-- .../comp2804/2017-winter-final/16/solution.md | 13 ++++++++++ .../comp2804/2017-winter-final/17/solution.md | 4 +++ .../comp2804/2017-winter-final/19/solution.md | 6 +++++ .../comp2804/2017-winter-final/2/solution.md | 5 ++++ .../comp2804/2017-winter-final/20/solution.md | 9 ++++++- .../comp2804/2017-winter-final/21/solution.md | 13 +++++++--- .../comp2804/2017-winter-final/22/solution.md | 4 +++ .../comp2804/2017-winter-final/23/solution.md | 1 + .../comp2804/2017-winter-final/24/solution.md | 8 ++++++ .../comp2804/2017-winter-final/3/solution.md | 5 +++- .../comp2804/2017-winter-final/4/solution.md | 10 ++++++++ .../comp2804/2017-winter-final/6/solution.md | 25 +++++++++++++------ .../comp2804/2017-winter-final/7/solution.md | 7 ++++-- .../comp2804/2017-winter-final/8/solution.md | 14 ++++++++--- 21 files changed, 152 insertions(+), 32 deletions(-) diff --git a/src/content/questions/comp2804/2017-winter-final/1/solution.md b/src/content/questions/comp2804/2017-winter-final/1/solution.md index c91f6941..5ea73d19 100644 --- a/src/content/questions/comp2804/2017-winter-final/1/solution.md +++ b/src/content/questions/comp2804/2017-winter-final/1/solution.md @@ -12,4 +12,5 @@ Well, let's break it down We can place the last even number in the last remaining even position: 1
This creates $ 5! $ permutations + Multiplying the two permutations, we get $ 5! \cdot 5! $ diff --git a/src/content/questions/comp2804/2017-winter-final/10/solution.md b/src/content/questions/comp2804/2017-winter-final/10/solution.md index 7736fc0a..b792abe6 100644 --- a/src/content/questions/comp2804/2017-winter-final/10/solution.md +++ b/src/content/questions/comp2804/2017-winter-final/10/solution.md @@ -1,10 +1,19 @@ Let S be all possible strings of length 14: $ |S| = 26^{14} $ + Let B be the event that the string contains at no vowels + The first character can be any of the 21 consonants: 21 + The second character can be any of the 21 consonants: 21 + ... + The 14th character can be any of the 21 consonants: 21 + $ |B| = 21^{14} $ + $ Pr(B) = \frac{21^{14}}{26^{14}} $ + $ Pr(A) = 1 - Pr(B) $ + $ Pr(A) = 1 - \frac{21^{14}}{26^{14}} $ diff --git a/src/content/questions/comp2804/2017-winter-final/11/solution.md b/src/content/questions/comp2804/2017-winter-final/11/solution.md index 1f87efa5..373fdf93 100644 --- a/src/content/questions/comp2804/2017-winter-final/11/solution.md +++ b/src/content/questions/comp2804/2017-winter-final/11/solution.md @@ -1,11 +1,21 @@ This means there are 13 positions + First, select 2 of the girls to be Elisa's neighbors: $ \binom{6}{2} $ + Since we're putting 2 girls beside Elisa, girl 1 can be on the left and girl 2 can be on the right OR girl 1 can be on the right and girl 2 can be on the left: 2 + As a single entity, the 3 girls can be placed, starting from position 0 to position 10: 11 + The remaining 10 people can be placed in the remaining 10 positions: 10! + $ \binom{6}{2} \cdot 2 \cdot 11 \cdot 10! $ + $ = \frac{6!}{2!4!} \cdot 2 \cdot 11 \cdot 10! $ + $ = \frac{6!}{4!} \cdot 11 \cdot 10! $ + $ = \frac{6 \cdot 5 \cdot 4!}{4!} \cdot 11 \cdot 10! $ + $ = \frac{6 \cdot 5}{1} \cdot 11 \cdot 10! $ + $ = 6 \cdot 5 \cdot 11 \cdot 10! $ diff --git a/src/content/questions/comp2804/2017-winter-final/12/solution.md b/src/content/questions/comp2804/2017-winter-final/12/solution.md index a79819f4..4282b98f 100644 --- a/src/content/questions/comp2804/2017-winter-final/12/solution.md +++ b/src/content/questions/comp2804/2017-winter-final/12/solution.md @@ -17,7 +17,11 @@ $ |A \cap B| = \binom{8}{3} $
$ Pr(A \cap B) = \frac{ \binom{8}{3} }{ \binom{10}{5} } = \frac{8!}{5!3!} div \frac{10!}{5!5!} = \frac{8!}{5!3!} \cdot \frac{5!5!}{10!} = \frac{8!}{3!} \cdot \frac{5!}{10!} = \frac{1}{3!} \cdot \frac{5!}{10 \cdot 9} = \frac{1}{1} \cdot \frac{5 \cdot 4}{10 \cdot 9} = \frac{5 \cdot 2}{5 \cdot 9} = \frac{2}{9} $ -$ Pr(A|B) = \frac{ Pr(A \cap B) }{ Pr(B) } $ -$ Pr(A|B) = \frac{ \frac{2}{9} }{ \frac{1}{2} } $ -$ Pr(A|B) = \frac{2}{9} \cdot \frac{2}{1} $ + +$ Pr(A|B) = \frac{ Pr(A \cap B) }{ Pr(B) } $ + +$ Pr(A|B) = \frac{ \frac{2}{9} }{ \frac{1}{2} } $ + +$ Pr(A|B) = \frac{2}{9} \cdot \frac{2}{1} $ + $ Pr(A|B) = \frac{4}{9} $ diff --git a/src/content/questions/comp2804/2017-winter-final/13/solution.md b/src/content/questions/comp2804/2017-winter-final/13/solution.md index b9636c3e..78877d09 100644 --- a/src/content/questions/comp2804/2017-winter-final/13/solution.md +++ b/src/content/questions/comp2804/2017-winter-final/13/solution.md @@ -10,7 +10,11 @@ $ | B \cap A | = 4 $
$ Pr(A \cap B) = \frac{4}{32} = \frac{1}{8} $ -$ Pr(A|B) = \frac{ Pr(A \cap B) }{ Pr(B) } $ -$ Pr(A|B) = \frac{ \frac{1}{8} }{ \frac{1}{2} } $ -$ Pr(A|B) = \frac{1}{8} \cdot \frac{2}{1} $ + +$ Pr(A|B) = \frac{ Pr(A \cap B) }{ Pr(B) } $ + +$ Pr(A|B) = \frac{ \frac{1}{8} }{ \frac{1}{2} } $ + +$ Pr(A|B) = \frac{1}{8} \cdot \frac{2}{1} $ + $ Pr(A|B) = \frac{1}{4} $ diff --git a/src/content/questions/comp2804/2017-winter-final/14/solution.md b/src/content/questions/comp2804/2017-winter-final/14/solution.md index 038744ff..93cfb5c5 100644 --- a/src/content/questions/comp2804/2017-winter-final/14/solution.md +++ b/src/content/questions/comp2804/2017-winter-final/14/solution.md @@ -21,8 +21,13 @@ $ |A \cap B| = \frac{(n-1)!}{2!} $
$ Pr(A \cap B) = \frac{(n-1)!}{2 \cdot n!} = \frac{1}{2n} $ -Now, let's check for independence -$ Pr(A \cap B) = Pr(A) \cdot Pr(B) $ -$ \frac{1}{2n} = \frac{1}{n} \cdot \frac{1}{2} $ -$ \frac{1}{2n} = \frac{1}{2n} $ + +Now, let's check for independence + +$ Pr(A \cap B) = Pr(A) \cdot Pr(B) $ + +$ \frac{1}{2n} = \frac{1}{n} \cdot \frac{1}{2} $ + +$ \frac{1}{2n} = \frac{1}{2n} $ + Since the equation is true, A and B are independent diff --git a/src/content/questions/comp2804/2017-winter-final/15/solution.md b/src/content/questions/comp2804/2017-winter-final/15/solution.md index a9bf02d3..d4e74848 100644 --- a/src/content/questions/comp2804/2017-winter-final/15/solution.md +++ b/src/content/questions/comp2804/2017-winter-final/15/solution.md @@ -9,6 +9,9 @@ The probability that both $a_1 = 1$ and $a_n = 5$ is $ \frac{1}{n^2} $
$ Pr(A \cap B) = \frac{1}{n^2} $ -$ Pr(A \cup B) = Pr(A) + Pr(B) - Pr(A \cap B) $ -$ Pr(A \cup B) = \frac{1}{n} + \frac{1}{n} - \frac{1}{n} \frac{1}{n-1} $ + +$ Pr(A \cup B) = Pr(A) + Pr(B) - Pr(A \cap B) $ + +$ Pr(A \cup B) = \frac{1}{n} + \frac{1}{n} - \frac{1}{n} \frac{1}{n-1} $ + $ Pr(A \cup B) = \frac{2}{n} - \frac{1}{n(n-1)} $ diff --git a/src/content/questions/comp2804/2017-winter-final/16/solution.md b/src/content/questions/comp2804/2017-winter-final/16/solution.md index 592b6415..b3f151d3 100644 --- a/src/content/questions/comp2804/2017-winter-final/16/solution.md +++ b/src/content/questions/comp2804/2017-winter-final/16/solution.md @@ -1,14 +1,27 @@ Let's make some statements and see what we can get + $ Pr(A|B) = \frac{Pr(A \cap B)}{Pr(B)} $ + $ Pr(B|A) = \frac{Pr(A \cap B)}{Pr(A)} $ + $ \frac{Pr(A \cap B)}{Pr(A)} = \frac{Pr(A \cap B)}{Pr(B)} $ + $ Pr(A) = Pr(B) $ + $ Pr(A \cup B) = Pr(A) + Pr(B) - Pr(A \cap B) = 1 $ + $ 2Pr(A) - Pr(A \cap B) = 1 $ + For the above statement to be true, $ Pr(A) > \frac{1}{2} $ because $ Pr(A \cap B) > 0 $ + To illustrate, let's use some values + $ Pr(A) = 0.5 $ and $ Pr(A \cap B) = 0.25 $ + $ 2 \cdot 0.5 - 0.25 = 1 $ + $ 1 - 0.25 = 1 $ + $ 0.75 = 1 $ + As can be seen, $ Pr(A) > \frac{1}{2} $ needs to be true in order to counter the fact that $ Pr(A \cap B) > 0 $ diff --git a/src/content/questions/comp2804/2017-winter-final/17/solution.md b/src/content/questions/comp2804/2017-winter-final/17/solution.md index 4506440b..87278663 100644 --- a/src/content/questions/comp2804/2017-winter-final/17/solution.md +++ b/src/content/questions/comp2804/2017-winter-final/17/solution.md @@ -1,5 +1,9 @@ For all intents and purposes, the set we really care about is $ |S| = 4! $ + We can do $ { (1,2), (2,1) } $ on the left side: 2 + We can do $ { (8,4), (4,8) } $ on the right side: 2 + $ |A| = 2 \cdot 2 $ + $ Pr(A) = \frac{4}{24} = \frac{1}{6} $ diff --git a/src/content/questions/comp2804/2017-winter-final/19/solution.md b/src/content/questions/comp2804/2017-winter-final/19/solution.md index bd12296d..c6341957 100644 --- a/src/content/questions/comp2804/2017-winter-final/19/solution.md +++ b/src/content/questions/comp2804/2017-winter-final/19/solution.md @@ -1,7 +1,13 @@ Let's check for the probability that 3 people have the same birthday for every subset of 3 people + We choose 3 people out of the n people: $ \binom{n}{3} $ + The first dude in the subset can have birthday on any day of the year: $ \frac{365}{365} $ + The second bro in the subset must have the same birthday as the first dude: $ \frac{1}{365} $ + The thid mate in the subset must have the same birthday as the first dude: $ \frac{1}{365} $ + The probability that 3 people have the same birthday is $ \frac{1}{365^2} $ + $ \mathbb{E}(X) = \binom{n}{3} \cdot \frac{1}{365^2} $ diff --git a/src/content/questions/comp2804/2017-winter-final/2/solution.md b/src/content/questions/comp2804/2017-winter-final/2/solution.md index c499eb29..059e7de0 100644 --- a/src/content/questions/comp2804/2017-winter-final/2/solution.md +++ b/src/content/questions/comp2804/2017-winter-final/2/solution.md @@ -1,6 +1,11 @@ Well, let's break it down + We choose 2 numbers out of the n numbers: $ \binom{n}{2} $ + The other n-2 numbers can be placed in any order: $ (n-2)! $ + $ \binom{n}{2} \cdot (n-2)! $ + $ = \frac{n!}{2! \cdot (n-2)!} \cdot (n-2)! $ + $ = \frac{n!}{2!} $ diff --git a/src/content/questions/comp2804/2017-winter-final/20/solution.md b/src/content/questions/comp2804/2017-winter-final/20/solution.md index 5e3bb127..a7753a8b 100644 --- a/src/content/questions/comp2804/2017-winter-final/20/solution.md +++ b/src/content/questions/comp2804/2017-winter-final/20/solution.md @@ -1,8 +1,15 @@ Let's calculate the expected value of the each flip + $ \mathbb{E}(X) = 100 \cdot Pr(\text{Heads}) + 50 \cdot Pr(\text{Tails}) $ + $ 100 \cdot \frac{1}{5} + 50 \cdot \frac{4}{5} $ + $ = 20 + 40 $ + $ = 60 $ -Since we flip 2 coins, we double the expected value + +Since we flip 2 coins, we double the expected value + $ \mathbb{E}(X) = 60 \cdot 2 $ + $ \mathbb{E}(X) = 120 $ diff --git a/src/content/questions/comp2804/2017-winter-final/21/solution.md b/src/content/questions/comp2804/2017-winter-final/21/solution.md index 430c5d81..9c9df526 100644 --- a/src/content/questions/comp2804/2017-winter-final/21/solution.md +++ b/src/content/questions/comp2804/2017-winter-final/21/solution.md @@ -11,8 +11,13 @@ We don't need to calculate all possibilities. Since this is independence, we're If the only rolls that satisfy condition 1 are $ (1,6), (6,1) $ and the only rolls that satisfy condition 2 are $ (1,1) $, then there are no rolls that satisfy both conditions
$ Pr(X=5 \cap Y=1) = 0 $ -Now, check time -$ Pr(X=5 \cap Y=1) = Pr(X=5) \cdot Pr(Y=1) $ -$ 0 = \frac{1}{18} \cdot \frac{1}{36} $ -$ 0 = \frac{1}{648} $ + +Now, check time + +$ Pr(X=5 \cap Y=1) = Pr(X=5) \cdot Pr(Y=1) $ + +$ 0 = \frac{1}{18} \cdot \frac{1}{36} $ + +$ 0 = \frac{1}{648} $ + Since the equation is false, there are dependent diff --git a/src/content/questions/comp2804/2017-winter-final/22/solution.md b/src/content/questions/comp2804/2017-winter-final/22/solution.md index 93900790..07c999fe 100644 --- a/src/content/questions/comp2804/2017-winter-final/22/solution.md +++ b/src/content/questions/comp2804/2017-winter-final/22/solution.md @@ -1,5 +1,9 @@ Idk, I'll just write down what I see and try to find a pattern + We have a 1 in 4 chance of landing 2 heads per double coin flip + $ Pr(X = 1) + Pr(X = 2) + Pr(X = 3) + Pr(X = 4) + ... $ + $ \frac{1}{4} + ( \frac{3}{4})( \frac{1}{4}) + {( \frac{3}{4})}^2 ( \frac{1}{4}) + ... $ + From this, I got the formula $ {( \frac{3}{4})}^{m-1} \cdot \frac{1}{4} $ diff --git a/src/content/questions/comp2804/2017-winter-final/23/solution.md b/src/content/questions/comp2804/2017-winter-final/23/solution.md index 106ee8fd..deee79df 100644 --- a/src/content/questions/comp2804/2017-winter-final/23/solution.md +++ b/src/content/questions/comp2804/2017-winter-final/23/solution.md @@ -1,2 +1,3 @@ The answer is that it's cap. Linearity of expectations only works on addition and subtraction. + I call \cap on multiplication and division diff --git a/src/content/questions/comp2804/2017-winter-final/24/solution.md b/src/content/questions/comp2804/2017-winter-final/24/solution.md index f42c69ef..2507839e 100644 --- a/src/content/questions/comp2804/2017-winter-final/24/solution.md +++ b/src/content/questions/comp2804/2017-winter-final/24/solution.md @@ -1,9 +1,17 @@ Thank God I have a second monitor to watch YouTube videos on + Alright, so let's break it down. It's asking for the probability that a $D_i$ is a cider and $D_{i+1}$ is not a cider + First has probability of being cider $ \frac{11}{12} $ + Second has probability of not being cider $ \frac{1}{12} $ + This occurs 6 times. Not 7 because $D_n$ has no $D_{n+1}$ to compare it to + $ \mathbb{E}(X) = \sum\_{i=1}^{6} \frac{11}{12} \cdot \frac{1}{12} $ + $ \mathbb{E}(X) = 6 \cdot \frac{11}{12} \cdot \frac{1}{12} $ + $ \mathbb{E}(X) = 6 \cdot \frac{11}{144} $ + $ \mathbb{E}(X) = \frac{6}{144} $ diff --git a/src/content/questions/comp2804/2017-winter-final/3/solution.md b/src/content/questions/comp2804/2017-winter-final/3/solution.md index 848cc125..4f44e233 100644 --- a/src/content/questions/comp2804/2017-winter-final/3/solution.md +++ b/src/content/questions/comp2804/2017-winter-final/3/solution.md @@ -1,4 +1,5 @@ Holy moly, that's a lot of words + Let's do this anyway$ ( $cries internally $ ) $ -$ B \cup C = |B| + |C| - |B \cap C| $ + +$ B \cup C = |B| + |C| - |B \cap C| $ + $ B \cup C = \binom{17}{5} \cdot 2^{28} + \binom{28}{5} \cdot 2^{17} - \binom{17}{5} \cdot \binom{28}{5} $ diff --git a/src/content/questions/comp2804/2017-winter-final/4/solution.md b/src/content/questions/comp2804/2017-winter-final/4/solution.md index 88a13794..cd0d3f49 100644 --- a/src/content/questions/comp2804/2017-winter-final/4/solution.md +++ b/src/content/questions/comp2804/2017-winter-final/4/solution.md @@ -1,11 +1,21 @@ Let A be the event that a string of length n is a palindrome + The leftmost bit can be 1 or 0: 2 possibilities + The rightmost bit must be the same as the leftmost bit: 1 possibility + The second leftmost bit can be 1 or 0: 2 possibilities + The second rightmost bit must be the same as the second leftmost bit: 1 possibility + ... + The innermost leftmost bit can be 1 or 0: 2 possibilities + The innermost rightmost bit must be the same as the innermost leftmost bit: 1 possibility + $ |A| = 2 \cdot 1 \cdot 2 \cdot 1 \cdot ... \cdot 2 \cdot 1 = 2^{n/2} $ + Usually, this would be right; however, we know the middle bit is always the same as itself AND n/2 is a \fraction since n is odd + $ |A| = 2^{ \frac{n+1}{2}} $ diff --git a/src/content/questions/comp2804/2017-winter-final/6/solution.md b/src/content/questions/comp2804/2017-winter-final/6/solution.md index c7bf211c..dc4a5a1f 100644 --- a/src/content/questions/comp2804/2017-winter-final/6/solution.md +++ b/src/content/questions/comp2804/2017-winter-final/6/solution.md @@ -6,12 +6,21 @@
  • Let's determine $ \overline{B} \cap \overline{C} $
    $ | \overline{B} \cap \overline{C} | = 25 $ -Now, let's determine $ B \cup C $ -$ B \cup C = 100 - | \overline{B} \cap \overline{C} | $ -$ B \cup C = 100 - 25 $ -$ B \cup C = 75 $ -Finally, we can determine $ B \cap C $ -$ B \cup C = |B| + |C| - |B \cap C| $ -$ 75 = 63 + 71 - |B \cap C| $ -$ 75 = 134 - |B \cap C| $ + +Now, let's determine $ B \cup C $ + +$ B \cup C = 100 - | \overline{B} \cap \overline{C} | $ + +$ B \cup C = 100 - 25 $ + +$ B \cup C = 75 $ + +Finally, we can determine $ B \cap C $ + +$ B \cup C = |B| + |C| - |B \cap C| $ + +$ 75 = 63 + 71 - |B \cap C| $ + +$ 75 = 134 - |B \cap C| $ + $ |B \cap C| = 59 $ diff --git a/src/content/questions/comp2804/2017-winter-final/7/solution.md b/src/content/questions/comp2804/2017-winter-final/7/solution.md index 10afd250..cd2a3c48 100644 --- a/src/content/questions/comp2804/2017-winter-final/7/solution.md +++ b/src/content/questions/comp2804/2017-winter-final/7/solution.md @@ -1,4 +1,7 @@ Let's just write down the possible bitstrings and add them up -$ 0, 0, S*{n-2} $ -$ 1, 0, 0, 0, S*{n-4} $ + +$ 0, 0, S\*{n-2} $ + +$ 1, 0, 0, 0, S\*{n-4} $ + Adding them up, we get $ S*n = S*{n-2} + S\_{n-4} $ diff --git a/src/content/questions/comp2804/2017-winter-final/8/solution.md b/src/content/questions/comp2804/2017-winter-final/8/solution.md index 7ddd0d60..0834e0f0 100644 --- a/src/content/questions/comp2804/2017-winter-final/8/solution.md +++ b/src/content/questions/comp2804/2017-winter-final/8/solution.md @@ -1,7 +1,13 @@ Consider the case where the current bit, next bit, and bit after that are all 0 + That means we can just calculate the remaining possible bitstring combinations since the requirements have already been met + $ 2^{n-3} $ -$ 1, S*{n-1} $ -$ 0, 1, S*{n-2} $ -$ 0, 0, 1, S*{n-3} $ -Adding them up, we get $ S_n = S*{n-1} + S*{n-2} + S*{n-3} + 2^{n-3} $ + +$ 1, S\*{n-1} $ + +$ 0, 1, S\*{n-2} $ + +$ 0, 0, 1, S\*{n-3} $ + +Adding them up, we get $ S_n = S*{n-1} + S*{n-2} + S\*{n-3} + 2^{n-3} $