From d4edd6657cee42bfaa96e257ce420b53823f2e29 Mon Sep 17 00:00:00 2001 From: John Lu Date: Thu, 18 Jul 2024 00:44:31 -0400 Subject: [PATCH] formatted 2015 winter midterm --- .../2015-winter-midterm/1/solution.md | 2 ++ .../2015-winter-midterm/10/solution.md | 19 +++++++++++-------- .../2015-winter-midterm/11/solution.md | 15 +++++++++------ .../2015-winter-midterm/12/solution.md | 4 ++++ .../2015-winter-midterm/14/solution.md | 19 +++++++++++-------- .../2015-winter-midterm/15/solution.md | 4 ++++ .../2015-winter-midterm/17/solution.md | 6 ++++++ .../2015-winter-midterm/2/solution.md | 1 + .../2015-winter-midterm/3/solution.md | 1 + .../2015-winter-midterm/4/solution.md | 5 +++++ .../2015-winter-midterm/5/solution.md | 10 ++++++++++ .../2015-winter-midterm/6/solution.md | 5 +++++ .../2015-winter-midterm/7/solution.md | 4 ++++ .../2015-winter-midterm/8/solution.md | 2 ++ .../2015-winter-midterm/9/solution.md | 2 ++ 15 files changed, 77 insertions(+), 22 deletions(-) diff --git a/src/content/questions/comp2804/2015-winter-midterm/1/solution.md b/src/content/questions/comp2804/2015-winter-midterm/1/solution.md index 1c843a1a..a77d97e2 100644 --- a/src/content/questions/comp2804/2015-winter-midterm/1/solution.md +++ b/src/content/questions/comp2804/2015-winter-midterm/1/solution.md @@ -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)$. diff --git a/src/content/questions/comp2804/2015-winter-midterm/10/solution.md b/src/content/questions/comp2804/2015-winter-midterm/10/solution.md index 2ed3439f..bd51d8d0 100644 --- a/src/content/questions/comp2804/2015-winter-midterm/10/solution.md +++ b/src/content/questions/comp2804/2015-winter-midterm/10/solution.md @@ -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$ + Therefore, we know that $f(n) = 3n^{2} - n + 15$ is the correct answer diff --git a/src/content/questions/comp2804/2015-winter-midterm/11/solution.md b/src/content/questions/comp2804/2015-winter-midterm/11/solution.md index 7e4bfce2..8d39bf56 100644 --- a/src/content/questions/comp2804/2015-winter-midterm/11/solution.md +++ b/src/content/questions/comp2804/2015-winter-midterm/11/solution.md @@ -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 + + $S_n = 2 \cdot B_{n-1} + 2 \cdot B_{n-2} + 2 \cdot B_{n-3}$ diff --git a/src/content/questions/comp2804/2015-winter-midterm/12/solution.md b/src/content/questions/comp2804/2015-winter-midterm/12/solution.md index 252342eb..f52c2e1c 100644 --- a/src/content/questions/comp2804/2015-winter-midterm/12/solution.md +++ b/src/content/questions/comp2804/2015-winter-midterm/12/solution.md @@ -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}$ diff --git a/src/content/questions/comp2804/2015-winter-midterm/14/solution.md b/src/content/questions/comp2804/2015-winter-midterm/14/solution.md index dd36382d..5ed9d85a 100644 --- a/src/content/questions/comp2804/2015-winter-midterm/14/solution.md +++ b/src/content/questions/comp2804/2015-winter-midterm/14/solution.md @@ -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$ + Therefore, we know that $S(n)=2n-1$ is the correct answer. diff --git a/src/content/questions/comp2804/2015-winter-midterm/15/solution.md b/src/content/questions/comp2804/2015-winter-midterm/15/solution.md index d40f4817..054f2526 100644 --- a/src/content/questions/comp2804/2015-winter-midterm/15/solution.md +++ b/src/content/questions/comp2804/2015-winter-midterm/15/solution.md @@ -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 diff --git a/src/content/questions/comp2804/2015-winter-midterm/17/solution.md b/src/content/questions/comp2804/2015-winter-midterm/17/solution.md index 37ff3e20..4728135b 100644 --- a/src/content/questions/comp2804/2015-winter-midterm/17/solution.md +++ b/src/content/questions/comp2804/2015-winter-midterm/17/solution.md @@ -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}$ diff --git a/src/content/questions/comp2804/2015-winter-midterm/2/solution.md b/src/content/questions/comp2804/2015-winter-midterm/2/solution.md index 05c3aaf1..2b1364bf 100644 --- a/src/content/questions/comp2804/2015-winter-midterm/2/solution.md +++ b/src/content/questions/comp2804/2015-winter-midterm/2/solution.md @@ -1,2 +1,3 @@ For each element in A, there are output 15 choices in B. + Thus, there are $15^7$ functions. diff --git a/src/content/questions/comp2804/2015-winter-midterm/3/solution.md b/src/content/questions/comp2804/2015-winter-midterm/3/solution.md index b04305ac..870eb4ff 100644 --- a/src/content/questions/comp2804/2015-winter-midterm/3/solution.md +++ b/src/content/questions/comp2804/2015-winter-midterm/3/solution.md @@ -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. diff --git a/src/content/questions/comp2804/2015-winter-midterm/4/solution.md b/src/content/questions/comp2804/2015-winter-midterm/4/solution.md index 66d5a049..cde03944 100644 --- a/src/content/questions/comp2804/2015-winter-midterm/4/solution.md +++ b/src/content/questions/comp2804/2015-winter-midterm/4/solution.md @@ -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}$. diff --git a/src/content/questions/comp2804/2015-winter-midterm/5/solution.md b/src/content/questions/comp2804/2015-winter-midterm/5/solution.md index 5f2c125a..e03ad327 100644 --- a/src/content/questions/comp2804/2015-winter-midterm/5/solution.md +++ b/src/content/questions/comp2804/2015-winter-midterm/5/solution.md @@ -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}$ diff --git a/src/content/questions/comp2804/2015-winter-midterm/6/solution.md b/src/content/questions/comp2804/2015-winter-midterm/6/solution.md index 6e2da265..6fdb90ea 100644 --- a/src/content/questions/comp2804/2015-winter-midterm/6/solution.md +++ b/src/content/questions/comp2804/2015-winter-midterm/6/solution.md @@ -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}$ diff --git a/src/content/questions/comp2804/2015-winter-midterm/7/solution.md b/src/content/questions/comp2804/2015-winter-midterm/7/solution.md index d1b26cd4..aa08dee6 100644 --- a/src/content/questions/comp2804/2015-winter-midterm/7/solution.md +++ b/src/content/questions/comp2804/2015-winter-midterm/7/solution.md @@ -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$ diff --git a/src/content/questions/comp2804/2015-winter-midterm/8/solution.md b/src/content/questions/comp2804/2015-winter-midterm/8/solution.md index f60a9b9b..f7b29824 100644 --- a/src/content/questions/comp2804/2015-winter-midterm/8/solution.md +++ b/src/content/questions/comp2804/2015-winter-midterm/8/solution.md @@ -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}$ diff --git a/src/content/questions/comp2804/2015-winter-midterm/9/solution.md b/src/content/questions/comp2804/2015-winter-midterm/9/solution.md index 1a2c9e34..bc97859a 100644 --- a/src/content/questions/comp2804/2015-winter-midterm/9/solution.md +++ b/src/content/questions/comp2804/2015-winter-midterm/9/solution.md @@ -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.