Question: Help me write code

How can I write code for : A coin is tossed 4x, the sequence of H and T is observed. I need to list each of the 16 sequences (which, when done manually are :

S= {hhhh,hhht,hhth,hthh,thhh,hhtt,htht,thth,tthh,thht,htth,ttth,ttht,thtt,httt,tttt}

b) Let events A,B,C,D be given A= {at least 3 heads}, B= {at most 2 heads}, C= {heads on the third toss}, D= {1 head and 3 tails}. If the probability set function assigns 1/16 to each outcome in the sample space find  A=.3125, B=11/16 or .6825, C=8/16 or .50, D=4/16 or .25


I did this manually, be the prof wants in done in Maple, and I dont know how to write the code up. Thanks for any help!

Please Wait...