Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can you please do it by matlab both two questions In a one-dimensional random walk. the position x of a walker is computed by where

image text in transcribed
Can you please do it by matlab both two questions
In a one-dimensional random walk. the position x of a walker is computed by where s is a random number. Write a program that calculator the number of steps required for the walker to reach a boundary x = plusminus B. Use MATLAB's built-in function random (1, 1) to calculate x. Run the program 100 times (by using a loop and calculate the average number of steps when B = 10. The sierpinski triangle can be implemented in MATLAB by plotting points iteratively according to one of the following three rules that are selected randomly with equal probability. Rule 1:x_a - 1 = 0.5x_in Y_a - 1 = 0.5 Y_n Rule 2: X_a - 1 = 0..5 x_n + 0.25, y_a - 1 = 0.5 y_a + (squareroot 3)/4 Rule 3: X_a - 1= 0.5 x_n + o.5, y_a - 1= 0.5 y_n Write a program in a script file that calculates the x and y vectors and then plots y verses x as individual points (Use plot (x, y, ).Start with X_1 = 0 and Y_1 = 0.Run the program four times with 10, 100, 1,000.and 10,000 iterations

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_2

Step: 3

blur-text-image_3

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

Relational Database Design A Practical Approach

Authors: Marilyn Campbell

1st Edition

1587193175, 978-1587193170

More Books

Students also viewed these Databases questions

Question

What are the six n1ain types of occupational orientation?

Answered: 1 week ago

Question

Were all members comfortable brainstorming in front of each other?

Answered: 1 week ago

Question

4. What will the team agreement contain?

Answered: 1 week ago