-
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
b4eb4e4
commit cce0bf5
Showing
20 changed files
with
231 additions
and
158 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 $ |
15 changes: 10 additions & 5 deletions
15
src/content/questions/comp2804/2016-fall-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,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} $ |
12 changes: 7 additions & 5 deletions
12
src/content/questions/comp2804/2016-fall-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,13 @@ | ||
We can use the stars and bars method to solve this problem. | ||
|
||
We have 4 dividers and 28 stars. | ||
|
||
<ul> | ||
<li> $x_1$ is the number of stars to the left of the first divider | ||
<li> $x_2$ is the number of stars between the first and second dividers | ||
<li> $x_3$ is the number of stars between the second and third dividers | ||
<li> $x_4$ is the number of stars between the third and fourth dividers | ||
<li> $x_5$ is the number of stars to the right of the fourth divider | ||
<li> $x_1$ is the number of stars to the left of the first divider | ||
<li> $x_2$ is the number of stars between the first and second dividers | ||
<li> $x_3$ is the number of stars between the second and third dividers | ||
<li> $x_4$ is the number of stars between the third and fourth dividers | ||
<li> $x_5$ is the number of stars to the right of the fourth divider | ||
</ul> | ||
|
||
The number of solutions to the equation is $ \binom{28+4}{4} $ |
21 changes: 12 additions & 9 deletions
21
src/content/questions/comp2804/2016-fall-final/12/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,13 +1,16 @@ | ||
<ul> | ||
<li> Let's determine A <br/> | ||
The possible outcomes are (1,5), (2,4), (3,3), (4,2), (5,1) <br/> | ||
$ |A| = 5 $ <br/> | ||
$ Pr(A) = \frac{5}{36} $ | ||
<li> Let's determine A <br/> | ||
The possible outcomes are (1,5), (2,4), (3,3), (4,2), (5,1) <br/> | ||
$ |A| = 5 $ <br/> | ||
$ Pr(A) = \frac{5}{36} $ | ||
<li> Let's determine $ A \cap B $ <br/> | ||
The possible outcomes are (2,4) <br/> | ||
$ |A \cap B| = 1 $ <br/> | ||
$ Pr(A \cap B) = \frac{1}{36} $ | ||
The possible outcomes are (2,4) <br/> | ||
$ |A \cap B| = 1 $ <br/> | ||
$ Pr(A \cap B) = \frac{1}{36} $ | ||
</ul> | ||
$ 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} $ |
20 changes: 10 additions & 10 deletions
20
src/content/questions/comp2804/2016-fall-final/13/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,12 +1,12 @@ | ||
<ul> | ||
<li> Let's determine $ |V| $ <br/> | ||
$ |V| = 20 $ | ||
<li> Let's determine $ |W| $ <br/> | ||
$ |W| = 7 $ | ||
<li> Let's determine $ |A| $ <br/> | ||
The number of ways to choose 4 even integers from 12 even integers: $ \binom{12}{4} $ <br/> | ||
The number of ways to choose 3 odd integers from 8 odd integers: $ \binom{8}{3} $ <br/> | ||
$ |A| = \binom{12}{4} \binom{8}{3} $ | ||
<li> Let's determine $ Pr(A) $ <br/> | ||
$ Pr(A) = \frac{\binom{12}{4} \binom{8}{3}}{\binom{20}{7}} $ | ||
<li> Let's determine $ |V| $ <br/> | ||
$ |V| = 20 $ | ||
<li> Let's determine $ |W| $ <br/> | ||
$ |W| = 7 $ | ||
<li> Let's determine $ |A| $ <br/> | ||
The number of ways to choose 4 even integers from 12 even integers: $ \binom{12}{4} $ <br/> | ||
The number of ways to choose 3 odd integers from 8 odd integers: $ \binom{8}{3} $ <br/> | ||
$ |A| = \binom{12}{4} \binom{8}{3} $ | ||
<li> Let's determine $ Pr(A) $ <br/> | ||
$ Pr(A) = \frac{\binom{12}{4} \binom{8}{3}}{\binom{20}{7}} $ | ||
</ul> |
41 changes: 22 additions & 19 deletions
41
src/content/questions/comp2804/2016-fall-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,24 +1,27 @@ | ||
<ul> | ||
<li> Let's determine $ S $ <br/> | ||
S is the set of all possible outcomes of the birthdays of the students <br/> | ||
$ |S| = 365^n $ <br/> | ||
$ Pr(S) = \frac{365^n}{365^n} = 1 $ | ||
<li> Let's determine $ S $ <br/> | ||
S is the set of all possible outcomes of the birthdays of the students <br/> | ||
$ |S| = 365^n $ <br/> | ||
$ Pr(S) = \frac{365^n}{365^n} = 1 $ | ||
<li> Let's determine $ B $ <br/> | ||
B is the set of all outcomes where no students have their birthday on December 14 <br/> | ||
The first student has 364 possible birthdays <br/> | ||
The second student has 364 possible birthdays <br/> | ||
... <br/> | ||
The nth student has 364 possible birthdays <br/> | ||
$ |B| = 364^n $ <br/> | ||
$ Pr(B) = \frac{364^n}{365^n} $ | ||
B is the set of all outcomes where no students have their birthday on December 14 <br/> | ||
The first student has 364 possible birthdays <br/> | ||
The second student has 364 possible birthdays <br/> | ||
... <br/> | ||
The nth student has 364 possible birthdays <br/> | ||
$ |B| = 364^n $ <br/> | ||
$ Pr(B) = \frac{364^n}{365^n} $ | ||
<li> Let's determine $ C $ <br/> | ||
C is the set of all outcomes where exactly one student has their birthday on December 14 <br/> | ||
Out of n students, choose 1 of them to have their birthday on December 14: $ \binom{n}{1} = n $ <br/> | ||
The student with the birthday on December 14 has 1 possible birthday: 1 <br/> | ||
The other students have 364 possible birthdays: $ 364^{n-1} $ <br/> | ||
$ |C| = n \cdot 1 \cdot 364^{n-1} $ <br/> | ||
$ Pr(C) = \frac{n \cdot 1 \cdot 364^{n-1}}{365^n} $ | ||
C is the set of all outcomes where exactly one student has their birthday on December 14 <br/> | ||
Out of n students, choose 1 of them to have their birthday on December 14: $ \binom{n}{1} = n $ <br/> | ||
The student with the birthday on December 14 has 1 possible birthday: 1 <br/> | ||
The other students have 364 possible birthdays: $ 364^{n-1} $ <br/> | ||
$ |C| = n \cdot 1 \cdot 364^{n-1} $ <br/> | ||
$ Pr(C) = \frac{n \cdot 1 \cdot 364^{n-1}}{365^n} $ | ||
</ul> | ||
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} $ |
46 changes: 25 additions & 21 deletions
46
src/content/questions/comp2804/2016-fall-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,27 +1,31 @@ | ||
<ul> | ||
<li> Let's determine $ S $ <br/> | ||
S is the set of all possible outcomes of the 17 students <br/> | ||
$ |S| = \binom{100}{17} $ | ||
<li> Let's determine $ S $ <br/> | ||
S is the set of all possible outcomes of the 17 students <br/> | ||
$ |S| = \binom{100}{17} $ | ||
<li> Let's determine $ B $ <br/> | ||
B occurs when 4 is in the subset <br/> | ||
We choose 4: 1 <br/> | ||
We choose 16 from the remaining 99: $ \binom{99}{16} $ <br/> | ||
$ |B| = 1 \cdot \binom{99}{16} $ <br/> | ||
$ Pr(B) = \frac{1 \cdot \binom{99}{16}}{\binom{100}{17}} $ | ||
B occurs when 4 is in the subset <br/> | ||
We choose 4: 1 <br/> | ||
We choose 16 from the remaining 99: $ \binom{99}{16} $ <br/> | ||
$ |B| = 1 \cdot \binom{99}{16} $ <br/> | ||
$ Pr(B) = \frac{1 \cdot \binom{99}{16}}{\binom{100}{17}} $ | ||
<li> Let's determine $ C $ <br/> | ||
C occurs when 7 is in the subset <br/> | ||
We choose 17: 1 <br/> | ||
We choose 16 from the remaining 99: $ \binom{99}{16} $ <br/> | ||
$ |C| = 1 \cdot \binom{99}{16} $ <br/> | ||
$ Pr(C) = \frac{1 \cdot \binom{99}{16}}{\binom{100}{17}} $ | ||
C occurs when 7 is in the subset <br/> | ||
We choose 17: 1 <br/> | ||
We choose 16 from the remaining 99: $ \binom{99}{16} $ <br/> | ||
$ |C| = 1 \cdot \binom{99}{16} $ <br/> | ||
$ Pr(C) = \frac{1 \cdot \binom{99}{16}}{\binom{100}{17}} $ | ||
<li> Let's determine $ B \cap C $ <br/> | ||
We choose 17: 1 <br/> | ||
We choose 4: 1 <br/> | ||
We choose 15 from the remaining 98: $ \binom{98}{15} $ <br/> | ||
$ |B \cap C| = 1 \cdot 1 \cdot \binom{98}{15} $ <br/> | ||
$ Pr(B \cap C) = \frac{1 \cdot 1 \cdot \binom{98}{15}}{\binom{100}{17}} $ | ||
We choose 17: 1 <br/> | ||
We choose 4: 1 <br/> | ||
We choose 15 from the remaining 98: $ \binom{98}{15} $ <br/> | ||
$ |B \cap C| = 1 \cdot 1 \cdot \binom{98}{15} $ <br/> | ||
$ Pr(B \cap C) = \frac{1 \cdot 1 \cdot \binom{98}{15}}{\binom{100}{17}} $ | ||
</ul> | ||
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}} $ |
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 @@ | ||
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} $ |
5 changes: 5 additions & 0 deletions
5
src/content/questions/comp2804/2016-fall-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,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} $ |
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 @@ | ||
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!} $ |
3 changes: 3 additions & 0 deletions
3
src/content/questions/comp2804/2016-fall-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,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} $ |
20 changes: 12 additions & 8 deletions
20
src/content/questions/comp2804/2016-fall-final/21/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,12 +1,16 @@ | ||
<ul> | ||
<li> Let's determine X=5 <br/> | ||
The probability of getting heads is $ \frac{1}{7} $ <br/> | ||
$ Pr(X=5) = \frac{1}{7} $ | ||
<li> Let's determine X=5 <br/> | ||
The probability of getting heads is $ \frac{1}{7} $ <br/> | ||
$ Pr(X=5) = \frac{1}{7} $ | ||
<li> Let's determine X=2 <br/> | ||
The probability of getting tails is $ \frac{6}{7} $ <br/> | ||
$ Pr(X=2) = \frac{6}{7} $ | ||
The probability of getting tails is $ \frac{6}{7} $ <br/> | ||
$ Pr(X=2) = \frac{6}{7} $ | ||
</ul> | ||
$ \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} $ |
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
6 changes: 6 additions & 0 deletions
6
src/content/questions/comp2804/2016-fall-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,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 $ |
29 changes: 16 additions & 13 deletions
29
src/content/questions/comp2804/2016-fall-final/3/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,18 +1,21 @@ | ||
<ul> | ||
<li> Let A be the event that a bitstring of length 55 starts with 000. <br/> | ||
The first 3 bits are fixed as 000. <br/> | ||
The remaining 52 bits can be any combination of 0s and 1s: $2^{52}$. <br/> | ||
$ |A| = 2^{52} $ | ||
<li> Let A be the event that a bitstring of length 55 starts with 000. <br/> | ||
The first 3 bits are fixed as 000. <br/> | ||
The remaining 52 bits can be any combination of 0s and 1s: $2^{52}$. <br/> | ||
$ |A| = 2^{52} $ | ||
<li> Let B be the event that a bitstring of length 55 ends with 1010. <br/> | ||
The last 4 bits are fixed as 1010. <br/> | ||
The first 51 bits can be any combination of 0s and 1s: $2^{51}$. <br/> | ||
$ |B| = 2^{51} $ | ||
The last 4 bits are fixed as 1010. <br/> | ||
The first 51 bits can be any combination of 0s and 1s: $2^{51}$. <br/> | ||
$ |B| = 2^{51} $ | ||
<li> Let $ A \cap B $ be the event that a bitstring of length 55 starts with 000 AND ends with 1010. <br/> | ||
The first 3 bits are fixed as 000. <br/> | ||
The last 4 bits are fixed as 1010. <br/> | ||
The remaining 48 bits can be any combination of 0s and 1s: $2^{48}$. <br/> | ||
$ |A \cap B| = 2^{48} $ | ||
The first 3 bits are fixed as 000. <br/> | ||
The last 4 bits are fixed as 1010. <br/> | ||
The remaining 48 bits can be any combination of 0s and 1s: $2^{48}$. <br/> | ||
$ |A \cap B| = 2^{48} $ | ||
</ul> | ||
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} $ |
Oops, something went wrong.