I have some problem with your question,
its better you give the numbers assure you to get correct result.
for example its better you give the p(head)=x/n x=0..n then you can design better algorithms for getting exact results
I think the method Dave mentioned is very excellent but be careful maybe all
the results turn out only 'H' or 'T'.
--------------------------------------------
Mehdi.:)
|