Question: Mathematica problem 1. Define the following variables using delayed assignment a:=RandomVariate NormalDistribution[0,1]] b := {a, a} 2. Use Nest WhileList to define a function walk2D(n.)
Mathematica problem
1. Define the following variables using delayed assignment a:=RandomVariate NormalDistribution[0,1]] b := {a, a} 2. Use Nest WhileList to define a function walk2D(n.) that takes as input a number n and as output produces a 2-dimensional random walk that begins at {0,0} and keeps adding b until the norm (as in question 1 above) is >=n. Your function should have the form walk2D/m == NestWhileList[???,{0,0}, ? ? ?] An example of a possible output is shown below. In[44] := walk2D(3) Out(44)= {{0,0},{0.453585,-0.0236624} {0.727764,-1.15349},{2.78249,-1.35316}} 1. Define the following variables using delayed assignment a:=RandomVariate NormalDistribution[0,1]] b := {a, a} 2. Use Nest WhileList to define a function walk2D(n.) that takes as input a number n and as output produces a 2-dimensional random walk that begins at {0,0} and keeps adding b until the norm (as in question 1 above) is >=n. Your function should have the form walk2D/m == NestWhileList[???,{0,0}, ? ? ?] An example of a possible output is shown below. In[44] := walk2D(3) Out(44)= {{0,0},{0.453585,-0.0236624} {0.727764,-1.15349},{2.78249,-1.35316}}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
