Friday, September 6, 2019
The method for carrying Essay Example for Free
The method for carrying Essay My aim is to investigate the mathematical propagation of bad tomatoes This is essentially an investigation of patterns derived from a simple set of rules for this propagation, in the manner of a simplified life genesis program. The rules are as followed: 1. The first hour, any one of the tomatoes (depending on the investigation) turns bad 2. From that hour on, any tomato touched by a bad tomato will turn bad itself, on an hourly basis. 3. Tomatoes are constrained within an nn grid, which restricts propagation of bad tomatoes. As visible from the rules, this allows for creation of simple models to show the propagation of bad tomatoes. From these, I hope to derive formulae, or sets of rules if formulae are not possible, to make logical predictions. We shall define the variables as will be used in the description of this investigation as follows: n The hour in which a tomato turns g The grid size (g2) x The number of turned tomatoes in each n h The number of hours taken for all tomatoes to go bad t Total number of turned tomatoes (equal to g2) Contents Item Page number Introduction 1 Contents 2 Mapping of tomatoes in the middle of a side 3 Tomatoes in the corner 7 Conclusion. This grid represents the propagation of bad tomatoes in an nxn square, covering grids up to size 2424. Some of the results for this data are plotted on the table below: While at first it seems the patterns in this table should be obvious, this is deceptive. Only by splitting the table into three regions do we see the separate patterns defining the table. These regions, as shown in the following table, allow patterns to emerge. These patterns do not, as you would expect, work down with different numbers in the same grids, but instead work across with the same number in different grids. In the first region (yellow), we see that, in every case, x is equal to n+n-1. The latter two regions (green and purple) are substantially harder, and require a sequential approach. Naturally, the first step in devising a formula, to take n and g and return x, is determining which region the number lies in. This is a simple matter of comparing g with n. Once we know the region, we can use a set op steps to calculate the number x. The method for carrying out this operation will be described shortly. The left grid shows an updated version of my results demonstrating the three regions yellow, green and purple, as well as some extra data formulated from the patterns observed. This is the first step in trying to formulate equations to work on all situations. Before moving on to the main essence of the project, finding a formula to derive x from n and g, we shall examine a few other formulae not directly related to this but still relevant to the investigation. Ã To find the total number of hours taken for all tomatoes to go bad within a grid, you use a formula depending on g. This formula also depends on whether g is odd or even: Ã If g is odd, then h=((g+1)/2)-1 If g is even then h=(g/2)+1 Ã In all square grid situations, t is always g2. The number of tomatoes to turn each hour in an infinite grid, starting on the side in the centre is equal to 2n-1. The total number of tomatoes that are bad after each hour is equal to n2. We shall briefly describe the patterns used to expand this table and in the following formulae: Yellow numbers always go up by 0 each grid size Green numbers go up by 1 Purple numbers go up by 3 Green/yellow boundaries go up by 1 Purple/green boundaries go up by 2 We now move on to analyse the main problem: the individual number of tomatoes to turn in each hour. This, as mentioned earlier, is a much more complicated program, and requires division of the grid into three regions. The following steps attempt to demonstrate how, and why, this is done. 1. The first step is to compare n with g, to work out which region the answer is likely to lie in. For this example we shall use two numbers, grid size 24 and tomato number 25. Compare n with g: If ng, x lies in the purple region If n=g, x lies in the green region If gn, x lies in green or yellow and further calculation is needed: If g is odd: if g= n-((g-1)/2) x is yellow, and if gn-((g-1)/2) then x is green If g is even: if g= n-(g/2) x is yellow, and if gn-(g/2) x is green We then move to region specific instructions: Yellow x =2n-1 Green x =g Purple. (Calculating purple numbers is substantially more complex) (Also note the existence of bln, a new variable we introduce here whose meaning will be explained later) Do n mod 3: N mod 3 = 0 then Bln = 2(n/3) N mod 3 = 1 then Bln = (2((n+2)/3))-1 N mod 3 = 2 then Bln = 2((n+1)/3) Do g bln Again, look at n mod 3: If 0, multiply last number by 3 and add 1 If 1, multiply last number by 3 and add 2 If 2, multiply last number by 3 and add 3 Therefore, by this process we can calculate any number from the grid size and the hour. For our example, g = 24 and n = 25, we would do the following: 1.n g, therefore x is purple 2. 25 mod 3 is 1, therefore bln = 2(27/3))-1 = 17 3. 24 17 is 7 4. 25 mod 3 is 1, therefore we: 5. Multiply 7 by 3 = 21 6. And add 2, giving 23 I have checked this with both an extended table of results (created using the patterns found earlier), and with a small excel macro designed to count the numbers of tomatoes turned each hour. Both yield the same result. Ã The left is the segment from my expanded table showing the result. The 23 in the middle of the table represents grid size 24 and hour 25 what my formula predicted. The left here is the automatic count from my macro. The data reads (for a 2424 table) hour,count (or n,x). This also agrees with my prediction. We shall here briefly explain how the purple formula works (formulas for both green and yellow are self-explanatory). I observed that the base line (the line marking the bottom of the purple section- representative of the number of tomatoes to turn bad in the final hour) of the purple section follows a three stage recurring pattern. Because we are working from the base line to reach our result, as the numbers go up by 3 each time, calculating the start point and value of the base line for each hour was essential. To work easily with a three -stage recurrence, we needed to work in base 3, the easiest implementation of which involves modulo arithmetic. By doing n mod 3, we work out which stage of the cycle represents the first grid size for tomatoes to turn in a particular hour. Once the cycle is split, we can show different formulae for each stage, derived from observance of the patterns.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.