You use Bayes Theorem to find the answer. Let's split problem into two parts:
1) What is the probability you picked the double-headed coin (now referred as D)?
2) What is the probability of getting a head on the next toss?
Question 2 follows very naturally after question 1, so let's tackle question 1.
We are trying to find the probability of having a double-headed coin. We know that the same coin has been flipped 10 times, and we've gotten 10 heads (intuitively, you're probably thinking that there is a significant chance we have the double-headed coin). Formally, we're trying to find P(D | 10 heads).
Using Bayes rule:
P(10 H | D) * P(D)
P(D | 10 H) = ---------------------------
P(10H)
Tackling the numerator, the prior probability, P(D) = 1/1000. If we used the double headed coin, the chance of getting 10 heads, P(10 H | D) = 1 (we always flip heads). So the numerator = 1 / 1000 * 1 = 1 / 1000.
The denominator, P(10H) is just P(10 H | D) * P(D) + P(10 H | Fair) * P(Fair). This makes sense because we are simply enumerating over the two possible coins. The first part of P(10H) is the exact same as the numerator (1 / 1000). Then the second part: P(Fair) = 999/1000. P(10 H | Fair) = (1/2) ^ 10 = 1/1024. Thus P(10 H | Fair) * P(Fair) = .0009756. The denominator then equals .001 + .0009756.
Since we have all the components of P(D | 10 H), compute and you'll find the the probability of having a double headed coin is .506. We have finished the first question.
The second question is then easily answered: we just compute the two individual possibilities and add.
P(H) = P(D) * P(H | D) + P(Fair) * P(H | Fair) = .506 * 1 + (1 - .506) * (.5) = .753.
So there is a 75.3% chance you will flip a heads.
Source:-Quora