(1) (i) A bag contains one trick coin that always shows heads when flipped, and nine fair coins (that show heads with probability 1/2 and tails with probability 1/2 when flipped). A coin is selected uniformly at random from the bag and flipped four times. What is the probability that the coin selected was the trick coin, given that it shows heads all four times?
My answer for this question is 16/25 (not sure correct or not)
(ii) A bag contains n coins, one of which is a trick coin and the rest of which are fair (the coins are as described in (i)). A coin is selected uniformly at random from the bag and flipped k times. The coin shows heads all k times and, given this, you calculate that there is an exactly 50% probability that the coin selected was the trick coin. What is n? (Write your answer as an expression in terms of k.) [Fully explain your answer for (i). Answer only required for (ii).]
For (ii), can someone help, not able to solve this problem, have been trying for multiple times.
As Jxb and others commented, we have the probability you picked the trick coin and lands on heads k times is $\frac 1 n$ and the probability you picked one of the fair coins and lands on heads k times is $\frac {n-1} n \cdot ({\frac 1 2})^k$. So we need to solve this following equation: $\frac {\frac {1} {n}} {\frac {n-1} n \cdot ({\frac 1 2})^k+\frac {1} {n}}=\frac 1 2$ which is equivalent to $n=2^k+1$