Hello

I have a 'simple' problem but having trouble working out a formula.

For example with 5 tosses & 3 Heads & 2 tails occurring, there are 5!/(3!(5-3)!) = 10 combinations.

But how many of these combinations can exist for only more or equal heads tallying to occur before the tails tally occurs.

For example

HTHTH

HTHHT

HHTTH

HHTHT

HHHTT

are all ok as the tally for H's were equal or more than the T's but

THTHH

THHTH

THHHT

TTHHH

HTTHH

is not as the tally of T's occured before H's did.

Basically if H= + 1 and T = -1 and you summed up the sequences it cannot be <0 at ANY point in the summing up.

So I need to work out the no. of outcomes from C combos of getting more heads accumulated before tails: given N no of tosses and X no of heads.

Any help in the right direction would be great.

Thanks

Max