-
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
2aad26a
commit d4edd66
Showing
15 changed files
with
77 additions
and
22 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
src/content/questions/comp2804/2015-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 @@ | ||
First, we choose 7 of the n students. | ||
|
||
Then, we choose one of the remaining n-7 students to be the President. | ||
|
||
Thus, the number of ways to choose the Board of Directors is $\binom{n}{7} \cdot (n-7)$. |
19 changes: 11 additions & 8 deletions
19
src/content/questions/comp2804/2015-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,15 +1,18 @@ | ||
We can first calculate values of f$(1)$ and f$(2)$ to see if we can find a pattern. | ||
|
||
$f(1) = f(0) + 6(1) - 4 = 15 + 6 - 4 = 17$ | ||
|
||
$f(2) = f(1) + 6(2) - 4 = 17 + 12 - 4 = 25$ | ||
|
||
<ul> | ||
<li> $f(n) = 3n^{2} + 2n + 15$ <br/> | ||
$f(1) = 3{(1)}^{2} + 2(1) + 15 = 3 + 2 + 15 = 20$ | ||
<li> $f(n) = 3n^{2} - 2n + 15$ <br/> | ||
$f(1) = 3{(1)}^{2} - 2(1) + 15 = 3 - 2 + 15 = 16$ | ||
<li> $f(n) = 3n^{2} + n + 15$ <br/> | ||
$f(1) = 3{(1)}^{2} + 1 + 15 = 3 + 1 + 15 = 19$ | ||
<li> $f(n) = 3n^{2} - n + 15$ <br/> | ||
$f(1) = 3{(1)}^{2} - 1 + 15 = 3 - 1 + 15 = 17$ | ||
<li> $f(n) = 3n^{2} + 2n + 15$ <br/> | ||
$f(1) = 3{(1)}^{2} + 2(1) + 15 = 3 + 2 + 15 = 20$ | ||
<li> $f(n) = 3n^{2} - 2n + 15$ <br/> | ||
$f(1) = 3{(1)}^{2} - 2(1) + 15 = 3 - 2 + 15 = 16$ | ||
<li> $f(n) = 3n^{2} + n + 15$ <br/> | ||
$f(1) = 3{(1)}^{2} + 1 + 15 = 3 + 1 + 15 = 19$ | ||
<li> $f(n) = 3n^{2} - n + 15$ <br/> | ||
$f(1) = 3{(1)}^{2} - 1 + 15 = 3 - 1 + 15 = 17$ | ||
</ul> | ||
|
||
Therefore, we know that $f(n) = 3n^{2} - n + 15$ is the correct answer |
15 changes: 9 additions & 6 deletions
15
src/content/questions/comp2804/2015-winter-midterm/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,8 +1,11 @@ | ||
We can write down some valid possibilities first. | ||
$b, B_{n-1}$ possibilities left | ||
$c, B_{n-1}$ possibilities left | ||
$a,b, B_{n-2}$ possibilities left | ||
$a,c, B_{n-2}$ possibilities left | ||
$a,a,b, B_{n-3}$ possibilities left | ||
$a,a,c, B_{n-3}$ possibilities left | ||
|
||
<ul> | ||
<li> $b, B_{n-1}$ possibilities left | ||
<li> $c, B_{n-1}$ possibilities left | ||
<li> $a,b, B_{n-2}$ possibilities left | ||
<li> $a,c, B_{n-2}$ possibilities left | ||
<li> $a,a,b, B_{n-3}$ possibilities left | ||
<li> $a,a,c, B_{n-3}$ possibilities left | ||
</ul> | ||
$S_n = 2 \cdot B_{n-1} + 2 \cdot B_{n-2} + 2 \cdot B_{n-3}$ |
4 changes: 4 additions & 0 deletions
4
src/content/questions/comp2804/2015-winter-midterm/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,5 +1,9 @@ | ||
Let's suppose we have a string of 1s and 2s. | ||
|
||
We can write down some possibilities. | ||
|
||
$2, S_{n-2}$ possibilities left | ||
|
||
$1,2, S_{n-3}$ possibilities left | ||
|
||
$S_n = S_{n-2} + S_{n-3}$ |
19 changes: 11 additions & 8 deletions
19
src/content/questions/comp2804/2015-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,15 +1,18 @@ | ||
We can calculate the first couple of values of $S(n)$ to see if we can find a pattern. | ||
|
||
$S(1) = 1$ | ||
|
||
$S(2) = 3$ | ||
|
||
<ul> | ||
<li> $S(n)=1+logn$ <br/> | ||
$S(2) = 1+log{2} = 1+1 = 2$ | ||
<li> $S(n)=2+nlogn$ <br/> | ||
$S(2) = 2+2 log{2} = 2+2 = 4$ | ||
<li> $S(n)=2n+1$ <br/> | ||
$S(2) = 2 \cdot 2 + 1 = 5$ | ||
<li> $S(n)=2n-1$ <br/> | ||
$S(2) = 2 \cdot 2 - 1 = 3$ | ||
<li> $S(n)=1+logn$ <br/> | ||
$S(2) = 1+log{2} = 1+1 = 2$ | ||
<li> $S(n)=2+nlogn$ <br/> | ||
$S(2) = 2+2 log{2} = 2+2 = 4$ | ||
<li> $S(n)=2n+1$ <br/> | ||
$S(2) = 2 \cdot 2 + 1 = 5$ | ||
<li> $S(n)=2n-1$ <br/> | ||
$S(2) = 2 \cdot 2 - 1 = 3$ | ||
</ul> | ||
|
||
Therefore, we know that $S(n)=2n-1$ is the correct answer. |
4 changes: 4 additions & 0 deletions
4
src/content/questions/comp2804/2015-winter-midterm/15/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 @@ | ||
$ Pr\text{(number of heads is even)}=1/2 $ | ||
|
||
$ Pr\text{(number of heads is odd)}=1/2 $ | ||
|
||
$ Pr\text{(number of tails is even)}=1/2 $ | ||
|
||
$ Pr\text{(number of tails is odd)}=1/2 $ | ||
|
||
1/2 is the answer |
6 changes: 6 additions & 0 deletions
6
src/content/questions/comp2804/2015-winter-midterm/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,7 +1,13 @@ | ||
We can grab 2 pilsner beers, 1 India pale ale beer, and 1 German wheatbeer beer. | ||
|
||
$\binom{7}{2} \cdot 5 \cdot 4$ | ||
|
||
We can also grab 1 pilsner beer, 2 India pale ale beers, and 1 German wheatbeer beer. | ||
|
||
$7 \cdot \binom{5}{2} \cdot 4$ | ||
|
||
We can also grab 1 pilsner beer, 1 India pale ale beer, and 2 German wheatbeer beers. | ||
|
||
$7 \cdot 5 \cdot \binom{4}{2}$ | ||
|
||
Thus, the total number of ways is $\binom{7}{2} \cdot 5 \cdot 4 + 7 \cdot \binom{5}{2} \cdot 4 + 7 \cdot 5 \cdot \binom{4}{2}$ |
1 change: 1 addition & 0 deletions
1
src/content/questions/comp2804/2015-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,2 +1,3 @@ | ||
For each element in A, there are output 15 choices in B. | ||
|
||
Thus, there are $15^7$ functions. |
1 change: 1 addition & 0 deletions
1
src/content/questions/comp2804/2015-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,2 +1,3 @@ | ||
There are 15 choices for the first element in A, 14 choices for the second element in A, and so on. | ||
|
||
Thus, there are $15 \cdot 14 \cdot 13 \cdot 12 \cdot 11 \cdot 10 \cdot 9$ one-to-one functions. |
5 changes: 5 additions & 0 deletions
5
src/content/questions/comp2804/2015-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,6 +1,11 @@ | ||
The first letter can be anything. So there are 3 choices. | ||
|
||
The second letter cannot be the same as the first letter. So there are 2 choices. | ||
|
||
For the third letter, there are 2 choices. Same as the second letter. | ||
|
||
We can continue this pattern until the end of the string. | ||
|
||
Thus, there are $3 \cdot 2 \cdot 2 \cdot 2 \cdot 2 \cdot 2 \cdot 2$ valid strings. | ||
|
||
Rewriting this, we get $V_n = 3 \cdot 2^{n-1}$. |
10 changes: 10 additions & 0 deletions
10
src/content/questions/comp2804/2015-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,11 +1,21 @@ | ||
Let A be the set of strings that start with $abc$. | ||
|
||
|A| = first 3 letters are set in stone while other 96 letters can be anything. | ||
|
||
Thus, there are $3 \cdot 3 \cdot 3 \cdot 3^{96}$ strings in A. | ||
|
||
Let B be the set of strings that end with $bbb$. | ||
|
||
|B| = last 3 letters are set in stone while other 96 letters can be anything. | ||
|
||
Thus, there are $3^{96} \cdot 3 \cdot 3 \cdot 3$ strings in B. | ||
|
||
Let $A \cap B$ be the set of strings that start with $abc$ and end with $bbb$. | ||
|
||
$|A \cap B|$ = first 3 letters and last 3 letters are set in stone while other 93 etters can be anything. | ||
|
||
$|A \cup B| = |A| + |B| - |A \cap B|$ | ||
|
||
$|A \cup B| = 3^{96} + 3^{96} - 3^{93}$ | ||
|
||
$|A \cup B| = 2 \cdot 3^{96} - 3^{93}$ |
5 changes: 5 additions & 0 deletions
5
src/content/questions/comp2804/2015-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 @@ | ||
Let's write it out and see what it represents if n is a small value like 5. | ||
|
||
$\sum_{k=2}^{4} (k-1)(5-k)$ | ||
|
||
$(2-1)(5-2) + (3-1)(5-3) + (4-1)(5-4)$ | ||
|
||
$1 \cdot 3 + 2 \cdot 2 + 3 \cdot 1$ | ||
|
||
We can rewrite in \binomial form as | ||
|
||
$\binom{n}{3}$ |
4 changes: 4 additions & 0 deletions
4
src/content/questions/comp2804/2015-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,5 +1,9 @@ | ||
To guarantee that at least two people share the same birthday, the first 365 people each have a different birthday. | ||
|
||
The last person must have a birthday that is the same as one of the previous 365 people. | ||
|
||
We can apply this to 3 people. | ||
|
||
Thus, the minimum number of people needed is double 365 + 1. | ||
|
||
$2 \cdot 365 + 1 = 731$ |
2 changes: 2 additions & 0 deletions
2
src/content/questions/comp2804/2015-winter-midterm/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,3 +1,5 @@ | ||
$=\sum^{99}_{k=0} \binom{99}{k}17^{99-k}{(2x)}^k$ | ||
|
||
$=\binom{99}{17}17^{82}{(2x)}^{17}$ | ||
|
||
$=\binom{99}{17}17^{82}2^{17}x^{17}$ |
2 changes: 2 additions & 0 deletions
2
src/content/questions/comp2804/2015-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,3 +1,5 @@ | ||
We can use the dividers method. | ||
|
||
We have 99 buckets and 2 extra spots for the dividers to go. | ||
|
||
Thus, there are $\binom{99+2}{2}$ solutions. |