Probability of first head unaffected by probability of head? I am looking at this coin sample problem here.
A defective coin minting machine produces coins whose probability of Heads is a random variable Q with PDF:
$$f_Q(q) = 3q^2, q \in [0,1]$$
A coin produced by this machine is tossed repeatedly, with successive tosses assumed to be independent. Let A be the event that the first toss of this coin results in Heads, and let B be the event that the second toss of this coin results in Heads.
The probability P(A) is the expected value of tossing Heads:
$$E[Q] = \int_0^1 3q^2\times q~dq = 0.75$$
What surprises me is that I assume this is a geometric distribution, and thus:
$$P(A) = p(1) = q$$
with $q$ unknown.  The solution above seems to suggest that P(A) is 0.75 regardless of the value of $q$.  How can I reconcile these differences?  By extension, how do I calculate $P(n)$ regardless of the outcome of the first $n-1$ tosses?
---------------------------------------------------------------------------------
From all the answers:
Apparently, the continuous version of the Total Probability Theorem was used.  Makes all the sense.  Thank you, everyone!
 A: The point is that $q$ is itself a random variable whose value you are not given.
Basically, the question is: If I let the machine produce a coin and then throw it once, what is the probability of getting head?
The value $q$ doesn't enter the probability for the exact same reason why whether the coin landed on head or tail doesn't enter the probability.
Now you may ask, what if I produced the coin, but didn't yet toss it? Well, assuming you didn't examine it in another way (say, measuring its mass distribution), you have exactly the same knowledge about the value of $q$ as you had before activating the machine. Therefore also the probability is the same.
Now if you gain some information about $q$, that of course will change the probability. In particular, if you find by examining the coin that it has the head probability $q=q_0$, then of course the probability of getting head on the first toss is exactly $q_0$. But that is not the situation we have here.
To make the situation clearer, maybe the following model helps: Instead of the machine producing a coin, the machine already has a large collection of coins. It has coins that always give heads, it has coins that always give tails, it has fair coins, it has coins that are biased slightly for head, and so on. The numbers of those coins are so that you get (approximately) the given distribution for $q$.
When you press the button, you get a random coin from that selection. Whether you get head now depends on two things: Which coin was selected, and which side that coin was falling on.
Let's consider a simpler situation: The machine has only two coins, which it dispenses with equal probability. One of the coins produces only heads (that is, $q=1$), while the other one produces only tails ($q=0$). Obviously the result of the first toss in this case depends totally on which coin the machine has chosen; since we assumed that both choices have the same probability, you get as probability of getting heads $1/2$ (because that's the probability that the heads-only coin is dispensed). Note that neither of the coins has $q=1/2$, that value is completely determined by the selection process.
Now let's replace the tails-only coin with a fair coin. Now what is the probability of getting head?
Well, in half of the cases we get the heads-only coin, which of course gives heads. In the other half of cases we get a fair coin, and in half of those cases, we again get head, otherwise we get tail. Thus the probability of getting head is now $\frac12\cdot 1 + \frac12\cdot\frac12 = \frac34$.
Note again that this is a value, not a function of $q$. And there's also no variable $q$ in it. That doesn't mean the $q$ does not enter the calculation; it enters as factor in each term. But not just the $q$ of the coin that gets dispensed, but the $q_i$ of all coins.
More generally, if there are $n$ coins where coin $i$ is dispensed with probability $p_i$ and, when tossed, produces heads with probability $q_i$, then the total probability of getting heads is
$$P = \sum_{i=1}^n p_i q_i.$$
ote that again, all the $q_i$ enter the right side, and $P$ does not depend on the specific $q$ of the coin dispensed.
Of course it doesn't matter if the machine already has a pool of those coins, or produces them on the spot.
So all that remains is to make that continuous. Since all the $q_i$ are different, we can just use $q$ itself to identify which coin we produced. The continuous equivalent of the probabilities $p_i$ is the PDF $f(q)$, and thesum has to be replaced by an integral. So we get:
$$P = \int_0^1  f(q)q \,\mathrm dq$$
Now you are given $f(q)=3q^2$. Inserting in the formula above gives the result.
A: Note that $$P(A| Q=q)=q.$$ Thus
$$P(A) = EP(A| Q) =\int_0^1 q\cdot 3q^2 dq= 3/4. $$
