## Suggested Solution to Question 24 and 25 of the Fermat Math Contest 2018

Posted: March 20, 2018 in Mathematics

Q24.

Denote $G_i, R_i, B_i, Y_i$ as the i-th bucket that contains the puck.

If all 4 pucks are distributed into the same Green bucket, then we don’t need to worry about the Red, Blue, and Yellow buckets since they won’t have 4 pucks in them. So,

$\displaystyle P(G_a, G_a, G_a, G_a) = 3 \left(\frac13\right)^4 = \frac{1}{27}$

Now, 3 pucks are distributed into the same Green bucket, then we only need to exclude the case where 3 pucks are put into the same Red bucket. There are 4 ways to permute aaab and 3 numbers to pick for a and b which is 6 ways, so

$\displaystyle P(G_a, G_a, G_a, G_b) \cdot (1 - P(R_a, R_a, R_a)) = 4 \cdot 6 \cdot \left(\frac13\right)^4 \cdot \left(1-3 \left(\frac13\right)^3\right) = \frac{64}{243}$

If 2 pucks are distributed into the same Green bucket, then we only need to consider the case where all 3 pucks are distributed evenly into three different Red buckets and all 2 pucks are distributed evenly into two different Blue buckets. The most difficult part of the problem is in this case here. We need to find the number of ways to permute n repeated objects, aabc, which is $\dfrac{4!}{2!1!1!}$, and since the permutation of b and c has already counted, we need to only consider how many numbers go into the choice of a which is 3.

$\displaystyle P(G_a, G_a, G_b, G_c) \cdot P(R_a, R_b, R_c) \cdot P(B_a, B_b) \\ = \frac{4!}{2!1!1!}\cdot 3 \cdot \left(\frac13\right)^4 \cdot 3!\left(\frac13\right)^3 \cdot (3P2) \left(\frac13\right)^2 \\ = \frac{4}{9}\cdot\frac{2}{9}\cdot\frac{2}{3} = \frac{16}{243}$

Final step, add the three results and we get

$\displaystyle \frac{1}{27} + \frac{64}{243} + \frac{16}{243} = \frac{89}{243}$

Q25.

For $1 \leq k \leq 2018$ and $P, Q, R \in \{1,2,\ldots,9\}$

$P_{2k} - Q_k = (R_k)^2$

When k = 1,

$11P - Q = R^2$. The 8 quadruples are easy to find, they are

$(1,7,2,1), (1,2,3,1), (2,6,4,1), (3,8,5,1), (4,8,6,1), (5,6,7,1), (6,2,8,1), (8,7,9,1)$

When k = 2,

$1111P - 11Q = 11^2R^2 \Rightarrow 101P - Q = 11R^2$

When k = 3,

$111111P - 111Q = 111^2R^2 \Rightarrow 1001P - Q = 111R^2$

$\therefore (10^k+1)P-Q=\dfrac{10^k-1}{10-1}\cdot R^2 \Rightarrow (10^k+1)P-Q=\dfrac{10^k-1}{9} \cdot R^2$

or

$P-Q \equiv 11R^2 \pmod{100} \text{ for } k \geq 2$

$\underline{\quad R \qquad R^2 \qquad 11R^2 \qquad 11R^2 \mod{100} \quad} \\ \text{ } \quad 1 \qquad 1 \quad \qquad 11 \qquad\qquad\qquad 11 \\ \text{ } \quad 2 \qquad 4 \quad \qquad 44 \qquad\qquad\qquad 44 \\ \text{ } \quad 3 \qquad 9 \quad \qquad 99 \qquad\qquad\qquad 99 \equiv -1 \\ \text{ } \quad 4 \qquad 16 \quad \quad 176 \qquad\qquad\qquad 76 \\ \text{ } \quad 5 \qquad 25 \quad \quad 275 \qquad\qquad\qquad 75 \\ \text{ } \quad 6 \qquad 36 \quad \quad 396 \qquad\qquad\qquad 96 \equiv -4 \\ \text{ } \quad 7 \qquad 49 \quad \quad 539 \qquad\qquad\qquad 39 \\ \text{ } \quad 8 \qquad 64 \quad \quad 704 \qquad\qquad\qquad 4 \\ \text{ } \quad 9 \qquad 81 \quad \quad 891 \qquad\qquad\qquad 91$

Therefore, R can only be 3, 6, or 8.

When R = 3,

$(10^k + 1)P - Q = 10^k - 1$

$10^k P + P - Q = 10^k - 1$

$\text{Since } P - Q \equiv -1 \mod{100}$

$10^k P - 1 = 10^k - 1$

$\Rightarrow P = 1, Q = 2 \quad \therefore (1,2,3,k) \text{ for } 1 < k \leq 2018$

When R = 6,

$(10^k + 1)P - Q = \dfrac{10^k-1}{9} \cdot 36$

$10^k P - 4 = 4\cdot 10^k - 4$

$\Rightarrow P = 4, Q = 8 \quad \therefore (4,8,6,k) \text{ for } 1 < k \leq 2018$

When R = 8,

$(10^k + 1)P - Q =\dfrac{10k-1}{9} \cdot 64$

$9(10^k P + 4) = 64 \cdot 10^k - 64$

$9 \cdot 10^k P + 36 = 64 \cdot 10^k - 64$

$100 = (64 - 9P) 10^k$

Now, obviously $k > 2$ has no solution.

If k = 2,

$1 = 64 -9P$

$\Rightarrow P = 7, Q = 3$

$\therefore (7,3,8,2)$ is a solution.

In conclusion, N = 8 + 2017 + 2017 + 1 = 4043.

Therefore the sum of digits of N is 11.

## Expressing Pi in an interesting way

Posted: March 18, 2018 in Mathematics

What is $\pi$? $\pi$ is a constant. It is a ratio of the circumference to the diameter of a circle. It’s value is approximately 3.14 or 3.14159 if one cares about accuracy, however 3.14159 is only correct to 6 significant figures. If you pull out your everyday scientific calculator and press the $\pi$ button, it will show 3.141592654 on the display. Although this value is good to 10 significant figures, it still contains an error. I know it has error because I have $\pi$ memorized to 3.14159265358979323846… You may wonder why I memorize $\pi$ to 21 digits? It could be the password to one of my dozen email addresses. You can try hacking my email with it 🙂

No matter how many digits of $\pi$ you write down on a piece of paper, it is still just an approximation. The tail of $\pi$ never terminates. It is an irrational number. Most mathematicians don’t really like approximation, so you rarely see one write 3.14 as $\pi$. It’s just not correct and not cool to write $\pi = 3.14$ (other than PIE=314). So today I am gonna show you a cool way to write $\pi$.

$\pi = \left(\left(-.5\right)!\right)^2 \quad \text{ or } \quad \pi = \Gamma^2(\frac12)$

The symbol “!” means factorial. By definition,

$n! = n(n-1)(n-2)\cdots 2 \cdot 1$ for all positive integers n. So

$1! =1$,

$2! = 2\cdot 1 = 2$,

$3! =3\cdot2\cdot1 = 6$

and so on.

What about $(-0.5)!$? The above definition didn’t include non-positive integer factorial. So we need to find a way to extend the factorials to a larger set of number that includes decimal numbers. One way to do it is by using Gamma function.

$\displaystyle \Gamma(s) = \int_0^\infty t^{s-1} e^{-t} \text{ d}t$

First of all, we need to verify that this Gamma function indeed satisfies

$f(1)=1 \text{ and } f(n+1) = nf(n)$

$\displaystyle \Gamma(1) = \int_0^\infty e^{-t} \text{ d}t = -e^{-t}\bigg|_0^\infty = 1$

and by using integration by parts, we get

$\displaystyle \Gamma(s+1) = \int_0^\infty t^s e^{-t} \text{ d}t = -t^s e^{-t}\bigg|_0^\infty + s\int_0^\infty t^{s-1} e^{-t} \text{ d}t = s\Gamma(s)$

And therefore the Gamma function does indeed extend the factorials to the real numbers, and in fact also the complex numbers as well.

$\Gamma(1) = 1$

$\Gamma(2) = 1\cdot\Gamma(1) = 1$

$\Gamma(3) = 2\cdot\Gamma(2) = 2\cdot 1$

$\Gamma(4) = 3\cdot\Gamma(3) = 3\cdot 2 \cdot 1$

Hence, we see that

$n! = \Gamma(n+1)$

Now, let’s compute $\Gamma\left(\frac12\right)$.

By using substitution of $w=\sqrt{t}$, we get

$\displaystyle\Gamma\left(\frac12\right) = \int_0^\infty \frac{e^{-t}}{\sqrt{t}} \text{ d}t = 2\int_0^\infty e^{-w^2} \text{ d}w$

Now let $\displaystyle I=\int_0^\infty e^{-w^2} \text{ d}w$,

$\displaystyle I^2 = \int_0^\infty e^{-x^2}\text{ d}x \int_0^\infty e^{-y^2}\text{ d}y =\int_0^\infty \int_0^\infty e^{-(x^2+y^2)} \text{ d}x\text{ d}y$

then by using polar coordinates,

$\displaystyle I^2=\int_0^{\pi/2} \int_0^\infty e^{-r^2} r\text{ d}r\text{ d}\theta = \frac{\pi}{2} \int_0^\infty re^{-r^2} \text{ d}r$

By substituting $u =r^2$ we get

$\displaystyle I^2 = \frac{\pi}{4} \int_0^\infty e^{-u} \text{ d}u = \frac{\pi}{4}(-e^{-u})\bigg|_0^\infty = \frac{\pi}{4}$

$\therefore I = \dfrac{\sqrt\pi}{2}$

Therefore,

$\displaystyle \Gamma\left(\frac12\right) = \sqrt\pi$

or

$\pi = \Gamma^2\left(\dfrac12\right)$

or

$\pi = \left(\left(-\dfrac12\right)!\right)^2$

if you accept the factorial notation 🙂

## How to Draw a Parallelogram with One Ruler

Posted: March 8, 2018 in Mathematics

Usually in school, you learn how to construct a parallelogram with compass and straightedge. But today, I am gonna show you how to construct a parallelogram with only one ruler. Of course, you need a piece of paper, a pencil, a hand, and your brain as well, etc …

Actually the method is very simple, even an eight year old can do it I promise. So here it is:

1. Draw a quadrilateral (4-sided shape), any quadrilateral will do even the non-convex one.
2. Find the midpoint of all four sides with your ruler.
3. Connect those four midpoints together and you are done.

Here are some examples.

The proof is very simple.

Let the four points $A(a_1, a_2)$$B(b_1, b_2)$$C(c_1, c_2)$$D(d_1, d_2)$ be the vertices of a quadrilateral.

Then the four midpoints are

$\displaystyle P\left(\frac{a_1+b_1}{2}, \frac{a_2+b_2}{2}\right), Q\left(\frac{b_1+c_1}{2}, \frac{b_2+c_2}{2}\right), R\left(\frac{c_1+d_1}{2}, \frac{c_2+d_2}{2}\right), S\left(\frac{d_1+a_1}{2}, \frac{d_2+a_2}{2}\right)$

Find the slopes of the sides and show that the opposite sides are parallel:

$m_{PQ} = \dfrac{c_2-a_2}{c_1-a_1} = m_{RS} \Rightarrow PQ \;//\; RS$

$m_{QR} = \dfrac{d_2-b_2}{d_1-b_1} = m_{SP} \Rightarrow QR \;//\; SP$

Therefore PQRS is a parallelogram.