111
flip coins 6 times. Find the probability with two heads up.
P(HHTTTT)=(1/2)^6
there are C(6,2)=C(6,4) ways to arrange two H's and four T's.
so the final probability =C(6,2)*(1/2)^6=15/64
If only two heads up, consecutively,
P=C(5,1)*(1/2)^6=5/64
If two consecutive heads up, with possible 3 H's, 4 H's, 5 H's, 6 H's, we can use complementary counting to get
P=1-P(TTTTTT)-C(6,1)*P(HTTTTT)-[C(6,2)-C(5.1)]*P(HHTTTT)-P(HTHTHT)-P(THTHTH)-P(HTTHTH)-P(HTHTTH)
1-(1+6+10+1+1+1+1)/64=1-21/64=43/64