javascript - Algorithm for consecutive n-head -
i have tackle statistics problem current project: given series of coin flips, calculate percentage of consecutive n-heads runs. data bellow, 1 head , 0 tail. found this reference probability of n-heads , have no clue of how apply deride algorithm (javascript prefered). appreciate hints. thanks!
flips = [1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0. 0];
edit:
the coin not fair coin next outcome of flip based on history. example, don't see 3-tails run (3 zeroes in row) in history chance of next outcome 0%.
so, interpretation of percentage of consecutive n-heads runs probability of outcome of next flip. :)
Comments
Post a Comment