>>9 is probably more comfortable with languages like Python, where ranges are half-inclusive (e.g. Python's
range(1, 5) returns
[1, 2, 3, 4] and notably
not 5). Lua isn't one of these languages, so
>>1's code
will return 1000 values, and not 999 as
>>9 seems to expect. As for the actual range and odds of each branch, the split is between values
1...499 and
500...1000, which are respectively 499 and 501 elements. Therefore, the two branches have (assuming a completely fair random algorithm) 49.9% and 50.1% execution probability.