1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Ugo [173]
3 years ago
11

Random walk. A Java programmer begins walking aimlessly. At each time step, she takes one step in a random direction (either nor

th, east, south, or west), each with probability 25%. She stops once she is at Manhattan distance r from the starting point. How many steps will the random walker take
Mathematics
1 answer:
ankoles [38]3 years ago
7 0

Step-by-step explanation:

Hi, your question isn't totally complete. Here's the likely full question:

Random walk. A Java programmer begins walking aimlessly. At each time step, she takes one step in a random direction (either north, east, south, or west), each with probability 25%. She stops once she is at Manhattan distance r from the starting point. How many steps will the random walker take? This process is known as a two-dimensional random walk.

Write a program RandomWalker.java that takes an integer command-line argument r and simulates the motion of a random walk until the random walker is at Manhattan distance r from the starting point. Print the coordinates at each step of the walk (including the starting and ending points), treating the starting point as (0, 0). Also, print the total number of steps taken.

You might be interested in
An airliner maintaining a constant elevation of 2 miles passes over an airport at noon traveling 500 mi/hr due west. At 1:00 PM,
butalik [34]

Answer:

\frac{ds}{dt}\approx 743.303\,\frac{mi}{h}

Step-by-step explanation:

Let suppose that airliners travel at constant speed. The equations for travelled distance of each airplane with respect to origin are respectively:

First airplane

r_{A} = 500\,\frac{mi}{h}\cdot t\\r_{B} = 550\,\frac{mi}{h}\cdot t

Where t is the time measured in hours.

Since north and west are perpendicular to each other, the staight distance between airliners can modelled by means of the Pythagorean Theorem:

s=\sqrt{r_{A}^{2}+r_{B}^{2}}

Rate of change of such distance can be found by the deriving the expression in terms of time:

\frac{ds}{dt}=\frac{r_{A}\cdot \frac{dr_{A}}{dt}+r_{B}\cdot \frac{dr_{B}}{dt}}{\sqrt{r_{A}^{2}+r_{B}^{2}} }

Where \frac{dr_{A}}{dt} = 500\,\frac{mi}{h} and \frac{dr_{B}}{dt} = 550\,\frac{mi}{h}, respectively. Distances of each airliner at 2:30 PM are:

r_{A}= (500\,\frac{mi}{h})\cdot (1.5\,h)\\r_{A} = 750\,mi

r_{B}=(550\,\frac{mi}{h} )\cdot (1.5\,h)\\r_{B} = 825\,mi

The rate of change is:

\frac{ds}{dt}=\frac{(750\,mi)\cdot (500\,\frac{mi}{h} )+(825\,mi)\cdot(550\,\frac{mi}{h})}{\sqrt{(750\,mi)^{2}+(825\,mi)^{2}} }

\frac{ds}{dt}\approx 743.303\,\frac{mi}{h}

6 0
3 years ago
Which two types of income does a person in a full-time sales job usually receive?
katovenus [111]

Answer:

hourly pay & commission

Step-by-step explanation:

Full time sales jobs typically pay their employees an hourly pay and then a commission on what they sell.

8 0
3 years ago
Read 2 more answers
Which of the following can be used to create a regular tessellation?
svlad2 [7]
I think it’s d because it’s like similar
5 0
3 years ago
Read 2 more answers
study the spinner below. if the wedges 2 and 5 are twice the area of the other wedges what is the likelihood of landing on 2 or
Anuta_ua [19.1K]

Answer:

a. 1/2

Step-by-step explanation:

7 0
3 years ago
Read 2 more answers
Add. Write your answer in simplest form.
alexandr1967 [171]

Answer:

yes, you got it correct

Step-by-step explanation:

8 0
2 years ago
Read 2 more answers
Other questions:
  • How to solve x^4+4x-1=0 ? ...?
    6·1 answer
  • Round 3.1 to the nearest hundredths
    15·2 answers
  • Cathy volunteered to collect cans for a school project. cathy collected 125 cans in 5 days. there were 6 volunteers including ca
    6·2 answers
  • The smiths took out a 30 year mortgage. how many monthly payments will they make on this mortgage
    12·1 answer
  • Question 2 1 pts Sarah was playing with her toy boat in the lake. Her boat sprung a leak and sunk 3 inches every 5 seconds it wa
    7·1 answer
  • Which one is greater 27.532 or 27.523
    14·2 answers
  • Uma pessoa fez uma compra no valor de 104.592,00 eles pagaram este valor em 48 parcelas mensais sem juros qual seria o valor de
    12·1 answer
  • Bryce has heard that gas appliances are cheaper to use and can lower utility costs. He is interested in purchasing a new gas sto
    13·1 answer
  • The area of a square is 144 cm' and one of
    8·1 answer
  • Some government leaders propose allowing oil companies to drill in currently protected lands that may be rich in oil reserves. E
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!