1, 1, -1, 1, -1, -1, -1, 1, 1, -1, ...
You get an evenly spaced subsequence by starting on the n'th element, and picking every n'th element after that (and stopping after finitely many terms). So for example, we could pick every 2nd element of this sequence and get 1 (stopping after 1 term)
1, 1 (stopping after 2 terms)
1, 1, -1 (stopping after 3 terms)
1, 1, -1, 1 (stopping after 4 terms)
1, 1, -1, 1, -1 (stopping after 5 terms)
The discrepancy of an evenly spaced subsequence is obtained by adding together all the members of the subsequence and taking the absolute value. So the discrepancies of the sequences above are 1, 2, 1, 2, and 1. 7.7% / 13.5% = 57%
and the highest it could be is 8.3% / 10.0% = 83%
so the market seems to be pricing a probability in the range of (57%, 83%) for Biden to be elected president if he won the nomination - compared to Hillary Clinton's range of (56.9%, 57.7%) <^> : (T -> U) * T? -> U?
<^> (f, a) {
return a.map(f)
}
or even <^> : (T -> U) * T? -> U?
<^> (f, a) -> a.map(f)
which is already pretty close to the Haskell equivalent (<^>) :: (t -> u) -> Maybe t -> Maybe u
(<^>) = fmap
Arguably, Haskell syntax could be improved with more built-in syntax <^> : (t -> u) -> t? -> u?
<^> = fmap
though I haven't thought about what this means for parsing the language. 0.02 * [Savings]
with the idea of making your overall income path as stable as possible. 9007199254740990, 9007199254740991, 9007199254740992
but "No" to 9007199254740991, 9007199254740992, 9007199254740993
Presumably this is due to how Javascript handles integers, i.e. it uses the integer part of a float64, to wit > parseInt('9007199254740992')
9007199254740992
> parseInt('9007199254740993')
9007199254740992
Edit: I think this is the code that actually reads the numbers the user enters, see [0] function l(){
var a=h.exec(m[1]),f=null,g=null,n=null;
return a&&(null!==a[1]&&a[1]&&(f=parseInt(a[1],10)),
null!==a[2]&&a[2]&&(g=parseInt(a[2],10)),
null!==a[3]&&a[3]&&(n=parseInt(a[3],10))),
new e(f,g,n)
}
Edit(2): Actually, I'm not so sure that's the correct code at all. They NYT game is capable of parsing floats correctly (e.g. it accepts 1.1, 1.2, 1.3 as a "Yes") so it's not just using parseInt.