This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Dealer repeatedly flips a coin. Sometimes the coin is fair, with P(heads) = 0.5, | |
sometimes it’s loaded, with P(heads) = 0.8. Dealer occasionally switches coins, | |
invisibly to you. Given an list of observed coin flips, infer if the coin was | |
fair for each individual flip. | |
*/ | |
var hmm = function(n, initial, transitionf, observef) { | |
var impl = function(N) { | |
if (N > 1) { |
OlderNewer