-
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
c51c4c0
commit 48352ca
Showing
24 changed files
with
139 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
We choose 5 of the 85 positions to be c: $ \binom{85}{5} $ | ||
|
||
The remaining 80 positions can be any of the 3 letters: $ 3^{80} $ | ||
|
||
Thus, the total number of strings is $ \binom{85}{5} \cdot 3^{80} $ |
2 changes: 2 additions & 0 deletions
2
src/content/questions/comp2804/2019-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,3 +1,5 @@ | ||
Let's just draw the tree, man | ||
|
||
Warning: Do Later | ||
|
||
In total, O Canada is sung 8 times. |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
We choose 15 of the 85 positions to be a: $ \binom{85}{15} $ | ||
|
||
We choose 30 of the 70 remaining positions to be d: $ \binom{70}{30} $ | ||
|
||
The remaining 40 positions can be any of the 2 letters: $ 2^{40} $ | ||
|
||
Thus, the total number of strings is $ \binom{85}{15} \cdot \binom{70}{30} \cdot 2^{40} $ |
9 changes: 9 additions & 0 deletions
9
src/content/questions/comp2804/2019-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,10 +1,19 @@ | ||
Let $X_1$ be the amount of dollars you win if the first coin comes up tails: $-1$ | ||
|
||
There's a 50/50 chance of it landing tails | ||
|
||
$ Pr(X_1 = -1) = \frac{1}{2} $ | ||
|
||
Let $X_2$ be the amount of dollars you win if the second coin comes up heads: $2$ | ||
|
||
There's a 50/50 chance of it landing heads | ||
|
||
$ Pr(X_2 = 2) = \frac{1}{2} $ | ||
|
||
$ E(X) = (-1) \cdot Pr(X_1 = -1) + 2 \cdot Pr(X_2 = 2) $ | ||
|
||
$ E(X) = (-1) \cdot \frac{1}{2} + 2 \cdot \frac{1}{2} $ | ||
|
||
$ E(X) = -\frac{1}{2} + 1 $ | ||
|
||
$ E(X) = \frac{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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
Warning: I suck at these questions. Here goes nothing | ||
|
||
Possibilities: | ||
|
||
$0, S_{n-1}$ | ||
|
||
$1,0, S_{n-2}$ | ||
|
||
IDK MAN |
2 changes: 2 additions & 0 deletions
2
src/content/questions/comp2804/2019-winter-midterm/1/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,3 +1,5 @@ | ||
There are 2 choices for the odd positions: 0 or 1. | ||
|
||
There are 6 even positions that can each be 0 or 1, so there are $ 2^6 $ ways to choose the characters for the even positions. | ||
|
||
Thus, there are $ 2 \cdot 2^6 =2 \cdot 64 = 128 $ such bitstrings. |
8 changes: 6 additions & 2 deletions
8
src/content/questions/comp2804/2019-winter-midterm/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,5 +1,9 @@ | ||
Because there is a 0 at position 59, there must be a 1 at position 58 and 60 to avoid a 00. | ||
|
||
It looks something like this: ..., 1, 0, 1, ..., 1, ... | ||
The number of 00-free bitstrings made from the first 57 bits $ \text{bit positions 1 to 57} $ is $ f*{57+2} $. | ||
The number of 00-free bitstrings made from the 17 bits $ \text{bit positions 61 to 77} $ is $ f*{17+2} $. | ||
|
||
The number of 00-free bitstrings made from the first 57 bits $ \text{bit positions 1 to 57} $ is $ f\*{57+2} $. | ||
|
||
The number of 00-free bitstrings made from the 17 bits $ \text{bit positions 61 to 77} $ is $ f\*{17+2} $. | ||
|
||
Thus, the number of 00-free bitstrings with the above conditions is $ f*{59} \cdot f*{19} $. |
1 change: 1 addition & 0 deletions
1
src/content/questions/comp2804/2019-winter-midterm/14/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 @@ | ||
If $ (a) $ is true, then it would not be recursive | ||
|
||
$ (b) $ is pretty much what a recurisve function is |
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
8 changes: 8 additions & 0 deletions
8
src/content/questions/comp2804/2019-winter-midterm/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,9 +1,17 @@ | ||
A = Permutations that contain $ bge $ | ||
|
||
We can treat $ bge $ as a single entity. | ||
|
||
B = Permutations that do not contain $ bge $ | ||
|
||
So there's $ bge, a,c,d,f $ which is 5 entities. | ||
|
||
$ |B| = 5! $ | ||
|
||
$ |S| = $ Total permutations without restrictions | ||
|
||
$ |S| = 7! $ | ||
|
||
$ |\text{Number of permutations that do not contain} bge| = |S| - |B| $ | ||
|
||
$ |\text{Number of permutations that do not contain} bge| = 7! - 5! $ |
8 changes: 8 additions & 0 deletions
8
src/content/questions/comp2804/2019-winter-midterm/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,9 +1,17 @@ | ||
A = Strings that contain at least one lowercase letter | ||
|
||
$ \overline{A} = $ Strings that contain no lowercase letters | ||
|
||
$ |\overline{A}| = 26^{15} $ | ||
|
||
B = Strings that contain at least one uppercase letter | ||
|
||
$ \overline{B} = $ Strings that contain no uppercase letters | ||
|
||
$ |\overline{B}| = 26^{15} $ | ||
|
||
$ |A \cap B| = \text{All Possibilities} - |\overline{A}| - |\overline{B}| $ | ||
|
||
$ |A \cap B| = 52^{15} - 26^{15} - 26^{15} $ | ||
|
||
$ |A \cap B| = 52^{15} - 2 \cdot 26^{15} $ |
1 change: 1 addition & 0 deletions
1
src/content/questions/comp2804/2019-winter-midterm/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,2 +1,3 @@ | ||
$ \text{All Possibilities} - \text{0 even numbers} - \text{1 even number} $ | ||
|
||
$ \binom{n}{k} - \binom{n/2}{k} - \binom{n/2}{k-1} $ |
9 changes: 9 additions & 0 deletions
9
src/content/questions/comp2804/2019-winter-midterm/5/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 @@ | ||
A = Like beer | ||
|
||
$ |A| = 37 $ | ||
|
||
B = Like cider | ||
|
||
$ |B| = 18 $ | ||
|
||
$ |\overline{A \cup B}| = 55 $ | ||
|
||
$ |A \cup B| = 100-55 $ | ||
|
||
$ |A \cup B| = 45 $ | ||
|
||
$ |A \cap B| = |A| + |B| - |A \cup B| $ | ||
|
||
$ |A \cap B| = 37 + 18 - 45 $ | ||
|
||
$ |A \cap B| = 10 $ |
5 changes: 5 additions & 0 deletions
5
src/content/questions/comp2804/2019-winter-midterm/6/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 @@ | ||
We can use the pigeonhole principle to solve this problem. | ||
|
||
We need to have 1 more than the maximum number of possible grades. | ||
|
||
That way, we can guarantee that if all students receive different grades, the last student will receive a duplicate grade. | ||
|
||
There are 5 possible grades: $ A, B, C, D, F $ | ||
|
||
Thus, the minimum value for $ n $ is $ 5 \cdot 3 + 1 $ | ||
|
||
Thus, the minimum value for $ n $ is 16. |
1 change: 1 addition & 0 deletions
1
src/content/questions/comp2804/2019-winter-midterm/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,2 +1,3 @@ | ||
We can treat the largest element as a fixed element. | ||
|
||
We need to choose 16 other elements from the remaining 29 elements that are smaller than 30: $ \binom{29}{16} $ |
3 changes: 3 additions & 0 deletions
3
src/content/questions/comp2804/2019-winter-midterm/9/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 @@ | ||
There are $ n/2 $ even positions. | ||
|
||
We need to choose $ k $ of these positions to be $ a $'s: $ \binom{n/2}{k} $ | ||
|
||
The remaining $ n - k $ positions must be $ b $'s or $ c $'s: $ 2^{n-k} $ | ||
|
||
Thus, there are $ \binom{n/2}{k} \cdot 2^{n-k} $ such strings. |