Question
In Java Part 1: Write a test client for Randomthat checks that two methods, namely, nextGaussian()and nextLong()in the library operate as expected. Take a command-line
In Java
Part 1: Write a test client for Randomthat checks that two methods, namely, nextGaussian()and nextLong()in the library operate as expected. Take a command-line argument N, generate Nrandom numbers using each of the methods in Random, and print out their mean, and standard deviation.
Part 2: Implement a class that extends Random with a static method maxwellBoltzmann() that returns a random value drawn from a Maxwell-Boltzmann distribution with parameter s. To produce such a value, return the square root of the sum of the squares of three Gaussian random variables with mean 0 and standard deviation s. The speeds of molecules in an ideal gas have a Maxwell-Boltzmann distribution. Write a test client to test this new method, taking as command-line arguments N and sand prints N random numbers from the Maxwell Boltzmann distribution with parameter s.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started