Skip to content
Advertisement

Uniform random distribution in java

i’m generating Random values with range of 5.0 – 9.0, are the numbers generated still uniformly distributed theoretically ??

and how to implement the histogram, i mean what values we need to implement the histogram ??

JavaScript
  • i’m zero on math .., pls help me

Advertisement

Answer

You are on the righ path- scaling the numbers linearly is correct.

To test your logic, plug in 0.0 and 1.0 as values from nextDouble()

JavaScript

This is a basic way to test your math.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement