Question: I'm having trouble understanding the answers to the below questions. I have provided my own attempts at the solutions below the[![enter image description here](https://i.stack.imgur.com/zv6Z0.png)](https://i.stack.imgur.com/zv6Z0.png)

[![enter image description here](https://i.stack.imgur.com/871DG.png)](https://i.stack.imgur.com/871DG.png)

i) I set up the problem like $0.5^x \geq 0.9$ because it reads, "the probability of heads appearing $x$ times is at least $0.9$. I'm not sure why the book wrote the problem the other way around?

ii) Like the i) the book takes the complement for some reason

iii) Same confusion as i) and ii)

Thanks for any clarification.

EDIT: 

The answers below have started helping me understand this problem. However, I have a question on how the math actually works out.

i. $(1 - 0.5)^x \geq 0.9$ is that how to set the problem up?

Answer: 
$$(p-1)(p+1)=2q^2$$

Notice $p= 2$ is not a solution, and thus the left side are two even numbers, thus $q$ has to be even, not a prime if it is larger than 2
Consider the equation modulo 3. You can check that any number squared mod 3 is either 0 or 1, and in particular if $n$ is a prime not equal to 3, then $n^2$ is 1. Say $(p, q)$ solves the equation, where $p$ and $q$ are prime. If $q$ is not equal to $3$, then $2q^2+1 = 0$ (mod 3), so $p$ must be 3. So, either $p$ or $q$ is $3$, and you can check $q=3$ doesn't work clearly, so $(3,2)$ is the only solution.