This tries to see what the highest ammount of times you can flip and get heads/tails out of 100, it tries 100 times
set ammount to 100
set headcountmax to 0
set tailcountmax to 0
set headcountmin to ammount
set tailcountmin to ammount
repeat 100 times
set headcount to 0
set tailcount to 0
repeat ammount times
set Flip to some item of {"Heads", "Tails"}
if Flip = "Heads" then
set headcount to headcount + 1
else
set tailcount to tailcount + 1
end if
if headcount > headcountmax then
set headcountmax to headcount
end if
if tailcount > tailcountmax then
set tailcountmax to tailcount
end if
end repeat
end repeat
set InTheEnd to "Heads High: " & headcountmax & "
Tail High: " & tailcountmax