Movement of an ant on a grid over m time steps

Assignment Help Mathematics
Reference no: EM131407187

We want to study the movement of an ant on a grid over m time steps. Think of each time step as another iteration of a loop. The grid is (2n+1)(2n+1) in size centered at (0; 0). Each grid point can be colored white or black. Initially all grid points are white. The ant is placed at (0; 0) facing toward (0; 1) at t = 0. The process is described by the following rules:

Suppose we are at t = j where 0  j m ???? 1. The ant is at (x; y) for some jxj < n and jyj < n.

1. If (x; y) is white, then it is colored black. The ant turns 90 to the left. The ant moves one step forward to the next grid point. Call it (ex; ey)

2. If (x; y) is black, then it is colored white. The ant turns 90 to the right. The ant moves one step forward to the next grid point. Call it (ex; ey).

3. j is replaced by j + 1

The process stops when either

1. t = m (time is up)

2. jexj = n (the ant is on the right or left edge)

3. jeyj = n (the ant is on the bottom or top)

The process is meant to illustrate a model for computers called a Turing machine. 1

a. Write a function called LangtonAnt with parameters n and m. The format should be function [Color; Position; Direction; t] = LangtonAnt(m,n)

Here

1. t is the time step at termination of the process. Note t <= m.

2. Color is a (2n + 1)  (2n + 1) matrix indicating the color of the grid points (0 for black, 1 for white) at time t.

3. Position is the position of the ant at time t. Therefore Position is a 1  2 vector with Position(1) the x-coordinate and Position(2) the y-coordinate.

Reference no: EM131407187

Questions Cloud

Distinguish between vulnerability threat and control : Vulnerability is indicating a population or individuals that are more likely for something to happen to them or develop a disease. Such as babies, elderly are more vulnerable to become ill. To be labeled vulnerable the group or person has factor..
Would this be a type i error or a type ii error : If the scientist is correct, and the world does not take her seriously, would this be a Type I error or a Type II error? Briefly explain your reasoning.
Determine the upper and lower control limits : Assume that in Example 36.3 the number of samples was 8 instead of 10. Using the top half of the data in Table 36.4, recalculate the control limits and the standard deviation. Compare your observations with the results obtained by using 10 sample
How use of nonevaluators would affect your evaluation plan : Discuss the advantages and disadvantages of nonevaluators in the role of internal evaluators. Analyze how the use of nonevaluators would affect your evaluation plan. Discuss your agreement or disagreement with the use of nonevaluators.
Movement of an ant on a grid over m time steps : We want to study the movement of an ant on a grid over m time steps. Think of each time step as another iteration of a loop. The grid is (2n+1)(2n+1) in size centered at (0; 0). Each grid point can be colored white or black. Initially all grid poi..
Discuss the multiplier effect : Discuss the multiplier effect including a description of what it describes in macroeconomic terms, how it is determined, and an illustration of how it is defined
What would constitute a type i error and a type ii error : For this situation, state the null and alternative hypotheses in verbal terms, then identify what would constitute a Type I error and a Type II error in this situation.
How can teachers make digital presentations dynamic : How can teachers make digital presentations dynamic, maximizing teaching methods and learning impact? How can teachers use video resources in novel ways while inviting students to contribute their ideas for learning?
Estimate the assembly efficiency for each design : Include factors such as anisotropy of the rolled sheet, its surface texture, the bend directions, the nature of the sheared edges, and the way the handle is snapped in for assembly.

Reviews

Write a Review

Mathematics Questions & Answers

  Write an essay suggested length of 1-2 pages in which you

write an essay suggested length of 1-2 pages in which you describe how student error student and teacher misconceptions

  What is the rate of the cyclist in still air

A cyclist travels 105 miles in 7 hours going against the wind. He travels 147 with the wind in the same amount of time. What is the rate of the cyclist in still air and what is the rate of the wind?

  Find function and select the appropriate units

Where fx is the percent of relief obtained from a dose of x grams of a drug, where 0 ≤ x ≤1.5 Find f'(0.4) and select the appropriate units.

  Explain why for each vector aj, there exists a vector cj

Explain why for each vector aj, there exists a vector cj in Rp such that aj = Bcj

  Disadvantage in getting out the news

Before the Internet, newspapers were at a disadvantage in getting out the news because by the time the paper was delivered, people had seen the evening news.

  The probability that at least one of the bonds defaults

What is the probability that at least one of the bonds defaults?

  What rent should the manager charge to maximize revenue

Similarly, one additional unit will be occupied for each 5 dollar decrease in rent. What rent should the manager charge to maximize revenue?

  The given information is known about the chosen card

Find the probability if the given information is known about the chosen card

  What is the total length of pipe required in millimetres

Some 50-mm pipe is required for a project. The prints are checked and 4 spool pieces are required. One is 725 mm long, one is 984 mm long, a third is 312 mm long and a fourth is 510 mm long. What is the total length of pipe required in millimetres..

  Find the exact dimensions that will give the largest area

A poster is to have an area of 180 in2 with 1 inch margins at the bottom and sides and a 2 inch margin at the top. Find the exact dimensions that will give the largest printed area.

  What is the decimal range of all nibbles

A nibble is made of four bits. what is the decimal range of all nibbles?

  Explain how multiplication and division of rational

describe how multiplication and division of rational expressions can be done. Provide examples to support your explanation.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd