diff --git a/src/content/questions/comp2804/2014-fall-final/10/solution.md b/src/content/questions/comp2804/2014-fall-final/10/solution.md
index 5eaa4aed..1cc8fd33 100644
--- a/src/content/questions/comp2804/2014-fall-final/10/solution.md
+++ b/src/content/questions/comp2804/2014-fall-final/10/solution.md
@@ -1,24 +1,28 @@
Let's calculate $f(1)$ first
-$f(1) = f(0) + 8 \cdot 1 - 2 $
+
+$f(1) = f(0) + 8 \cdot 1 - 2 $
+
$f(1) = -17 + 8 - 2 $
+
$f(1) = -11 $
-- $ f(n) = 3n^{2} - n - 17 $
-$ f(1) = 3 \cdot 1^2 - 1 - 17 $
-$ f(1) = 3 - 1 - 17 $
-$ f(1) = -15 $
-
- $ f(n) = 3n^{2} + n - 17 $
-$ f(1) = 3 \cdot 1^2 + 1 - 17 $
-$ f(1) = 3 + 1 - 17 $
-$ f(1) = -13 $
-
- $ f(n) = 4n^{2} - 2n - 17 $
-$ f(1) = 4 \cdot 1^2 - 2 - 17 $
-$ f(1) = 4 - 2 - 17 $
-$ f(1) = -15 $
-
- $ f(n) = 4n^{2} + 2n - 17 $
-$ f(1) = 4 \cdot 1^2 + 2 - 17 $
-$ f(1) = 4 + 2 - 17 $
-$ f(1) = -11 $
+
- $ f(n) = 3n^{2} - n - 17 $
+ $ f(1) = 3 \cdot 1^2 - 1 - 17 $
+ $ f(1) = 3 - 1 - 17 $
+ $ f(1) = -15 $
+ - $ f(n) = 3n^{2} + n - 17 $
+ $ f(1) = 3 \cdot 1^2 + 1 - 17 $
+ $ f(1) = 3 + 1 - 17 $
+ $ f(1) = -13 $
+ - $ f(n) = 4n^{2} - 2n - 17 $
+ $ f(1) = 4 \cdot 1^2 - 2 - 17 $
+ $ f(1) = 4 - 2 - 17 $
+ $ f(1) = -15 $
+ - $ f(n) = 4n^{2} + 2n - 17 $
+ $ f(1) = 4 \cdot 1^2 + 2 - 17 $
+ $ f(1) = 4 + 2 - 17 $
+ $ f(1) = -11 $
+
The correct answer is $ f(n) = 4n^{2} + 2n - 17 $ because it is the only one that gives the correct value for $ f(1) $
diff --git a/src/content/questions/comp2804/2014-fall-final/12/solution.md b/src/content/questions/comp2804/2014-fall-final/12/solution.md
index 646cf304..55ffffc5 100644
--- a/src/content/questions/comp2804/2014-fall-final/12/solution.md
+++ b/src/content/questions/comp2804/2014-fall-final/12/solution.md
@@ -1,17 +1,20 @@
-- Let A = Event that both balls are blue
-A occurs when we choose 2 of the 5 blue balls
-$ |A| = \binom{5}{2} $
-
- Let B = Event that both balls are red
- B occurs when we choose 2 of the 4 red balls
- $ |B| = \binom{4}{2} $
-
- Let C = Event that both balls are green
- C occurs when we choose 2 of the 6 green balls
- $ |C| = \binom{6}{2} $
-
- Let S = All possible outcomes
- S occurs when we choose 2 of the 15 balls
- $ |S| = \binom{15}{2} $
+
- Let A = Event that both balls are blue
+ A occurs when we choose 2 of the 5 blue balls
+ $ |A| = \binom{5}{2} $
+ - Let B = Event that both balls are red
+ B occurs when we choose 2 of the 4 red balls
+ $ |B| = \binom{4}{2} $
+ - Let C = Event that both balls are green
+ C occurs when we choose 2 of the 6 green balls
+ $ |C| = \binom{6}{2} $
+ - Let S = All possible outcomes
+ S occurs when we choose 2 of the 15 balls
+ $ |S| = \binom{15}{2} $
-$ |A \cup B \cup C| = |A| + |B| + |C| $
-$ |A \cup B \cup C| = \binom{5}{2} + \binom{4}{2} + \binom{6}{2} $
+
+$ |A \cup B \cup C| = |A| + |B| + |C| $
+
+$ |A \cup B \cup C| = \binom{5}{2} + \binom{4}{2} + \binom{6}{2} $
+
$ Pr(A \cup B \cup C) = \frac{\binom{5}{2} + \binom{4}{2} + \binom{6}{2}}{\binom{15}{2}} $
diff --git a/src/content/questions/comp2804/2014-fall-final/13/solution.md b/src/content/questions/comp2804/2014-fall-final/13/solution.md
index fe0fa201..4497bdc8 100644
--- a/src/content/questions/comp2804/2014-fall-final/13/solution.md
+++ b/src/content/questions/comp2804/2014-fall-final/13/solution.md
@@ -1,9 +1,17 @@
Let A = Event that Annie, Boris, and Charlie have the same birthday
+
Annie has a birthday on any of the 365 days: 365
+
Boris would only then have a birthday on the same day as Annie: 1
+
Charlie would only then have a birthday on the same day as Annie and Boris: 1
+
$ |A| = 365 \cdot 1 \cdot 1 $
+
Let S = All possible outcomes
+
$ |S| = 365^3 $
+
$ Pr(A) = \frac{365}{365^3} $
+
$ Pr(A) = \frac{1}{365^2} $
diff --git a/src/content/questions/comp2804/2014-fall-final/14/solution.md b/src/content/questions/comp2804/2014-fall-final/14/solution.md
index c283f6c2..709b6797 100644
--- a/src/content/questions/comp2804/2014-fall-final/14/solution.md
+++ b/src/content/questions/comp2804/2014-fall-final/14/solution.md
@@ -1,12 +1,12 @@
Let's go through each option and explain
-- $1 - (1/2)^{7}$
-This is just the complement rule, which usually works but they're subtracting the probability that we get 6 tails followed by a head
-It might've worked if they were subtracting the probability that we get 7 tails followed by a head from the whole set of possibilities
-
- $\sum_{k=0}^{7} (1/2)^{k}$
-This one is wrong because it starts at $ { left( \frac{1}{2} right)}^0 $ but it doesn't take into account the fact that we have to flip a head to stop, which has a probability of $ \frac{1}{2} $
-
- $\sum_{k=0}^{7} (1/2)^{k+1}$
-This one is beautiful
-It says, probability of flipping a heads right away, probability of flipping a tails folloewd by a heads, probability of flipping 2 tails followed by a heads, and so on until 7 tails followed by a heads
+
- $1 - (1/2)^{7}$
+ This is just the complement rule, which usually works but they're subtracting the probability that we get 6 tails followed by a head
+ It might've worked if they were subtracting the probability that we get 7 tails followed by a head from the whole set of possibilities
+ - $\sum_{k=0}^{7} (1/2)^{k}$
+ This one is wrong because it starts at $ { left( \frac{1}{2} right)}^0 $ but it doesn't take into account the fact that we have to flip a head to stop, which has a probability of $ \frac{1}{2} $
+ - $\sum_{k=0}^{7} (1/2)^{k+1}$
+ This one is beautiful
+ It says, probability of flipping a heads right away, probability of flipping a tails folloewd by a heads, probability of flipping 2 tails followed by a heads, and so on until 7 tails followed by a heads
diff --git a/src/content/questions/comp2804/2014-fall-final/15/solution.md b/src/content/questions/comp2804/2014-fall-final/15/solution.md
index 74ab9c59..0e187dc6 100644
--- a/src/content/questions/comp2804/2014-fall-final/15/solution.md
+++ b/src/content/questions/comp2804/2014-fall-final/15/solution.md
@@ -1,12 +1,14 @@
-- Let A = Event that both balls are red
-A occurs when we choose 2 of the 4 red balls
-$ |A| = \binom{4}{2} $
-
- Let B = Event that both balls have the same color
- B occurs when we choose 2 of the 5 blue balls or 2 of the 4 red balls
- $ |B| = \binom{5}{2} + \binom{4}{2} $
-
- Let $A \cap B$ = Event that both balls are red and both balls have the same color
-$ |A \cap B| = \binom{4}{2} $
+
- Let A = Event that both balls are red
+ A occurs when we choose 2 of the 4 red balls
+ $ |A| = \binom{4}{2} $
+ - Let B = Event that both balls have the same color
+ B occurs when we choose 2 of the 5 blue balls or 2 of the 4 red balls
+ $ |B| = \binom{5}{2} + \binom{4}{2} $
+ - Let $A \cap B$ = Event that both balls are red and both balls have the same color
+ $ |A \cap B| = \binom{4}{2} $
-$ Pr(A|B) = \frac{|A \cap B|}{|B|} $
+
+$ Pr(A|B) = \frac{|A \cap B|}{|B|} $
+
$ Pr(A|B) = \frac{\binom{4}{2}}{\binom{5}{2} + \binom{4}{2}} $
diff --git a/src/content/questions/comp2804/2014-fall-final/16/solution.md b/src/content/questions/comp2804/2014-fall-final/16/solution.md
index 9d550bc4..7db7455e 100644
--- a/src/content/questions/comp2804/2014-fall-final/16/solution.md
+++ b/src/content/questions/comp2804/2014-fall-final/16/solution.md
@@ -1,12 +1,14 @@
-- Let A = Event that $x$ is even
-A occurs when we choose an even number from the set ${2, 4, 6, 8, 10}$
-$ |A| = 5 $
-
- Let B = Event that $x$ is divisible by 3
-B occurs when we choose a number from the set ${3, 6, 9}$
-$ |B| = 3 $
-
- Let $A \cap B$ = Event that $x$ is even and divisible by 3
-$ |A \cap B| = 1 $
+
- Let A = Event that $x$ is even
+ A occurs when we choose an even number from the set ${2, 4, 6, 8, 10}$
+ $ |A| = 5 $
+ - Let B = Event that $x$ is divisible by 3
+ B occurs when we choose a number from the set ${3, 6, 9}$
+ $ |B| = 3 $
+ - Let $A \cap B$ = Event that $x$ is even and divisible by 3
+ $ |A \cap B| = 1 $
-$ Pr(A|B) = \frac{|A \cap B|}{|B|} $
+
+$ Pr(A|B) = \frac{|A \cap B|}{|B|} $
+
$ Pr(A|B) = \frac{1}{3} $
diff --git a/src/content/questions/comp2804/2014-fall-final/17/solution.md b/src/content/questions/comp2804/2014-fall-final/17/solution.md
index 3ad13f60..77dd6786 100644
--- a/src/content/questions/comp2804/2014-fall-final/17/solution.md
+++ b/src/content/questions/comp2804/2014-fall-final/17/solution.md
@@ -1,17 +1,21 @@
-- Let S = All possible outcomes
-$ |S| = 10 $
-
- A occurs when we choose an even number from the set ${2, 4, 6, 8, 10}$
-$ |A| = 5 $
-$Pr(A) = \frac{5}{10} = \frac{1}{2} $
-
- B occurs when we choose a number from the set ${1, 2, 3, 4, 5}$
-$ |B| = 5 $
-$Pr(B) = \frac{5}{10} = \frac{1}{2} $
-
- $A \cap B$ occurs when we choose an even number from the set ${2, 4}$
-$ |A \cap B| = 2 $
-$Pr(A \cap B) = \frac{2}{10} = \frac{1}{5} $
+
- Let S = All possible outcomes
+ $ |S| = 10 $
+ - A occurs when we choose an even number from the set ${2, 4, 6, 8, 10}$
+ $ |A| = 5 $
+ $Pr(A) = \frac{5}{10} = \frac{1}{2} $
+ - B occurs when we choose a number from the set ${1, 2, 3, 4, 5}$
+ $ |B| = 5 $
+ $Pr(B) = \frac{5}{10} = \frac{1}{2} $
+ - $A \cap B$ occurs when we choose an even number from the set ${2, 4}$
+ $ |A \cap B| = 2 $
+ $Pr(A \cap B) = \frac{2}{10} = \frac{1}{5} $
-$ Pr(A \cap B) = Pr(A) \cdot Pr(B) $
-$ \frac{1}{5} = \frac{1}{2} \cdot \frac{1}{2} $
-$ \frac{1}{5} = \frac{1}{4} $
+
+$ Pr(A \cap B) = Pr(A) \cdot Pr(B) $
+
+$ \frac{1}{5} = \frac{1}{2} \cdot \frac{1}{2} $
+
+$ \frac{1}{5} = \frac{1}{4} $
+
Because the equation is false, these events are not independent.
diff --git a/src/content/questions/comp2804/2014-fall-final/18/solution.md b/src/content/questions/comp2804/2014-fall-final/18/solution.md
index 2b2273dc..c373cb4a 100644
--- a/src/content/questions/comp2804/2014-fall-final/18/solution.md
+++ b/src/content/questions/comp2804/2014-fall-final/18/solution.md
@@ -1,17 +1,21 @@
-- Let S = All possible outcomes
-$ |S| = 10 $
-
- A occurs when we choose an even number from the set ${2, 4, 6, 8, 10}$
-$ |A| = 5 $
-$Pr(A) = \frac{5}{10} = \frac{1}{2} $
-
- B occurs when we choose a number from the set ${1, 2, 3, 4, 5, 6}$
-$ |B| = 6 $
-$Pr(B) = \frac{6}{10} = \frac{3}{5} $
-
- $A \cap B$ occurs when we choose an even number from the set ${2, 4, 6}$
-$ |A \cap B| = 3 $
-$Pr(A \cap B) = \frac{3}{10} $
+
- Let S = All possible outcomes
+ $ |S| = 10 $
+ - A occurs when we choose an even number from the set ${2, 4, 6, 8, 10}$
+ $ |A| = 5 $
+ $Pr(A) = \frac{5}{10} = \frac{1}{2} $
+ - B occurs when we choose a number from the set ${1, 2, 3, 4, 5, 6}$
+ $ |B| = 6 $
+ $Pr(B) = \frac{6}{10} = \frac{3}{5} $
+ - $A \cap B$ occurs when we choose an even number from the set ${2, 4, 6}$
+ $ |A \cap B| = 3 $
+ $Pr(A \cap B) = \frac{3}{10} $
-$ Pr(A \cap B) = Pr(A) \cdot Pr(B) $
-$ \frac{3}{10} = \frac{1}{2} \cdot \frac{3}{5} $
-$ \frac{3}{10} = \frac{3}{10} $
+
+$ Pr(A \cap B) = Pr(A) \cdot Pr(B) $
+
+$ \frac{3}{10} = \frac{1}{2} \cdot \frac{3}{5} $
+
+$ \frac{3}{10} = \frac{3}{10} $
+
Because the equation is true, these events are independent.
diff --git a/src/content/questions/comp2804/2014-fall-final/19/solution.md b/src/content/questions/comp2804/2014-fall-final/19/solution.md
index f7efe57a..9ad9957d 100644
--- a/src/content/questions/comp2804/2014-fall-final/19/solution.md
+++ b/src/content/questions/comp2804/2014-fall-final/19/solution.md
@@ -1,17 +1,21 @@
We need to determine if events $ A $ and $ B $ are independent.
-- $ Pr(A) = \frac{1}{2} $
-
- If they have at least 3 kids and the third child is a boy, let's calculate what's needed to get there
- Boy, Girl, Boy: $ \frac{1}{2} \cdot \frac{1}{2} \cdot \frac{1}{2} = \frac{1}{8} $
- Girl, Boy, Boy: $ \frac{1}{2} \cdot \frac{1}{2} \cdot \frac{1}{2} = \frac{1}{8} $
- $ Pr(B) = \frac{1}{8} + \frac{1}{8} = \frac{1}{4} $
-
- $ Pr(A \cap B) $ now
- If the second child is a boy and we want them to keep pumping out babies, then the first two children must be of different genders
- That leaves us with Girl, Boy, Boy: $ \frac{1}{2} \cdot \frac{1}{2} \cdot \frac{1}{2} = \frac{1}{8} $
- $ Pr(A \cap B) = \frac{1}{8} $
+
- $ Pr(A) = \frac{1}{2} $
+
- If they have at least 3 kids and the third child is a boy, let's calculate what's needed to get there
+ Boy, Girl, Boy: $ \frac{1}{2} \cdot \frac{1}{2} \cdot \frac{1}{2} = \frac{1}{8} $
+ Girl, Boy, Boy: $ \frac{1}{2} \cdot \frac{1}{2} \cdot \frac{1}{2} = \frac{1}{8} $
+ $ Pr(B) = \frac{1}{8} + \frac{1}{8} = \frac{1}{4} $
+ - $ Pr(A \cap B) $ now
+ If the second child is a boy and we want them to keep pumping out babies, then the first two children must be of different genders
+ That leaves us with Girl, Boy, Boy: $ \frac{1}{2} \cdot \frac{1}{2} \cdot \frac{1}{2} = \frac{1}{8} $
+ $ Pr(A \cap B) = \frac{1}{8} $
-Now, let's check if $ Pr(A) \cdot Pr(B) = Pr(A \cap B) $
-$ \frac{1}{2} \cdot \frac{1}{4} = \frac{1}{8} $
-$ \frac{1}{8} = \frac{1}{8} $
+
+Now, let's check if $ Pr(A) \cdot Pr(B) = Pr(A \cap B) $
+
+$ \frac{1}{2} \cdot \frac{1}{4} = \frac{1}{8} $
+
+$ \frac{1}{8} = \frac{1}{8} $
+
The events $ A $ and $ B $ are independent. Thus, the statement is true.
diff --git a/src/content/questions/comp2804/2014-fall-final/2/solution.md b/src/content/questions/comp2804/2014-fall-final/2/solution.md
index 4c20b45b..e99d268d 100644
--- a/src/content/questions/comp2804/2014-fall-final/2/solution.md
+++ b/src/content/questions/comp2804/2014-fall-final/2/solution.md
@@ -1,17 +1,19 @@
-- A = Event that the password contains 0 event digits
-Since every digit is odd, each of the 13 digits must be chosen from the set {1,3,5,7,9}
-$ |A| = 5^{13} $
-
- B = Event that the password contains 1 event digit
- Since 1 of the digits is even, there are 13 positions to place the single even digit: $ \binom{13}{1} $
- Since the 1 even digit can be chosen from the set {0,2,4,6,8}, there are 5 choices for the even digit: $ 5 $
- The remaining 12 digits must be chosen from the set {1,3,5,7,9}, so there are $ 5^{12} $ ways to choose the remaining digits
- $ |B| = \binom{13}{1} \cdot 5 \cdot 5^{12} $
-
- C = Event that the password contains 2 event digits
- Since 2 of the digits are even, there are $ \binom{13}{2} $ ways to choose the 2 positions for the even digits
- Since the 2 even digits can be chosen from the set {0,2,4,6,8}, each digit has 5 choices: $ 5^2 $
- The remaining 11 digits must be chosen from the set {1,3,5,7,9}, so there are $ 5^{11} $ ways to choose the remaining digits
- $ |C| = \binom{13}{2} \cdot 5^2 \cdot 5^{11} $
+
- A = Event that the password contains 0 event digits
+ Since every digit is odd, each of the 13 digits must be chosen from the set {1,3,5,7,9}
+ $ |A| = 5^{13} $
+ - B = Event that the password contains 1 event digit
+ Since 1 of the digits is even, there are 13 positions to place the single even digit: $ \binom{13}{1} $
+ Since the 1 even digit can be chosen from the set {0,2,4,6,8}, there are 5 choices for the even digit: $ 5 $
+ The remaining 12 digits must be chosen from the set {1,3,5,7,9}, so there are $ 5^{12} $ ways to choose the remaining digits
+ $ |B| = \binom{13}{1} \cdot 5 \cdot 5^{12} $
+ - C = Event that the password contains 2 event digits
+ Since 2 of the digits are even, there are $ \binom{13}{2} $ ways to choose the 2 positions for the even digits
+ Since the 2 even digits can be chosen from the set {0,2,4,6,8}, each digit has 5 choices: $ 5^2 $
+ The remaining 11 digits must be chosen from the set {1,3,5,7,9}, so there are $ 5^{11} $ ways to choose the remaining digits
+ $ |C| = \binom{13}{2} \cdot 5^2 \cdot 5^{11} $
-$ |A| + |B| + |C| = 5^{13} + \binom{13}{1} \cdot 5 \cdot 5^{12} + \binom{13}{2} \cdot 5^2 \cdot 5^{11} $
+
+$ |A| + |B| + |C| = 5^{13} + \binom{13}{1} \cdot 5 \cdot 5^{12} + \binom{13}{2} \cdot 5^2 \cdot 5^{11} $
+
$ |A| + |B| + |C| = 5^{13} + 13 \cdot 5^{13} + \binom{13}{2} \cdot 5^{13} $
diff --git a/src/content/questions/comp2804/2014-fall-final/20/solution.md b/src/content/questions/comp2804/2014-fall-final/20/solution.md
index e69de29b..a56c0762 100644
--- a/src/content/questions/comp2804/2014-fall-final/20/solution.md
+++ b/src/content/questions/comp2804/2014-fall-final/20/solution.md
@@ -0,0 +1,3 @@
+I mean, there are a total of 4 options, and only one of them is right.
+
+The probability of getting the right answer is $ \frac{1}{4} $.
diff --git a/src/content/questions/comp2804/2014-fall-final/21/solution.md b/src/content/questions/comp2804/2014-fall-final/21/solution.md
index 1c37d2d8..23ff3909 100644
--- a/src/content/questions/comp2804/2014-fall-final/21/solution.md
+++ b/src/content/questions/comp2804/2014-fall-final/21/solution.md
@@ -1,48 +1,43 @@
-subsection\*{Step-by-Step Solution}
-
-1. **Possible Outcomes and Corresponding Values:**
+1. **Possible Outcomes and Corresponding Values:**
There are four possible outcomes when flipping two fair coins:
- begin{itemize}
- First coin is heads (H), second coin is heads (H): $(H, H)$
- First coin is heads (H), second coin is tails (T): $(H, T)$
- First coin is tails (T), second coin is heads (H): $(T, H)$
- First coin is tails (T), second coin is tails (T): $(T, T)$
- end{itemize}
+
+ - First coin is heads (H), second coin is heads (H): $(H, H)$
+
- First coin is heads (H), second coin is tails (T): $(H, T)$
+
- First coin is tails (T), second coin is heads (H): $(T, H)$
+
- First coin is tails (T), second coin is tails (T): $(T, T)$
+
-2. **Winning Amount for Each Outcome:**
+2. **Winning Amount for Each Outcome:**
For each outcome, we determine the amount $ X $ that you win:
- begin{itemize}
- $(H, H)$: The first coin is heads, so we don't lose. The second coin is heads, so we win 1 dollar. Thus, $ X = 1 $.
- $(H, T)$: The first coin is heads, so we don't lose. The second coin is tails, so we don't win. Thus, $ X = 0 $.
- $(T, H)$: The first coin is tails, so we lose (i.e., we win $-1$ dollars). The second coin is heads, so we win 1 dollar, but since the first coin being tails means we lose, this overrides the second coin's result. Thus, $ X = -1 $.
- $(T, T)$: The first coin is tails, so we lose (i.e., we win $-1$ dollars). The second coin is tails, so we don't win. Thus, $ X = -1 $.
- end{itemize}
+
+ - $(H, H)$: The first coin is heads, so we don't lose.
+ The second coin is heads, so we win 1 dollar.
+ Thus, $ X = 1 $.
+ - $(H, T)$: The first coin is heads, so we don't lose.
+ The second coin is tails, so we don't win.
+ Thus, $ X = 0 $.
+ - $(T, H)$: The first coin is tails, so we lose (i.e., we win $-1$ dollars).
+ The second coin is heads, so we win 1 dollar, but since the first coin being tails means we lose, this overrides the second coin's result.
+ Thus, $ X = -1 $.
+ - $(T, T)$: The first coin is tails, so we lose (i.e., we win $-1$ dollars).
+ The second coin is tails, so we don't win. Thus, $ X = -1 $.
+
-3. **Calculate the Expected Value $ E(X) $:**
-The expected value $ E(X) $ is calculated using the formula:
-[
-E(X) = sum_{i} P(X = x_i) \cdot x_i
-]
-Each of the four outcomes has a probability of $ \frac{1}{4} $, as the coins are fair and independent.
+3. **Calculate the Expected Value $ E(X) $:**
+The expected value $ E(X) $ is calculated using the formula:
+$E(X) = sum\_{i} P(X = x_i) \cdot x_i $
+Each of the four outcomes has a probability of $ \frac{1}{4} $, as the coins are fair and independent.
Therefore, we have:
-begin{itemize}
- $ P(X = 1) = \frac{1}{4} $ (from the $(H, H)$ outcome)
+
+ - $ P(X = 1) = \frac{1}{4} $ (from the $(H, H)$ outcome)
- $ P(X = 0) = \frac{1}{4} $ (from the $(H, T)$ outcome)
- $ P(X = -1) = \frac{1}{2} $ (from the $(T, H)$ and $(T, T)$ outcomes combined)
- end{itemize}
+
-4. **Substitute the Values into the Expected Value Formula:**
- [
- E(X) = 1 \cdot \frac{1}{4} + 0 \cdot \frac{1}{4} + (-1) \cdot \frac{1}{2}
- ]
- [
- E(X) = \frac{1}{4} + 0 - \frac{1}{2}
- ]
- [
- E(X) = \frac{1}{4} - \frac{2}{4}
- ]
- [
- E(X) = -\frac{1}{4}
- ]
+4. **Substitute the Values into the Expected Value Formula:**
+ $E(X) = 1 \cdot \frac{1}{4} + 0 \cdot \frac{1}{4} + (-1) \cdot \frac{1}{2}$
+ $E(X) = \frac{1}{4} + 0 - \frac{1}{2}$
+ $E(X) = \frac{1}{4} - \frac{2}{4}$
+ $E(X) = -\frac{1}{4}$
-Therefore, the expected value of $ X $ is $ boxed{-\frac{1}{4}} $.
+Therefore, the expected value of $ X $ is $ \boxed{-\frac{1}{4}} $.
diff --git a/src/content/questions/comp2804/2014-fall-final/22/solution.md b/src/content/questions/comp2804/2014-fall-final/22/solution.md
index 9f4b075e..bbb483b0 100644
--- a/src/content/questions/comp2804/2014-fall-final/22/solution.md
+++ b/src/content/questions/comp2804/2014-fall-final/22/solution.md
@@ -1,28 +1,23 @@
-subsection\*{Step-by-Step Solution}
+1. **Probability of Getting $ HTH $:**
+ The probability of getting a head followed by a tail followed by a head in three consecutive flips is:
+ $P(HTH) = P(H) \times P(T) \times P(H) = \left( \frac{1}{2}\right) \times \left( \frac{1}{2}\right) \times \left( \frac{1}{2}\right) = \frac{1}{8} $
-1. **Probability of Getting $ HTH $:**
- The probability of getting a head followed by a tail followed by a head in three consecutive flips is:
- [
- P(HTH) = P(H) times P(T) times P(H) = left( \frac{1}{2}right) times left( \frac{1}{2}right) times left( \frac{1}{2}right) = \frac{1}{8}
- ]
-2. **Number of Possible $ HTH $ in 6 Flips:**
- Since we are looking for consecutive $ HTH $ patterns, we need to consider overlapping patterns in the sequence.
- In a sequence of 6 coin flips, the positions where a $ HTH $ can start are:
- begin{itemize}
- 1st position: $ {1, 2, 3} $
- 2nd position: $ {2, 3, 4} $
- 3rd position: $ {3, 4, 5} $
- 4th position: $ {4, 5, 6} $
- end{itemize}
+2. **Number of Possible $ HTH $ in 6 Flips:**
+ Since we are looking for consecutive $ HTH $ patterns, we need to consider overlapping patterns in the sequence.
+ In a sequence of 6 coin flips, the positions where a $ HTH $ can start are:
+
+ - 1st position: $ {1, 2, 3} $
+
- 2nd position: $ {2, 3, 4} $
+
- 3rd position: $ {3, 4, 5} $
+
- 4th position: $ {4, 5, 6} $
+
Therefore, there are 4 possible positions for a $ HTH $ to occur.
-3. **Expected Value Contribution from Each Position:**
- For each position, the expected value contribution is:
- [
- E(text{one } HTH) = P(HTH) times text{payout} = \frac{1}{8} times 5 = \frac{5}{8}
- ]
-4. **Total Expected Value $ E(X) $:**
- Since there are 4 possible positions, the total expected value is the sum of the contributions from each position:
- [
- E(X) = 4 times \frac{5}{8} = \frac{20}{8} = \frac{5}{2}
- ]
- Therefore, the expected value of $ X $ is $ boxed{ \frac{5}{2}} $.
+
+3. **Expected Value Contribution from Each Position:**
+ For each position, the expected value contribution is:
+ $E(\text{one } HTH) = P(HTH) \times \text{payout} = \frac{1}{8} \times 5 = \frac{5}{8}$
+
+4. **Total Expected Value $ E(X) $:**
+ Since there are 4 possible positions, the total expected value is the sum of the contributions from each position:
+ $E(X) = 4 \times \frac{5}{8} = \frac{20}{8} = \frac{5}{2}$
+ Therefore, the expected value of $ X $ is $ \boxed{ \frac{5}{2}} $.
diff --git a/src/content/questions/comp2804/2014-fall-final/23/solution.md b/src/content/questions/comp2804/2014-fall-final/23/solution.md
index 358a31d4..143301ea 100644
--- a/src/content/questions/comp2804/2014-fall-final/23/solution.md
+++ b/src/content/questions/comp2804/2014-fall-final/23/solution.md
@@ -1,6 +1,11 @@
So um, this algorithm pretty much counts the number of attempts we make until we get $HHH$ or $TTT$
+
We have a $ \frac{1}{8} $ chance of flipping an $HHH$
+
We have a $ \frac{1}{8} $ chance of flipping an $TTT$
+
This gives us a $ \frac{1}{4} $ chance of flipping either $HHH$ or $TTT$
+
By the geometric distribution, the expected value of the number of attempts until we get a success is $ \frac{1}{p} $
+
Therefore, the expected value of $X$ is $ \frac{1}{ \frac{1}{4}} = 4 $
diff --git a/src/content/questions/comp2804/2014-fall-final/24/solution.md b/src/content/questions/comp2804/2014-fall-final/24/solution.md
index 06e511e6..ab15cfb1 100644
--- a/src/content/questions/comp2804/2014-fall-final/24/solution.md
+++ b/src/content/questions/comp2804/2014-fall-final/24/solution.md
@@ -1,12 +1,18 @@
-- Let A be the event that we flip a head
-$ Pr(A) = \frac{1}{2} $
-
- Let B be the event that we flip a tail
- $ Pr(B) = \frac{1}{2} $
+
- Let A be the event that we flip a head
+ $ Pr(A) = \frac{1}{2} $
+ - Let B be the event that we flip a tail
+ $ Pr(B) = \frac{1}{2} $
-$ \mathbb{E}(X) = 2 \cdot \mathbb{E}(\text{number of heads}) - 3 \cdot \mathbb{E}(\text{number of tails}) $
-$ \mathbb{E}(X) = 2 \cdot \sum*{i=0}^{n} Pr(A) - 3 \cdot \sum*{i=0}^{n} Pr(B) $
-$ \mathbb{E}(X) = 2 \cdot n \cdot \frac{1}{2} - 3 \cdot n \cdot \frac{1}{2} $
-$ \mathbb{E}(X) = n - \frac{3}{2}n $
-$ \mathbb{E}(X) = \frac{2n}{2} - \frac{3n}{2} $
+
+$ \mathbb{E}(X) = 2 \cdot \mathbb{E}(\text{number of heads}) - 3 \cdot \mathbb{E}(\text{number of tails}) $
+
+$ \mathbb{E}(X) = 2 \cdot \sum*{i=0}^{n} Pr(A) - 3 \cdot \sum*{i=0}^{n} Pr(B) $
+
+$ \mathbb{E}(X) = 2 \cdot n \cdot \frac{1}{2} - 3 \cdot n \cdot \frac{1}{2} $
+
+$ \mathbb{E}(X) = n - \frac{3}{2}n $
+
+$ \mathbb{E}(X) = \frac{2n}{2} - \frac{3n}{2} $
+
$ \mathbb{E}(X) = \frac{-n}{2} $
diff --git a/src/content/questions/comp2804/2014-fall-final/3/solution.md b/src/content/questions/comp2804/2014-fall-final/3/solution.md
index e69de29b..9d3244b2 100644
--- a/src/content/questions/comp2804/2014-fall-final/3/solution.md
+++ b/src/content/questions/comp2804/2014-fall-final/3/solution.md
@@ -0,0 +1,9 @@
+$ \sum\_{k=0}^{45} \binom{45}{k} {{(-3)}^{2k}} $
+
+$ = \sum\_{k=0}^{45} \binom{45}{k} {9}^{k} $
+
+$ = \sum\_{k=0}^{45} \binom{45}{k} {9}^{k} {1}^{45-k} $
+
+$= {(1+9)}^{45} $
+
+$= {10}^{45} $
diff --git a/src/content/questions/comp2804/2014-fall-final/4/solution.md b/src/content/questions/comp2804/2014-fall-final/4/solution.md
index fe6f9f85..03d20baf 100644
--- a/src/content/questions/comp2804/2014-fall-final/4/solution.md
+++ b/src/content/questions/comp2804/2014-fall-final/4/solution.md
@@ -1,19 +1,24 @@
-- A = Event that the bitstring starts with 010
-Since the bitstring starts with 010, the first 3 digits must be 010
-The remaining 10 digits can be chosen from the set {0,1}, so there are $ 2^{10} $ ways to choose the remaining digits
-$ |A| = 2^{10} $
-
- B = Event that the bitstring ends with 11
- Since the bitstring ends with 11, the last 2 digits must be 11
- The remaining 11 digits can be chosen from the set {0,1}, so there are $ 2^{11} $ ways to choose the remaining digits
- $ |B| = 2^{11} $
-
- $ A \cap B $ = Event that the bitstring starts with 010 and ends with 11
- Since the bitstring starts with 010 and ends with 11, the first 3 digits must be 010 and the last 2 digits must be 11
- The remaining 8 digits can be chosen from the set {0,1}, so there are $ 2^8 $ ways to choose the remaining digits
- $ |A \cap B| = 2^8 $
+
- A = Event that the bitstring starts with 010
+ Since the bitstring starts with 010, the first 3 digits must be 010
+ The remaining 10 digits can be chosen from the set {0,1}, so there are $ 2^{10} $ ways to choose the remaining digits
+ $ |A| = 2^{10} $
+ - B = Event that the bitstring ends with 11
+ Since the bitstring ends with 11, the last 2 digits must be 11
+ The remaining 11 digits can be chosen from the set {0,1}, so there are $ 2^{11} $ ways to choose the remaining digits
+ $ |B| = 2^{11} $
+ - $ A \cap B $ = Event that the bitstring starts with 010 and ends with 11
+ Since the bitstring starts with 010 and ends with 11, the first 3 digits must be 010 and the last 2 digits must be 11
+ The remaining 8 digits can be chosen from the set {0,1}, so there are $ 2^8 $ ways to choose the remaining digits
+ $ |A \cap B| = 2^8 $
-$ |A \cup B| = |A| + |B| - |A \cap B| $
-$ |A \cup B| = 2^{10} + 2^{11} - 2^8 $
-$ |A \cup B| = 1 \cdot 2^{10} + 2 \cdot 2^{10} - 2^8$
-$ |A \cup B| = (1+2) \cdot 2^{10} - 2^8 $
+
+$ |A \cup B| = |A| + |B| - |A \cap B| $
+
+$ |A \cup B| = 2^{10} + 2^{11} - 2^8 $
+
+$ |A \cup B| = 1 \cdot 2^{10} + 2 \cdot 2^{10} - 2^8$
+
+$ |A \cup B| = (1+2) \cdot 2^{10} - 2^8 $
+
$ |A \cup B| = 3 \cdot 2^{10} - 2^8 $
diff --git a/src/content/questions/comp2804/2014-fall-final/5/solution.md b/src/content/questions/comp2804/2014-fall-final/5/solution.md
index eb01dfaa..b8ec5c2d 100644
--- a/src/content/questions/comp2804/2014-fall-final/5/solution.md
+++ b/src/content/questions/comp2804/2014-fall-final/5/solution.md
@@ -4,4 +4,4 @@ Let's write out all recursive cases for $S_n$
$0, S_{n-1} $
$1, 0, S_{n-2} $
-$S*n = S*{n-1} + S_{n-2} $
+$S_n = S_{n-1} + S_{n-2} $
diff --git a/src/content/questions/comp2804/2014-fall-final/6/solution.md b/src/content/questions/comp2804/2014-fall-final/6/solution.md
index 7e50e8db..58caea3a 100644
--- a/src/content/questions/comp2804/2014-fall-final/6/solution.md
+++ b/src/content/questions/comp2804/2014-fall-final/6/solution.md
@@ -1,10 +1,19 @@
A = Like 8:30am classes
+
$ |A| = 40 $
+
B = Like COMP 2804
+
$ |B| = 30 $
+
$ |\overline{A \cup B}| = 50 $
+
$ |A \cup B| = 100-50 $
+
$ |A \cup B| = 50 $
+
$ |A \cap B| = |A| + |B| - |A \cup B| $
+
$ |A \cap B| = 40 + 30 - 50 $
+
$ |A \cap B| = 20 $
diff --git a/src/content/questions/comp2804/2014-fall-final/7/solution.md b/src/content/questions/comp2804/2014-fall-final/7/solution.md
index c89f5f32..eaf75d5d 100644
--- a/src/content/questions/comp2804/2014-fall-final/7/solution.md
+++ b/src/content/questions/comp2804/2014-fall-final/7/solution.md
@@ -1,9 +1,17 @@
A = Event that we pick 7 blue balls
+
First, we choose 7 of the m blue balls: $ \binom{m}{7} $
+
The first ball has 7 choices, the second ball has 6 choices, the third ball has 5 choices, and so on until the seventh ball has 1 choice: $ 7! $
+
$ |A| = \binom{m}{7} \cdot 7! $
+
B = Event that we pick 7 red balls
+
First, we choose 7 of the n red balls: $ \binom{n}{7} $
+
The first ball has 7 choices, the second ball has 6 choices, the third ball has 5 choices, and so on until the seventh ball has 1 choice: $ 7! $
+
$ |B| = \binom{n}{7} \cdot 7! $
+
$ |A| + |B| = \binom{m}{7} \cdot 7! + \binom{n}{7} \cdot 7! $
diff --git a/src/content/questions/comp2804/2014-fall-final/8/solution.md b/src/content/questions/comp2804/2014-fall-final/8/solution.md
index 7636cbb4..489a4ff4 100644
--- a/src/content/questions/comp2804/2014-fall-final/8/solution.md
+++ b/src/content/questions/comp2804/2014-fall-final/8/solution.md
@@ -1,9 +1,13 @@
-- A 3
-
- B 2
-
- C 5
+
- A 3
+
- B 2
+
- C 5
-$ \binom{10}{3} \cdot \binom{7}{2} \cdot \binom{5}{5} $
-$ \frac{10!}{3!7!} \cdot \frac{7!}{2!5!} \cdot \frac{5!}{5!0!} $
-$ \frac{10!}{3!1} \cdot \frac{1}{2!5!} \cdot \frac{1}{1 \cdot 1} $
-$ \frac{10!}{3!2!5!} $
+
+$ \binom{10}{3} \cdot \binom{7}{2} \cdot \binom{5}{5} $
+
+$ = \frac{10!}{3!7!} \cdot \frac{7!}{2!5!} \cdot \frac{5!}{5!0!} $
+
+$ = \frac{10!}{3!1} \cdot \frac{1}{2!5!} \cdot \frac{1}{1 \cdot 1} $
+
+$ = \frac{10!}{3!2!5!} $
diff --git a/src/content/questions/comp2804/2014-fall-final/9/solution.md b/src/content/questions/comp2804/2014-fall-final/9/solution.md
index 8a5c0f4a..335fffc0 100644
--- a/src/content/questions/comp2804/2014-fall-final/9/solution.md
+++ b/src/content/questions/comp2804/2014-fall-final/9/solution.md
@@ -1,9 +1,11 @@
We can solve this using stars and bars approach
+
There are 13 stars and 2 extra positions to place the bars/dividers between rows of stars
-- The number of stars to the left of the first bar is $x_1$
-
- The number of stars between the first and second bars is $x_2$
-
- The number of stars to the right of the second bar is $x_3$
+
- The number of stars to the left of the first bar is $x_1$
+
- The number of stars between the first and second bars is $x_2$
+
- The number of stars to the right of the second bar is $x_3$
+
As a result, we pick 2 positions out of 13 and 2 positions to place the bars: $ \binom{15}{2} $