Skip to content

Commit

Permalink
2019 fall midterm and 2019 winter final don't seem to have solutions …
Browse files Browse the repository at this point in the history
…in there
  • Loading branch information
JohnLu2004 committed Jul 18, 2024
1 parent d90249e commit c51c4c0
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 16 deletions.
7 changes: 5 additions & 2 deletions src/content/questions/comp2804/2019-fall-final/3/solution.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ Let's break me down
The remaining 40 positions can be any of the 2 letters: $ 2^{40} $ <br/>
Thus, the total number of strings is $ \binom{85}{15} \cdot \binom{70}{30} \cdot 2^{40} $
</ul>
Now, we can determine $A \cup B$
$ |A \cup B| = |A| + |B| - |A \cap B| $

Now, we can determine $A \cup B$

$ |A \cup B| = |A| + |B| - |A \cap B| $

$ |A \cup B| = \binom{85}{15} \cdot 3^{70} + \binom{85}{30} \cdot 3^{55} - \binom{85}{15} \cdot \binom{70}{30} \cdot 2^{40} $
7 changes: 5 additions & 2 deletions src/content/questions/comp2804/2019-fall-final/4/solution.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ Let's do this uwu
We choose 12 of the 50 cider bottles: $ \binom{50}{12} $ <br/>
$|A \cap B| = \binom{20}{12} \cdot \binom{50}{12} $
</ul>
Now, we can determine $A \cup B$
$ |A \cup B| = |A| + |B| - |A \cap B| $

Now, we can determine $A \cup B$

$ |A \cup B| = |A| + |B| - |A \cap B| $

$ |A \cup B| = \binom{20}{12} \cdot 2^{50} + \binom{50}{12} \cdot 2^{20} - \binom{20}{12} \cdot \binom{50}{12} $
7 changes: 5 additions & 2 deletions src/content/questions/comp2804/2019-fall-final/5/solution.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
We choose any subset of the 50 cider bottles: $ 2^{50} $ <br/>
$ |C| = \binom{20}{2} \cdot 2^{50} = 190 \cdot 2^{50} $
</ul>
Now, we can determine the number of subsets that contain at least 3 beer bottles
$ |S| - |A| - |B| - |C| $

Now, we can determine the number of subsets that contain at least 3 beer bottles

$ |S| - |A| - |B| - |C| $

$ = 2^{70} - 2^{50} - 20 \cdot 2^{50} -\binom{20}{2} \cdot 2^{50} $
5 changes: 4 additions & 1 deletion src/content/questions/comp2804/2019-fall-final/7/solution.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ Assuming you have a sea of bananas, let's put dividers to split them off into di
<li> $x_6$ is the number of bananas between the fifth and sixth divider
<li> $x_7$ is the number of bananas to the right of the sixth divider
</ul>
Now, we have 6 dividers and 25 bananas, so we have 31 objects in total

Now, we have 6 dividers and 25 bananas, so we have 31 objects in total

Since each object has a position, we can just move the dividers around to change any x.

We choose 6 spots out of the 31 to be dividers: $ \binom{31}{6} $
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
textbf{Plaintext Question:} The function $ f: \mathbb{N} rightarrow \mathbb{N} $
is recursively defined as follows:
$ f(0) = 6, $
$ f(n) = 4 \cdot f(n-1) + 2^{n} \text{ if } n geq 1. $
Which of the following is true for all integers $ n geq 0 $?
textbf{Correct Answer: } B
textbf{Relevant Theorems: } Recursive Functions (4.1)
textbf{Explanation: }
We can find the first few values of $ f(n) $ to find a pattern:
We can find the first few values of $ f(n) $ to find a pattern:

$ f(1) = 4 \cdot f(0) + 2^1 = 4 \cdot 6 + 2 = 26 $

$ f(2) = 4 \cdot f(1) + 2^2 = 4 \cdot 26 + 4 = 108 $

<ul>
Expand All @@ -18,4 +12,5 @@ $ f(2) = 4 \cdot f(1) + 2^2 = 4 \cdot 26 + 4 = 108 $
<li> $ f(n) = 8 \cdot 4^{n} - 2^{n+1} $ <br/>
$ f(1) = 8 \cdot 4^{1} - 2^{2} = 32 - 4 = 28 $
</ul>

Thus, the correct answer is $ f(n) = 7 \cdot 4^{n} - 2^{n} $.

0 comments on commit c51c4c0

Please sign in to comment.