Challenge
You are given three integers as input - min_value, max_value, sample_size
, that you can pass to your answer as either array or several parameters.
Your task is to output a diagram in any convenient format, that shows the frequency of numbers in the (min_value, max_value)
range showing up when a random number in the (min_value, max_value)
range is picked sample_size
times. The random number sequence should be generated within your answer.
With large ranges and sample sizes, you're free to change the steps your diagram uses, as long as the representation remains accurate.
Example
With [1, 5, 10]
as input:
o o o x o
x o x x x
x x x x x
1 2 3 4 5
With [1, 100, 15]
as input (in steps of 10, so 00 shows 1-9, 10 shows 10-19, etc.):
xx oo oo xx oo xx oo oo oo oo
xx oo oo xx oo xx xx oo oo oo
xx xx oo xx xx xx xx xx xx oo
00 10 20 30 40 50 60 70 80 90
Scoring
This is code-golf, so shortest code in bytes wins.
[1,5,10]
example, can the height be10
? So column 4 would look like this (vertically top-to-bottom instead of horizontally left-to-right):oooooooxxx4
. \$\endgroup\$b-a
? That's quite a convenient format... \$\endgroup\$a...b
, the diagram has a single bin that covers the entire range, resulting in a single bar with height equal to the number of samples. \$\endgroup\$