-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3d63d93
commit 6dd5c52
Showing
21 changed files
with
152 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
src/content/questions/comp2804/2017-winter-final/10/solution.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
10
src/content/questions/comp2804/2017-winter-final/11/solution.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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! $ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/content/questions/comp2804/2017-winter-final/16/solution.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 $ |
4 changes: 4 additions & 0 deletions
4
src/content/questions/comp2804/2017-winter-final/17/solution.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} $ |
6 changes: 6 additions & 0 deletions
6
src/content/questions/comp2804/2017-winter-final/19/solution.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} $ |
5 changes: 5 additions & 0 deletions
5
src/content/questions/comp2804/2017-winter-final/2/solution.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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!} $ |
9 changes: 8 additions & 1 deletion
9
src/content/questions/comp2804/2017-winter-final/20/solution.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 $ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
src/content/questions/comp2804/2017-winter-final/22/solution.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} $ |
1 change: 1 addition & 0 deletions
1
src/content/questions/comp2804/2017-winter-final/23/solution.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
8 changes: 8 additions & 0 deletions
8
src/content/questions/comp2804/2017-winter-final/24/solution.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} $ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
src/content/questions/comp2804/2017-winter-final/4/solution.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}} $ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 5 additions & 2 deletions
7
src/content/questions/comp2804/2017-winter-final/7/solution.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
14
src/content/questions/comp2804/2017-winter-final/8/solution.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} $ |