Respuesta :
Answer:
distance between 2 and 3 away from the origin (0,0)
Step-by-step explanation:
I tried this as a simulation.
Let y = a random number.
for x := 1 to 1000 do begin
for y := 1 to 5 do begin
a := random(4)+1;
if a := 1 then v:= v +1 That is he's going north
if a:= 2 then v:=v - 1 That is south
if a:= 3 then h := h + 1 west
if a :=4 then h :h - 1 east
end;
end;
I am running a thousand simulations
This not my actual coding. I'm made it so that it runs 5000 times
You don't have to keep score of the distance until the end.
Most of the time it gives me a distance of between 2 and 3. The quadrants are random The horizontal distance and vertical distance come in at 2 and 3 respectively or -2 and 3 or 2 and - 3 or -2 or -3 etc.
Setting this up as a tree would almost give you as many branches as a tree outside your window. But you can try drawing it you like. At least one of them.
What are the chances of you going straight east on a run
Wouldn't it be 1/4 * 1/4 * 1/4 * 1/4 * 1/4 = 1/1024 = 0.000976
Now imagine the tree branch for this. There are over 1000 branches that it could take.
So five steps going east would be -1 + -1 + -1 +-1 + - 1 = - 5 = h
Vertical = 0
Running this simulation occasionally does give 0.