From cce0bf5b792b98627c963b789913058b92353775 Mon Sep 17 00:00:00 2001 From: John Lu Date: Thu, 18 Jul 2024 03:06:24 -0400 Subject: [PATCH] spaced out 2016 fall final --- .../comp2804/2016-fall-final/1/solution.md | 5 ++ .../comp2804/2016-fall-final/10/solution.md | 15 ++++-- .../comp2804/2016-fall-final/11/solution.md | 12 +++-- .../comp2804/2016-fall-final/12/solution.md | 21 +++++---- .../comp2804/2016-fall-final/13/solution.md | 20 ++++---- .../comp2804/2016-fall-final/16/solution.md | 41 +++++++++-------- .../comp2804/2016-fall-final/17/solution.md | 46 ++++++++++--------- .../comp2804/2016-fall-final/18/solution.md | 6 ++- .../comp2804/2016-fall-final/19/solution.md | 5 ++ .../comp2804/2016-fall-final/2/solution.md | 5 ++ .../comp2804/2016-fall-final/20/solution.md | 3 ++ .../comp2804/2016-fall-final/21/solution.md | 20 ++++---- .../comp2804/2016-fall-final/22/solution.md | 31 +++++++------ .../comp2804/2016-fall-final/23/solution.md | 28 ++++++----- .../comp2804/2016-fall-final/24/solution.md | 6 +++ .../comp2804/2016-fall-final/3/solution.md | 29 ++++++------ .../comp2804/2016-fall-final/4/solution.md | 14 +++--- .../comp2804/2016-fall-final/5/solution.md | 32 ++++++++----- .../comp2804/2016-fall-final/7/solution.md | 23 ++++++---- .../comp2804/2016-fall-final/8/solution.md | 27 ++++++----- 20 files changed, 231 insertions(+), 158 deletions(-) diff --git a/src/content/questions/comp2804/2016-fall-final/1/solution.md b/src/content/questions/comp2804/2016-fall-final/1/solution.md index be737937..7ca264be 100644 --- a/src/content/questions/comp2804/2016-fall-final/1/solution.md +++ b/src/content/questions/comp2804/2016-fall-final/1/solution.md @@ -1,6 +1,11 @@ Well, they aren't one-to-one functions, so each input has 7 possible outputs + The first input has 9 possible outputs + The second input has 9 possible outputs + ... + The seventh input has 9 possible outputs + $ 9^7 $ diff --git a/src/content/questions/comp2804/2016-fall-final/10/solution.md b/src/content/questions/comp2804/2016-fall-final/10/solution.md index aca0d080..8ca0aacb 100644 --- a/src/content/questions/comp2804/2016-fall-final/10/solution.md +++ b/src/content/questions/comp2804/2016-fall-final/10/solution.md @@ -1,6 +1,11 @@ -Well, the first character can be $ {a, b, c, d, e} $: 5 -The second character can be $ {a, b, c, d, e} - { \text{first character} } $: 4 -The third character can be $ {a, b, c, d, e} - { \text{second character} } $: 4 -... -The nth character can be $ {a, b, c, d, e} - { \text{previous character} } $: 4 +Well, the first character can be $ {a, b, c, d, e} $: 5 + +The second character can be $ {a, b, c, d, e} - { \text{first character} } $: 4 + +The third character can be $ {a, b, c, d, e} - { \text{second character} } $: 4 + +... + +The nth character can be $ {a, b, c, d, e} - { \text{previous character} } $: 4 + $ 5 \cdot 4^{n-1} $ diff --git a/src/content/questions/comp2804/2016-fall-final/11/solution.md b/src/content/questions/comp2804/2016-fall-final/11/solution.md index cec94eb9..0dc104d3 100644 --- a/src/content/questions/comp2804/2016-fall-final/11/solution.md +++ b/src/content/questions/comp2804/2016-fall-final/11/solution.md @@ -1,11 +1,13 @@ We can use the stars and bars method to solve this problem. + We have 4 dividers and 28 stars. + The number of solutions to the equation is $ \binom{28+4}{4} $ diff --git a/src/content/questions/comp2804/2016-fall-final/12/solution.md b/src/content/questions/comp2804/2016-fall-final/12/solution.md index 03ac6f23..cf7a2f1b 100644 --- a/src/content/questions/comp2804/2016-fall-final/12/solution.md +++ b/src/content/questions/comp2804/2016-fall-final/12/solution.md @@ -1,13 +1,16 @@ -$ Pr(B|A) = \frac{Pr(A \cap B)}{Pr(A)} $ -$ Pr(B|A) = \frac{ \frac{1}{36}}{ \frac{5}{36}} $ + +$ Pr(B|A) = \frac{Pr(A \cap B)}{Pr(A)} $ + +$ Pr(B|A) = \frac{ \frac{1}{36}}{ \frac{5}{36}} $ + $ Pr(B|A) = \frac{1}{5} $ diff --git a/src/content/questions/comp2804/2016-fall-final/13/solution.md b/src/content/questions/comp2804/2016-fall-final/13/solution.md index 55d85121..8f11a04d 100644 --- a/src/content/questions/comp2804/2016-fall-final/13/solution.md +++ b/src/content/questions/comp2804/2016-fall-final/13/solution.md @@ -1,12 +1,12 @@ diff --git a/src/content/questions/comp2804/2016-fall-final/16/solution.md b/src/content/questions/comp2804/2016-fall-final/16/solution.md index a68d40ea..8d7ddc38 100644 --- a/src/content/questions/comp2804/2016-fall-final/16/solution.md +++ b/src/content/questions/comp2804/2016-fall-final/16/solution.md @@ -1,24 +1,27 @@ -Now, let's determine $ A $ -$ Pr(A) = Pr(S) - Pr(B) - Pr(C) $ + +Now, let's determine $ A $ + +$ Pr(A) = Pr(S) - Pr(B) - Pr(C) $ + $ Pr(A) = 1 - \frac{364^n}{365^n} - \frac{n \cdot 1 \cdot 364^{n-1}}{365^n} $ diff --git a/src/content/questions/comp2804/2016-fall-final/17/solution.md b/src/content/questions/comp2804/2016-fall-final/17/solution.md index b130ab1b..e9003ece 100644 --- a/src/content/questions/comp2804/2016-fall-final/17/solution.md +++ b/src/content/questions/comp2804/2016-fall-final/17/solution.md @@ -1,27 +1,31 @@ -Now, let's determine $ A $ -$ Pr(A) = Pr(B) + Pr(C) - Pr(B \cap C) $ -$ Pr(A) = \frac{1 \cdot \binom{99}{16}}{\binom{100}{17}} + \frac{1 \cdot \binom{99}{16}}{\binom{100}{17}} - \frac{1 \cdot 1 \cdot \binom{98}{15}}{\binom{100}{17}} $ + +Now, let's determine $ A $ + +$ Pr(A) = Pr(B) + Pr(C) - Pr(B \cap C) $ + +$ Pr(A) = \frac{1 \cdot \binom{99}{16}}{\binom{100}{17}} + \frac{1 \cdot \binom{99}{16}}{\binom{100}{17}} - \frac{1 \cdot 1 \cdot \binom{98}{15}}{\binom{100}{17}} $ + $ Pr(A) = \frac{2 \cdot \binom{99}{16} - \binom{98}{15}}{\binom{100}{17}} $ diff --git a/src/content/questions/comp2804/2016-fall-final/18/solution.md b/src/content/questions/comp2804/2016-fall-final/18/solution.md index 5b448d0d..de3cde10 100644 --- a/src/content/questions/comp2804/2016-fall-final/18/solution.md +++ b/src/content/questions/comp2804/2016-fall-final/18/solution.md @@ -1,5 +1,9 @@ I'm not sure what the right way to do this is + Forget the other values, let's just focus on 3,4, and 8 + There are 3! ways to arrange 3,4, and 8: $ {(3,4,8), (3,8,4), (4,3,8), (4,8,3), (8,3,4), (8,4,3) } $ -Out of those 6 ways, only 2 of them have 4 and 8 to the left of 3: $ { (4,8,3), (8,4,3) } $ + +Out of those 6 ways, only 2 of them have 4 and 8 to the left of 3: $ { (4,8,3), (8,4,3) } $ + $ Pr(A) = \frac{2}{6} = \frac{1}{3} $ diff --git a/src/content/questions/comp2804/2016-fall-final/19/solution.md b/src/content/questions/comp2804/2016-fall-final/19/solution.md index 28f09f03..51915f50 100644 --- a/src/content/questions/comp2804/2016-fall-final/19/solution.md +++ b/src/content/questions/comp2804/2016-fall-final/19/solution.md @@ -1,6 +1,11 @@ Let $X_i$ be 1 if the next number is greater than the current number and 0 otherwise. + The probability that a random number is greater than the previous number is $\frac{1}{2}$ + $ \mathbb{E}(X) = \mathbb{E}(X*1 + X_2 + \text{...} + X*{n-1}) $ + $ \mathbb{E}(X) = \mathbb{E}(X*1) + \mathbb{E}(X_2) + \text{...} + \mathbb{E}(X*{n-1}) $ + $ \mathbb{E}(X) = \frac{1}{2} + \frac{1}{2} + \text{...} + \frac{1}{2} $ + $ \mathbb{E}(X) = \frac{n-1}{2} $ diff --git a/src/content/questions/comp2804/2016-fall-final/2/solution.md b/src/content/questions/comp2804/2016-fall-final/2/solution.md index 5f54b0c2..8eb2226b 100644 --- a/src/content/questions/comp2804/2016-fall-final/2/solution.md +++ b/src/content/questions/comp2804/2016-fall-final/2/solution.md @@ -1,6 +1,11 @@ The first input has 9 possible outputs + The second input has 8 possible outputs + ... + The seventh input has 3 possible outputs + $ 9 \cdot 8 \cdot 7 \cdot 6 \cdot 5 \cdot 4 \cdot 3 $ + $ \frac{9!}{2!} $ diff --git a/src/content/questions/comp2804/2016-fall-final/20/solution.md b/src/content/questions/comp2804/2016-fall-final/20/solution.md index 98748483..fac67537 100644 --- a/src/content/questions/comp2804/2016-fall-final/20/solution.md +++ b/src/content/questions/comp2804/2016-fall-final/20/solution.md @@ -1,4 +1,7 @@ We take all possible unordered pairs by choosing 2 out of the n people: $ \binom{n}{2} $ + $P_i$'s birthday can be any day: $ \frac{365}{365} $ + $P_j$'s birthday must be the same day: $ \frac{1}{365} $ + $ \mathbb{E}(X) = \binom{n}{2} \cdot \frac{1}{365} $ diff --git a/src/content/questions/comp2804/2016-fall-final/21/solution.md b/src/content/questions/comp2804/2016-fall-final/21/solution.md index 274709aa..220ca125 100644 --- a/src/content/questions/comp2804/2016-fall-final/21/solution.md +++ b/src/content/questions/comp2804/2016-fall-final/21/solution.md @@ -1,12 +1,16 @@ -$ \mathbb{E}(X) = 5 \cdot Pr(X=5) + 2 \cdot Pr(X=2) $ -$ \mathbb{E}(X) = 5 \cdot \frac{1}{7} + 2 \cdot \frac{6}{7} $ -$ \mathbb{E}(X) = \frac{5}{7} + \frac{12}{7} $ + +$ \mathbb{E}(X) = 5 \cdot Pr(X=5) + 2 \cdot Pr(X=2) $ + +$ \mathbb{E}(X) = 5 \cdot \frac{1}{7} + 2 \cdot \frac{6}{7} $ + +$ \mathbb{E}(X) = \frac{5}{7} + \frac{12}{7} $ + $ \mathbb{E}(X) = \frac{17}{7} $ diff --git a/src/content/questions/comp2804/2016-fall-final/22/solution.md b/src/content/questions/comp2804/2016-fall-final/22/solution.md index c1ad4b1c..2079fd30 100644 --- a/src/content/questions/comp2804/2016-fall-final/22/solution.md +++ b/src/content/questions/comp2804/2016-fall-final/22/solution.md @@ -2,21 +2,24 @@ For questions like these, we can answer by checking for a value $i$ if the follo -$ Pr(X=i \cap Y=i) = Pr(X=i) \cdot Pr(Y=i) $ -$ 0 = \frac{1}{2^7} \cdot \frac{1}{2^7} $ + +$ Pr(X=i \cap Y=i) = Pr(X=i) \cdot Pr(Y=i) $ + +$ 0 = \frac{1}{2^7} \cdot \frac{1}{2^7} $ + Since the equation is false, X and Y are not independent. diff --git a/src/content/questions/comp2804/2016-fall-final/23/solution.md b/src/content/questions/comp2804/2016-fall-final/23/solution.md index ef8129ac..2fea6b28 100644 --- a/src/content/questions/comp2804/2016-fall-final/23/solution.md +++ b/src/content/questions/comp2804/2016-fall-final/23/solution.md @@ -2,19 +2,23 @@ For questions like these, we can answer by checking for a value $i$ if the follo -$ Pr(X=1 \cap Y=1) = Pr(X=1) \cdot Pr(Y=1) $ -$ \frac{1}{5} = \frac{1}{2} \cdot \frac{2}{5} $ -$ \frac{1}{5} = \frac{1}{5} $ + +$ Pr(X=1 \cap Y=1) = Pr(X=1) \cdot Pr(Y=1) $ + +$ \frac{1}{5} = \frac{1}{2} \cdot \frac{2}{5} $ + +$ \frac{1}{5} = \frac{1}{5} $ + Since the equation is true, X and Y are independent. diff --git a/src/content/questions/comp2804/2016-fall-final/24/solution.md b/src/content/questions/comp2804/2016-fall-final/24/solution.md index 4991c3f5..39af5f23 100644 --- a/src/content/questions/comp2804/2016-fall-final/24/solution.md +++ b/src/content/questions/comp2804/2016-fall-final/24/solution.md @@ -1,7 +1,13 @@ Let's find the probability of rolling a number that is divisible by 3 + The numbers that are divisible by 3 are 3 and 6 + $ Pr(X=1) = \frac{2}{6} $ + We can use the geometric distribution to find the expected value of X + Basically, just do $ \frac{1}{p} $ + $ \mathbb{E}(X) = \frac{1}{ \frac{2}{6}} $ + $ \mathbb{E}(X) = 3 $ diff --git a/src/content/questions/comp2804/2016-fall-final/3/solution.md b/src/content/questions/comp2804/2016-fall-final/3/solution.md index 621fb669..40277a2a 100644 --- a/src/content/questions/comp2804/2016-fall-final/3/solution.md +++ b/src/content/questions/comp2804/2016-fall-final/3/solution.md @@ -1,18 +1,21 @@ -Since it's asking for OR, we need to find $ A \cup B $ -$ |A \cup B| = |A| + |B| - |A \cap B| $ + +Since it's asking for OR, we need to find $ A \cup B $ + +$ |A \cup B| = |A| + |B| - |A \cap B| $ + $ |A \cup B| = 2^{52} + 2^{51} - 2^{48} $ diff --git a/src/content/questions/comp2804/2016-fall-final/4/solution.md b/src/content/questions/comp2804/2016-fall-final/4/solution.md index 097ce953..ee1ebc0d 100644 --- a/src/content/questions/comp2804/2016-fall-final/4/solution.md +++ b/src/content/questions/comp2804/2016-fall-final/4/solution.md @@ -1,14 +1,14 @@ Let's explain why some are wrong and some are right diff --git a/src/content/questions/comp2804/2016-fall-final/5/solution.md b/src/content/questions/comp2804/2016-fall-final/5/solution.md index 743a1c5d..cadd8fad 100644 --- a/src/content/questions/comp2804/2016-fall-final/5/solution.md +++ b/src/content/questions/comp2804/2016-fall-final/5/solution.md @@ -1,18 +1,26 @@ -Find the union of C and B -$ |C \cup B| = |S| - | \overline{C} \cap \overline{B} | $ -$ |C \cup B| = 100 - 33 $ -$ |C \cup B| = 67 $ -Now, we find the intersection of C and B -$ |C \cup B| = |C| + |B| - |C \cap B| $ -$ 67 = 25 + 50 - |C \cap B| $ + +Find the union of C and B + +$ |C \cup B| = |S| - | \overline{C} \cap \overline{B} | $ + +$ |C \cup B| = 100 - 33 $ + +$ |C \cup B| = 67 $ + +Now, we find the intersection of C and B + +$ |C \cup B| = |C| + |B| - |C \cap B| $ + +$ 67 = 25 + 50 - |C \cap B| $ + $ |C \cap B| = 8 $ diff --git a/src/content/questions/comp2804/2016-fall-final/7/solution.md b/src/content/questions/comp2804/2016-fall-final/7/solution.md index 3eaaa520..af054cba 100644 --- a/src/content/questions/comp2804/2016-fall-final/7/solution.md +++ b/src/content/questions/comp2804/2016-fall-final/7/solution.md @@ -1,14 +1,17 @@ -$S_n = |A| - |B|$ -$S_n = \binom{n}{2} - (n-1)$ + +$S_n = |A| - |B|$ + +$S_n = \binom{n}{2} - (n-1)$ + $S_n = \binom{n}{2} - n + 1$ diff --git a/src/content/questions/comp2804/2016-fall-final/8/solution.md b/src/content/questions/comp2804/2016-fall-final/8/solution.md index 12cfae20..de73b968 100644 --- a/src/content/questions/comp2804/2016-fall-final/8/solution.md +++ b/src/content/questions/comp2804/2016-fall-final/8/solution.md @@ -1,19 +1,22 @@ Let's calculate $f(1)$ and $f(2)$ + $ f(1) = \frac{5}{1} \cdot f(0) = 5 \cdot 1 = 5 $ + $ f(2) = \frac{5}{2} \cdot f(1) = \frac{5}{2} \cdot 5 = \frac{25}{2} $ + Since b is the only one that has the correct function, it is the answer