Skip to content

Commit

Permalink
spaced out 2018 winter final
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnLu2004 committed Jul 18, 2024
1 parent 5d7edf7 commit 45de12f
Show file tree
Hide file tree
Showing 24 changed files with 172 additions and 50 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Let's choose 12 beer bottles out of the 20: $ \binom{20}{12} $

Let's choose 18 cider bottles out of the 50: $ \binom{50}{18} $

$ \binom{20}{12} \cdot \binom{50}{18} $
17 changes: 12 additions & 5 deletions src/content/questions/comp2804/2018-winter-final/10/solution.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
On SundayEveningExam$ (n) $, the line \enquote{I don't like Sunday evening exams} is printed n times
On SundayEveningExam$ (n-1) $, the line \enquote{I don't like Sunday evening exams} is printed n-1 times
On SundayEveningExam$ (n-2) $, the line \enquote{I don't like Sunday evening exams} is printed n-2 times
...
On SundayEveningExam$ (1) $, the line \enquote{I don't like Sunday evening exams} is printed 1 time
On SundayEveningExam$ (n) $, the line \enquote{I don't like Sunday evening exams} is printed n times

On SundayEveningExam$ (n-1) $, the line \enquote{I don't like Sunday evening exams} is printed n-1 times

On SundayEveningExam$ (n-2) $, the line \enquote{I don't like Sunday evening exams} is printed n-2 times

...

On SundayEveningExam$ (1) $, the line \enquote{I don't like Sunday evening exams} is printed 1 time

$ P(n) = n + (n-1) + (n-2) + \text{...} + 1$

Using the 1st Formula given on the Exam Sheet, it translates the above to the following:

$ P(n) = \frac{n(n+1)}{2} $
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
First, we choose which 3 of the 18 rolls are 5: $ \binom{18}{3} $
We also need to calculate the prbability of rolling a 5 exactly 3 times: ${( \frac{1}{6})}^3 $
We also need to calculate the probability of not rolling a 5 exactly 15 times: ${( \frac{5}{6})}^{15} $

We also need to calculate the prbability of rolling a 5 exactly 3 times: ${( \frac{1}{6})}^3 $

We also need to calculate the probability of not rolling a 5 exactly 15 times: ${( \frac{5}{6})}^{15} $

$ \binom{18}{3} \cdot {( \frac{1}{6})}^3 \cdot {( \frac{5}{6})}^{15} $

$ = \binom{18}{3} \cdot ( \frac{1^3}{6^3}) \cdot ( \frac{5^{15}}{6^{15}}) $

$ = \binom{18}{3} \cdot \frac{5^{15}}{6^{18}} $
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
To guarantee that a string is a palindrome in this case, we have to ensure that the first half of the string matches the second half (but reversed).

At each position in the "half of the string", there is a $\frac{1}{3}$ chance that the corresponding character in the other half of the string is the same since there are 3 character options (a, b, c) and only 1 of those can match.

Since the string is an odd integer, half of a string would be: $\frac{n-1}{2}$. So if $n = 3$, then half of the string would be $\frac{3-1}{2} = 1$. This makes sense, as we would check if the 1st and last character are the same, and the 2nd character we know would already be the same as itself.

This means that the total probability a string is a palindrome is: $( \frac{1}{3})^{n-1/2}$
10 changes: 7 additions & 3 deletions src/content/questions/comp2804/2018-winter-final/13/solution.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
$ |A \cap B| = 15 $ <br/>
$ Pr(A \cap B) = \frac{15}{32} $
</ul>
$ Pr(A|B) = \frac{Pr(A \cap B)}{Pr(B)} $
$ Pr(A|B) = \frac{ \frac{15}{32}}{ \frac{1}{2}} $
$ Pr(A|B) = \frac{15}{32} \cdot 2 $

$ Pr(A|B) = \frac{Pr(A \cap B)}{Pr(B)} $

$ Pr(A|B) = \frac{ \frac{15}{32}}{ \frac{1}{2}} $

$ Pr(A|B) = \frac{15}{32} \cdot 2 $

$ Pr(A|B) = \frac{15}{16} $
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
The difference in string $a-b$ is non-zero at each position only if $a_i$ is 1 and $b_i$ is 0 or $a_i$ is 0 and $b_i$ is 1, for all $1 leq i leq 77$

Let $X_i$ be 1 if $a_i$ and $b_i$ are different and 0 otherwise

$ Pr(X_i = 1) = \frac{1}{4} \cdot \frac{3}{4} + \frac{3}{4} \cdot \frac{1}{4} $

$ Pr(X_i = 1) = \frac{3}{16} + \frac{3}{16} $

$ Pr(X_i = 1) = \frac{6}{16} $

$ Pr(X_i = 1) = \frac{3}{8} $

The probability that each element in the string is non-zero is the probability that each element is different

$ \frac{3}{8} \cdot \frac{3}{8} \cdot \text{...} \cdot \frac{3}{8} $

$ = {( \frac{3}{8})}^{77} $
13 changes: 9 additions & 4 deletions src/content/questions/comp2804/2018-winter-final/15/solution.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,13 @@ We'll take a slow and systematic approach to this question
$ |A \cap B| = 1 \cdot 2 = 2 $ <br/>
$ Pr(A \cap B) = \frac{2}{16} = \frac{1}{8} $
</ul>
Now, let's check whether it's independent
$ Pr(A \cap B) = Pr(A) \cdot Pr(B) $
$ \frac{1}{8} = \frac{1}{4} \cdot \frac{1}{4} $
$ \frac{1}{8} = \frac{1}{16} $

Now, let's check whether it's independent

$ Pr(A \cap B) = Pr(A) \cdot Pr(B) $

$ \frac{1}{8} = \frac{1}{4} \cdot \frac{1}{4} $

$ \frac{1}{8} = \frac{1}{16} $

Since the two sides are not equal, the events are not independent
13 changes: 9 additions & 4 deletions src/content/questions/comp2804/2018-winter-final/16/solution.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,13 @@ We'll take a slow and systematic approach to this question
$ |A \cap B| = 1 $ <br/>
$ Pr(A \cap B) = \frac{1}{32} $
</ul>
Now, let's check whether it's independent
$ Pr(A \cap B) = Pr(A) \cdot Pr(B) $
$ \frac{1}{32} = \frac{1}{8} \cdot \frac{13}{16} $
$ \frac{1}{32} = \frac{13}{128} $

Now, let's check whether it's independent

$ Pr(A \cap B) = Pr(A) \cdot Pr(B) $

$ \frac{1}{32} = \frac{1}{8} \cdot \frac{13}{16} $

$ \frac{1}{32} = \frac{13}{128} $

Since the two sides are not equal, the events are not independent
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
Let S be the total number of ways to choose a permutation from a set of size $2n$: $2n!$

For the first element and the last element in the permutation are even integers, we have to choose 2 even numbers. There are two ways to rearrange the 2 even numbers: $\binom{n}{2} \cdot 2$

For the remaining positions in the permutation, we have $(2n-2)!$ ways to rearrange these numbers: $(2n-2)!$.

$Pr(A) = \frac{|A|}{|S|} = \frac{\binom{n}{2} \cdot 2 \cdot (2n-2)!}{2n!} = \frac{ \frac{n!}{2!(n-2)!} \cdot 2 \cdot (2n-2)!}{2n!} = \frac{n(n-1)}{2n(2n-1)} = \frac{n-1}{2(2n-1)}$
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ $ { (0, 0), (0, 1), (1, 0), (1, 1) } $
<li> For $ (1,1) $, the minimum value is 1 <br/>
There is a $ \frac{1}{4} $ chance of this happening
</ul>
$ \mathbb{E}(Z) = 0 \cdot \frac{1}{4} + 0 \cdot \frac{1}{4} + 0 \cdot \frac{1}{4} + 1 \cdot \frac{1}{4} $
$ \mathbb{E}(Z) = 0 + 0 + 0 + \frac{1}{4} $

$ \mathbb{E}(Z) = 0 \cdot \frac{1}{4} + 0 \cdot \frac{1}{4} + 0 \cdot \frac{1}{4} + 1 \cdot \frac{1}{4} $

$ \mathbb{E}(Z) = 0 + 0 + 0 + \frac{1}{4} $

$ \mathbb{E}(Z) = \frac{1}{4} $
13 changes: 11 additions & 2 deletions src/content/questions/comp2804/2018-winter-final/19/solution.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
Let $X_i$ be 1 if $b_i \cdot b_{i+1} = 0$ and 0 otherwise. This only happens if a pair of consecutive bits contain a 0.

$ Pr(X*i = 1) = Pr{(b_i = 0 \text{ and } b*{i+1} = 1)} + Pr{(b*i = 1 \text{ and } b*{i+1} = 0)} + Pr{(b*i = 0 \text{ and } b*{i+1} = 0)} $
$ Pr(X*i = 1) = \frac{1}{2} \cdot \frac{1}{2} + \frac{1}{2} \cdot \frac{1}{2} + \frac{1}{2} \cdot \frac{1}{2} $

$ Pr(X\*i = 1) = \frac{1}{2} \cdot \frac{1}{2} + \frac{1}{2} \cdot \frac{1}{2} + \frac{1}{2} \cdot \frac{1}{2} $

$ Pr(X_i = 1) = \frac{1}{4} + \frac{1}{4} + \frac{1}{4} $

$ Pr(X_i = 1) = \frac{3}{4} $

Since the last bit has no bit after it, we only take into account the first $n-1$ bits

$ \mathbb{E}(X) = \sum*{k=1}^{n-1} 1 \cdot Pr(X*i = 1) $
$ \mathbb{E}(X) = \sum*{k=1}^{n-1} \frac{3}{4} $

$ \mathbb{E}(X) = \sum\*{k=1}^{n-1} \frac{3}{4} $

$ \mathbb{E}(X) = \frac{3}{4} \cdot (n-1) $

$ \mathbb{E}(X) = \frac{3(n-1)}{4} $
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
First, choose 12 cider bottles out of the 50: $ \binom{50}{12} $ <br/>
$ |B \cap C| = \binom{20}{12} \cdot \binom{50}{12} $
</ul>
Now, we can find $ B \cup C $
$ |B \cup C| = |B| + |C| - |B \cap C| $

Now, we can find $ B \cup C $

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

$ |B \cup C| = \binom{20}{12} \cdot 2^{50} + \binom{50}{12} \cdot 2^{20} - \binom{20}{12} \cdot \binom{50}{12} $
12 changes: 10 additions & 2 deletions src/content/questions/comp2804/2018-winter-final/20/solution.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
Let $X_i$ be 1 if $C$ is not at position 1 and 2 if $C$ is at position 1
$ Pr(X*i=1) = Pr(\text{$B_i$ is at position 1}) = \frac{1}{n+1} $

$ Pr(X\*i=1) = Pr(\text{$B_i$ is at position 1}) = \frac{1}{n+1} $

$ Pr(X_i=2) = Pr(\text{$C$ is at position 1}) = \frac{1}{n+1} $

$ \mathbb{E}(X) = \sum*{k=2}^{n+1} 1 \cdot Pr(X*i=1) + 2 \cdot Pr(X_i=2) $
$ \mathbb{E}(X) = \sum*{k=2}^{n+1} 1 \cdot \frac{1}{n+1} + 2 \cdot \frac{1}{n+1} $

$ \mathbb{E}(X) = \sum\*{k=2}^{n+1} 1 \cdot \frac{1}{n+1} + 2 \cdot \frac{1}{n+1} $

$ \mathbb{E}(X) = \sum\_{k=2}^{n+1} \frac{1}{n+1} + \frac{2}{n+1} $

$ \mathbb{E}(X) = (n+1-2) \cdot ( \frac{1}{n+1} + \frac{2}{n+1})$

$ \mathbb{E}(X) = \frac{n+1-2+1+2}{n+1} $

$ \mathbb{E}(X) = \frac{n+2}{n+1} $
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
For $X$ and $Z$ to be independent, $Pr(X = x \cap Z = z) = Pr(X = x) \cdot Pr(Z = z)$, for all real numbers $x$ and $z$, by definition of independent random variables.

If we can find a counterexample, aka where $Pr(X = x \cap Z = z) neq Pr(X = x) \cdot Pr(Z = z)$, then we know the two are not independent.

Let $z = 0$, $x = 0$ and $y = 0$:

<ul>
Expand All @@ -8,11 +10,14 @@ Let $z = 0$, $x = 0$ and $y = 0$:
<li> $Pr(Z = 0) = Pr(X \cdot Y = 0) = Pr(X = 0 \cap Y = 0) + Pr(X = 0 \cap Y = 1) + Pr(X = 1 \cap Y = 0) = ( \frac{1}{2} \cdot \frac{1}{2}) + ( \frac{1}{2} \cdot \frac{1}{2}) + ( \frac{1}{2} \cdot \frac{1}{2}) = \frac{3}{4}$
<li> $Pr(X = 0 \cap Z = 0) = Pr(X = 0 \cap Y = 0) + Pr(X = 0 \cap Y = 1) = \frac{1}{2}$
</ul>

Now we check if LHS = RHS for the expression:

<ul>
<li> $Pr(X = x \cap Z = z) = Pr(X = x) \cdot Pr(Z = z)$
<li> $Pr(X = 0 \cap Z = 0) = Pr(X = 0) \cdot Pr(Z = 0)$
<li> $\frac{1}{2} = \frac{1}{2} \cdot \frac{3}{4}$
<li> $\frac{1}{2} neq \frac{3}{8}$
</ul>

Since LHS is not equal to RHS, then the events $X$ and $Z$ are not independent.
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
In the algorithm, the value of $k$ keeps increasing if the two dice rolls are different. Theoreticaly, this algorithm can go on forever, until the two dice rolls are the same.

This is an example of the Geometric Distribution.

Let $p$ represent the probability of not ending the recursive algorithm. Using the formula for the expected value for Geometric Distribution we get:

$E(X) = \frac{1}{p} = \frac{1}{ \frac{5}{6}} = \frac{6}{5}$
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
To prove that this statement is false, we need to provide a counterexample:

Let X, Y, Z all represent the random variables where $X, Y, Z = 1$ if a coin toss is heads and $X, Y, Z = 0$ if a coin toss is tails.

The expected value of $X, Y, Z$ in this case (as\suming that $\frac{1}{2}$ chance of hitting heads or tails) is: $E(X) = E(Y) = E(Z) = 0 \cdot \frac{1}{2} + 1 \cdot \frac{1}{2} = \frac{1}{2}$.

This means that the $min(E(X), E(Y), E(Z) = min( \frac{1}{2}, \frac{1}{2}, \frac{1}{2}) = \frac{1}{2}$ is $\frac{1}{2}$.

For the LHS, we need to calculate the expected value for $min(X, Y, Z)$. There are only two possible values in this case: $min(X, Y, Z) = 0$ and $min(X, Y, Z) = 1$

<ul>
<li> Pr(min(X, Y, Z) = 1) = every coin has to come up with a heads = $( \frac{1}{2})^{3} = \frac{1}{8}$
<li> Pr(min(X, Y, Z) = 0) = 1 - Pr(min(X, Y, Z) = 1) = $1 - \frac{1}{8} = \frac{7}{8}$
<li> $E(min(X, Y, Z)) = 0 \cdot Pr(min(X, Y, Z) = 0) + 1 \cdot Pr(min(X, Y, Z) = 1) = 0 \cdot \frac{7}{8} + 1 \cdot ( \frac{1}{8}) = \frac{1}{8}$.
</ul>

Since $E(min(X, Y, Z)) = \frac{1}{8}$ and $min(E(X), E(Y), E(Z)) = \frac{1}{2}$, the two are not the same, so the statement is false.
39 changes: 28 additions & 11 deletions src/content/questions/comp2804/2018-winter-final/24/solution.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,41 @@
Let S be the set of all possibilities = $ |S| = 8^{3} $

Let A be the set of all possibilities where a student gets exactly 2 ciders

To get exactly 2 ciders, a student has to have 2 ciders and 1 beer. There are 3 ways to get 2 ciders and a beer: $CBC, BCC, CCB$.

<ul>
<li> Number of ways for combination $CBC$: $\binom{5}{1} \cdot \binom{3}{1} \cdot \binom{5}{1} = 5^2 \cdot 3$
<li> Number of ways for combination $BCC$: $\binom{3}{1} \cdot \binom{5}{1} \cdot \binom{5}{1} = 5^2 \cdot 3$
<li> Number of ways for combination $CCB$: $\binom{5}{1} \cdot \binom{5}{1} \cdot \binom{3}{1} = 5^2 \cdot 3$
</ul>
Now, we can sum
$ Pr(A) = Pr( CBC ) + Pr( BCC ) + Pr( CCB ) $
$ Pr(A) = (5^2 \cdot 3) + (5^2 \cdot 3) + (5^2 \cdot 3) $
$ Pr(A) = 3 \cdot \frac{5^2 \cdot 3}{8^3} $
$ Pr(A) = \frac{3^2 \cdot 5^2}{8^3}$

Now, we can sum

$ Pr(A) = Pr( CBC ) + Pr( BCC ) + Pr( CCB ) $

$ Pr(A) = (5^2 \cdot 3) + (5^2 \cdot 3) + (5^2 \cdot 3) $

$ Pr(A) = 3 \cdot \frac{5^2 \cdot 3}{8^3} $

$ Pr(A) = \frac{3^2 \cdot 5^2}{8^3}$

Let $X_i$ be an indicator random variable where:

$ 1 \text{ if a student gets exactly 2 ciders} $

$ 0 \text{ otherwise} $
$ Pr(X*i = 1) = Pr(A) = \frac{3^2 \cdot 5^2}{8^3}$
$ \mathbb{E}(X) = \sum*{k=1}^{16} 1 \cdot Pr(X*i = 1) $
$ \mathbb{E}(X) = \sum*{k=1}^{16} \frac{3^2 \cdot 5^2}{8^3} $
$ \mathbb{E}(X) = 16 \cdot \frac{3^2 \cdot 5^2}{8^3} $
$ \mathbb{E}(X) = 2^4 \cdot \frac{3^2 \cdot 5^2}{8^3} $
$ \mathbb{E}(X) = \frac{2^4 \cdot 3^2 \cdot 5^2}{8^3} $

$ Pr(X\*i = 1) = Pr(A) = \frac{3^2 \cdot 5^2}{8^3}$

$ \mathbb{E}(X) = \sum*{k=1}^{16} 1 \cdot Pr(X*i = 1) $

$ \mathbb{E}(X) = \sum\*{k=1}^{16} \frac{3^2 \cdot 5^2}{8^3} $

$ \mathbb{E}(X) = 16 \cdot \frac{3^2 \cdot 5^2}{8^3} $

$ \mathbb{E}(X) = 2^4 \cdot \frac{3^2 \cdot 5^2}{8^3} $

$ \mathbb{E}(X) = \frac{2^4 \cdot 3^2 \cdot 5^2}{8^3} $

$ \mathbb{E}(X) = 2^4 \cdot 3^2 \cdot \frac{5^2}{8^3} $
13 changes: 9 additions & 4 deletions src/content/questions/comp2804/2018-winter-final/3/solution.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@
We need to take into account all subsets of cider bottles that we add to the 2 beer bottles: $ 2^{50} $ <br/>
$ |C| = \binom{20}{2} \cdot 2^{50} $
</ul>
Since the question is asking for all possibilities excluding 0, 1, and 2 beer bottles, we can find the total number of possibilities by subtracting the number of possibilities that contain 0, 1, and 2 beer bottles from the total number of possibilities
Let D be the set of all bottles that contain at least 3 beer bottles
$ |D| = 2^{70} - |A| - |B| - |C| $
$ |D| = 2^{70} - \binom{20}{0} \cdot 2^{50} - \binom{20}{1} \cdot 2^{50} - \binom{20}{2} \cdot 2^{50} $

Since the question is asking for all possibilities excluding 0, 1, and 2 beer bottles, we can find the total number of possibilities by subtracting the number of possibilities that contain 0, 1, and 2 beer bottles from the total number of possibilities

Let D be the set of all bottles that contain at least 3 beer bottles

$ |D| = 2^{70} - |A| - |B| - |C| $

$ |D| = 2^{70} - \binom{20}{0} \cdot 2^{50} - \binom{20}{1} \cdot 2^{50} - \binom{20}{2} \cdot 2^{50} $

$ |D| = 2^{70} - 2^{50} - 20 \cdot 2^{50} - \binom{20}{2} \cdot 2^{50} $
10 changes: 7 additions & 3 deletions src/content/questions/comp2804/2018-winter-final/4/solution.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
We need to choose 5 positions out of the remaining 35 for the $c$'s: $ \binom{35}{5} $ <br/>
Then for the remaining characters in the strings, they can be either $b$ or $d$ = $ 2^{30} $
</ul>
Now, we can find $ A \cup B $
$ |A \cup B| = |A| + |B| - |A \cap B| $
$ |A \cup B| = \binom{40}{5} \cdot 3^{35} + \binom{40}{5} \cdot 3^{35} - \binom{40}{5} \cdot \binom{35}{5} \cdot 2^{30} $

Now, we can find $ A \cup B $

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

$ |A \cup B| = \binom{40}{5} \cdot 3^{35} + \binom{40}{5} \cdot 3^{35} - \binom{40}{5} \cdot \binom{35}{5} \cdot 2^{30} $

$ |A \cup B| = 2 \cdot \binom{40}{5} \cdot 3^{35} - \binom{40}{5} \cdot \binom{35}{5} \cdot 2^{30} $
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
The answer is C, and I will show how the expression in the question shows the number of ways to choose a 2-element subset from a set consisting of m + n elements:

From a set of $m + n$ elements, we can form 2-element subsets in 3 different ways:

<ul>
<li> Choose 2 elements from the $m$ set: there are $\binom{m}{2}$ ways to do this
<li> Choose 2 elements from the $n$ set: there are $\binom{n}{2}$ ways to do this
<li> Choose 1 element from the $m$ set and 1 element from the $n$ set: there are $\binom{m}{1} \cdot \binom{n}{1} = m \cdot n$
</ul>

Now, if we apply the Sum Rule to all of these cases above, we get $\binom{m}{2} + \binom{n}{2} + m \cdot n$, which matches the expression above.
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
We can rephrase this into something more familiar. Let $x_1, x_2, x_3, x_4, x_5, x_6, x_7$ be the number of bananas Nick eats on each day.

$ x_1 + x_2 + x_3 + x_4 + x_5 + x_6 + x_7 = 25 $

This is one of the divider questions

Assume we have 25 bananas and 6 dividers. We place the dividers between any set of bananas to indicate how many are eaten between dividers

<ul>
Expand All @@ -12,5 +15,7 @@ Assume we have 25 bananas and 6 dividers. We place the dividers between any set
<li> $x_6$ is represented as the number of bananas eaten between the fifth and sixth divider
<li> $x_7$ is represented as the number of bananas eaten to the right of the sixth divider
</ul>
Since we place dividers down, we need to add 6 dividers to the 25 bananas

Since we place dividers down, we need to add 6 dividers to the 25 bananas

We choose 6 positions out of the 31 for the dividers: $ \binom{31}{6} $
10 changes: 7 additions & 3 deletions src/content/questions/comp2804/2018-winter-final/7/solution.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
Then we choose 1 of the remaining 1 positions to place the $OO$: $ \binom{1}{1} = 1 $ <br/>
$ |\overline{A}| = 5 \cdot 4 \cdot 3 \cdot 2 \cdot 1 = 5! $
</ul>
Now, we can find the number of awesome strings
$|A| = |S| - |\overline{A}| $
$|A| = (6 \cdot \binom{5}{2} \cdot 3 \cdot 2 \cdot 1) - 5!$

Now, we can find the number of awesome strings

$|A| = |S| - |\overline{A}| $

$|A| = (6 \cdot \binom{5}{2} \cdot 3 \cdot 2 \cdot 1) - 5!$

$|A| = (6 \cdot \binom{5}{2} \cdot 3 \cdot 2) - 5!$
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
The first character can be any of the 4 characters: 4

The second character can be any of the 3 characters that are not the first character: 3

The third character can be any of the 3 characters that are not the second character: 3

...

The nth character can be any of the 3 characters that are not the $(n-1)$th character: 3

$= 4 \cdot 3^{n-1} $
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@ Let's write out the possibilities and sum them:
<li> $ 0, S*{n-1} $
<li> $ 1, 0, S_{n-2} $
</ul>
Although this takes into account many possibilities, it does not take into a bitstring that is made of all 1's: 1
$ S*n = S*{n-1} + S_{n-2} + 1 $

Although this takes into account many possibilities, it does not take into a bitstring that is made of all 1's: 1

$ S*n = S*{n-1} + S\_{n-2} + 1 $

0 comments on commit 45de12f

Please sign in to comment.