Skip to content

Commit

Permalink
spaced out 2017 winter final
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnLu2004 committed Jul 18, 2024
1 parent 3d63d93 commit 6dd5c52
Show file tree
Hide file tree
Showing 21 changed files with 152 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ Well, let's break it down
We can place the last even number in the last remaining even position: 1 <br/>
This creates $ 5! $ permutations
</ul>

Multiplying the two permutations, we get $ 5! \cdot 5! $
Original file line number Diff line number Diff line change
@@ -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}} $
10 changes: 10 additions & 0 deletions src/content/questions/comp2804/2017-winter-final/11/solution.md
Original file line number Diff line number Diff line change
@@ -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! $
10 changes: 7 additions & 3 deletions src/content/questions/comp2804/2017-winter-final/12/solution.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
$ |A \cap B| = \binom{8}{3} $ <br/>
$ 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} $
</ul>
$ 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} $
10 changes: 7 additions & 3 deletions src/content/questions/comp2804/2017-winter-final/13/solution.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
$ | B \cap A | = 4 $ <br/>
$ Pr(A \cap B) = \frac{4}{32} = \frac{1}{8} $
</ul>
$ 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} $
13 changes: 9 additions & 4 deletions src/content/questions/comp2804/2017-winter-final/14/solution.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,13 @@
$ |A \cap B| = \frac{(n-1)!}{2!} $ <br/>
$ Pr(A \cap B) = \frac{(n-1)!}{2 \cdot n!} = \frac{1}{2n} $
</ul>
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
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
The probability that both $a_1 = 1$ and $a_n = 5$ is $ \frac{1}{n^2} $ <br/>
$ Pr(A \cap B) = \frac{1}{n^2} $
</ul>
$ 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)} $
13 changes: 13 additions & 0 deletions src/content/questions/comp2804/2017-winter-final/16/solution.md
Original file line number Diff line number Diff line change
@@ -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 $
Original file line number Diff line number Diff line change
@@ -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} $
Original file line number Diff line number Diff line change
@@ -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} $
Original file line number Diff line number Diff line change
@@ -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!} $
Original file line number Diff line number Diff line change
@@ -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 $
13 changes: 9 additions & 4 deletions src/content/questions/comp2804/2017-winter-final/21/solution.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <br/>
$ Pr(X=5 \cap Y=1) = 0 $
</ul>
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
Original file line number Diff line number Diff line change
@@ -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} $
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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} $
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Holy moly, that's a lot of words

Let's do this anyway$ ( $cries internally $ ) $

<ul>
Expand All @@ -16,5 +17,7 @@ Let's do this anyway$ ( $cries internally $ ) $
We have exactly 5 beer bottles and 5 cider bottles <br/>
$ | B \cap C | = \binom{17}{5} \cdot \binom{28}{5} $
</ul>
$ 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} $
10 changes: 10 additions & 0 deletions src/content/questions/comp2804/2017-winter-final/4/solution.md
Original file line number Diff line number Diff line change
@@ -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}} $
25 changes: 17 additions & 8 deletions src/content/questions/comp2804/2017-winter-final/6/solution.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,21 @@
<li> Let's determine $ \overline{B} \cap \overline{C} $ <br/>
$ | \overline{B} \cap \overline{C} | = 25 $
</ul>
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 $
Original file line number Diff line number Diff line change
@@ -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} $
14 changes: 10 additions & 4 deletions src/content/questions/comp2804/2017-winter-final/8/solution.md
Original file line number Diff line number Diff line change
@@ -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} $

0 comments on commit 6dd5c52

Please sign in to comment.