HF RL Explorer

Task: Improve the Uniform Distribution of Bash RANDOM Function

Task: Improve the Uniform Distribution of Bash RANDOM Function: a task in Terminal-Lego-15k (Harbor dataset). The built-in $RANDOM variable in Bash generates pseudo-random integers in the range 0–32767. When used with the modulo operator to generate numbers in a specific range, this can introduce…

The task

The built-in `$RANDOM` variable in Bash generates pseudo-random integers in the range 0–32767. When used with the modulo operator to generate numbers in a specific range, this can introduce **modulo bias** — the distribution becomes non-uniform because 32768 may not be evenly divisible by the desired range size.…

Part of PrimeIntellect/Terminal-Lego-15k.