Flip $n$ coins on a circle. Assume a coin has been chosen from among those whose neighbors are both heads. What's the probability it is heads? This is a generalization of the problem below (first appeared here)
I am particularly curious to know if there is a closed-form formula to calculate the probability for any $n$ and any probability of heads $p$. 
note: One doesn't need to calculate the probability to show that it is not 50-50.  If $n=3$, the exact probability can be calculated with few computational steps. For larger $n$, relatively simple algorithms can be used to calculate the probability; some are more efficient than others.

 A: The teacher is incorrect.
It turns out that there are $220$ cases (out of $2^{10}=1024$) where only one student steps forward because both neighbours flipped heads, and in $60$ of those cases the student stepping forwards also flipped heads. So the probability is $\frac3{11}\approx 27.3\%$
The reason that heads is biased against is that if that student flipped heads then neither of the people two away can also have flipped heads, as otherwise somebody else would also have stepped forward.   
To illustrate the point, consider when only the third student steps forward (the second and fourth students must have flipped heads and the sixth and tenth must have flipped tails). In the following $6$ cases the third student could have flipped heads
. v . 
THHHTTTTTT
THHHTTHTTT
THHHTTTHTT
THHHTTHHTT
THHHTTTTHT
THHHTTTHHT
. ^ .

and in the similar $6$ cases the third student could have flipped tails
. v .
THTHTTTTTT
THTHTTHTTT
THTHTTTHTT
THTHTTHHTT
THTHTTTTHT
THTHTTTHHT
. ^ .

though in all those cases the first and fifth students flipped tails.  But there are another $10$ cases where the first or fifth flipped heads so the third must have flipped tails, and this demonstrates the bias
. v .
THTHHTTTTT
THTHHTTHTT
THTHHTTTHT
THTHHTTHHT
HHTHTTTTTT
HHTHTTHTTT
HHTHTTTHTT
HHTHTTHHTT
HHTHHTTTTT
HHTHHTTHTT
. ^ .


Added The answer above deals with the case where only one student has two neighbours both with heads and so the answer is conditional on that position.  Others have suggested that the question is different and that if there is more than one student with suitable neighbours then one of those steps forward, presumably randomly from those.  Similar 
In that case (now conditioned on there being at least one pair of suitable neighbours) there is still a bias towards tails for the student stepping forward.  The calculations are now
Suitable     Number of   Probability heads  
neighbours     cases      if step forward
 0              121               -
 1              220              3/11
 2              210              8/21
 3              210             25/63
 4              125             29/50
 5               72              5/9
 6               45             19/27
 7               10              5/7
 8               10              7/8
 9                0               - 
10                1              1/1

A weighted average (ignoring $0$ or $9$ suitable pairs of neighbours as nobody will step forward) gives an overall probability that the student stepping forward has heads of $\frac{10763}{25284} \approx 42.6\%$, so the teacher is still wrong.  
