import Data.Ratio
main =
[[6], [6,4,8,7,7,2,6], [4,8,7,7,2,6], [6,8,7,7,5,4]]
dicePosteriors [] _ = []
dicePosteriors _ [] = []
dicePosteriors suite xs
= map (/ sum zs
) zs
where
p x priors
= zipWith (*) priors
$ map (likelihood x
) suite
likelihood x hypo = if hypo < x then 0 else 1 % hypo
aW1wb3J0IERhdGEuUmF0aW8KbWFpbiA6OiBJTyAoKQptYWluID0KICBtYXBNXyAocHJpbnQgLiBtYXAgZnJvbVJhdGlvbmFsIC4gZGljZVBvc3RlcmlvcnMgWzQsNiw4LDEyLDIwXSkKICAgICAgICBbWzZdLCBbNiw0LDgsNyw3LDIsNl0sIFs0LDgsNyw3LDIsNl0sIFs2LDgsNyw3LDUsNF1dCmRpY2VQb3N0ZXJpb3JzIDo6IFtJbnRlZ2VyXSAtPiBbSW50ZWdlcl0gLT4gW1JhdGlvIEludGVnZXJdCmRpY2VQb3N0ZXJpb3JzIFtdICAgIF8gID0gW10KZGljZVBvc3RlcmlvcnMgXyAgICAgW10gPSBbXQpkaWNlUG9zdGVyaW9ycyBzdWl0ZSB4cyA9IG1hcCAoLyBzdW0genMpIHpzCiAgd2hlcmUKICAgIHpzID0gZm9sZHIgcCBbMSwxLi5dIHhzCiAgICBwIHggcHJpb3JzID0gemlwV2l0aCAoKikgcHJpb3JzICQgbWFwIChsaWtlbGlob29kIHgpIHN1aXRlCiAgICBsaWtlbGlob29kIDo6IEludGVnZXIgLT4gSW50ZWdlciAtPiBSYXRpbyBJbnRlZ2VyCiAgICBsaWtlbGlob29kIHggaHlwbyA9IGlmIGh5cG8gPCB4IHRoZW4gMCBlbHNlIDEgJSBoeXBvCg==
[0.0,0.39215686274509803,0.29411764705882354,0.19607843137254902,0.11764705882352941]
[0.0,0.0,0.9432484536722126,5.52061280612909e-2,1.5454182664965531e-3]
[0.0,0.0,0.91584527196901,8.040342579700499e-2,3.7513022339850646e-3]
[0.0,0.0,0.91584527196901,8.040342579700499e-2,3.7513022339850646e-3]