Question: The Sierpinski triangle can be implemented in MAILAB by plotting points iteratively according to one of the following three rules that are selected randomly with

The Sierpinski triangle can be implemented in MAILAB by plotting points iteratively according to one of the following three rules that are selected randomly with equal probability.
Rule 1: xn+1 = 0.5xn, yn+1 = 0.5yn.
Rule2: xn+1 = 0.5xn + 0.25, yn+1 = 0.5yn + (√3)/4
Rule 3: xn+1 = 0.5xn + 1 + 0.5, yn+1 = 0.5yn.
Write a program in a script file that calculates the x and y vectors and then plots y versus x as individual points (use plot (x, y, '^')). Start with x1 = o and y1 = o. Run the program four times with 10, 100, 1,000, and 10,000 iterations.

Step by Step Solution

3.55 Rating (165 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Script file n10 100 1000 10000 for j14 x10 y10 for ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Document Format (1 attachment)

Word file Icon

652-B-F-F-M (718).docx

120 KBs Word File

Students Have Also Explored These Related Finance Questions!