Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA question An important type of practical experiment is normally referred to as the random walk experiment. Imagine a drunken man who, starting out leaning

JAVA question

An important type of practical experiment is normally referred to as the "random walk" experiment.

Imagine a drunken man who, starting out leaning against a lamp post in the middle of an open space, takes a series of steps of the same length l. The direction of these steps is randomly chosen from North, South, East or West. After n steps, how far (d), generally speaking, is the man from the lamp post?

It turns out that there is a relationship between d, l and n which is typically applicable to many different types of stochastic (randomized) experiments. Your task is to implement the code for the experiment and, most importantly, to deduce the relationship.

Please pull from the class repo and work on RandomWalk.java and RandomWalkTest.java each of package randomwalk and each under the appropriate source directory. You may have to remove other java files from the classpath in order to allow the whole project to compile. Once you have all the unit tests running, you can do the experiment by running RandomWalk as a main program (provide the value of n as the first argument).

For this particular assignment, it is necessary but not sufficient to ensure that the unit tests all run. You must demonstrate via image files, graphs, whatever, what experiments you made in order to come up with the required expression. You will run the experiment for at least six values of n and will run each of these at least five times. That's to say, you will run the program at least 30 separate times.

Feel free to change the main program so that it will run all your experiments in one shot instead of 30 different runs.

Your submission should include:

Your conclusion about the relationship between d, n and l;

Your evidence to support that relationship;

Your code (RandomWalk.java plus anything else that you changed or created);

Evidence (screen shot) of the unit tests all passing.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

1. Why do people tell lies on their CVs?

Answered: 1 week ago

Question

2. What is the difference between an embellishment and a lie?

Answered: 1 week ago