Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

the code is most likeky unnecessary but i wanted to give context. the questions are at the bottom since the photo was blurry here are

the code is most likeky unnecessary but i wanted to give context. the questions are at the bottom image text in transcribed
since the photo was blurry here are just the questions image text in transcribed
In 1: i dimensional biased random walt, sampled multiple times P-0.6. probability of positive motion NSTEPS - 40 number of steps in ran dom walk NSAMPLES - 50000 number of random walks to sample now we don't care about the items diate positions we just want to sto realist of final position final positions - for sample in range(SAMPLES): reset to ter position - for step in range (NSTEPS): we use which means add the following to the existing variab Ze if random.random): position elser position now we should know where we wo und up final_positions.append(position) print Mean is', numpy.mean(final_po sitions) print('Standard deviation is', my .std (final_positions) let's make a histogram with 82 bin between -40.5 and 40.5 (eeps the bin edges Integral) plt.hist(final positions, range-(-40 .5,40.5), bins 81) pit.xlabel('Pinal position plt.ylabel(unber of trials) plt.show() Mean is 7.97396 Standard deviation is 6.1941942105813 89 6000 4000 Number of trials 2000 0 -40 -20 20 0 Final position By changing P to a few values, verify that: the mean position at the end of the random walks is 2-1/2): the standard deviation of the final positions is 2Np(-p). By changing p to a few values, verify that: the mean position at the end of the random walks is 2N(p-1/2); the standard deviation of the final positions is 27 Np(1 p)

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

Students also viewed these Databases questions

Question

1. Which position would you take?

Answered: 1 week ago