Top Banner
A Mazing Problem Team #1106 23 May 2012 We examined three problems involving dogs searching for their owners. The first involved a dog, Tigernal, looking for his owner, Amy, in a maze. We were able to calculate, given a particular grid, the probability that Tigernal will be able to locate Amy. Furthermore, we designed an algorithm that will indicate, given an initial position for Amy, the set of all points from which Tigernal will be able to find her. We then determined the expected length of path along which Tigernal will travel before finding Amy. We investigated a similar question involving Tigernal searching for Amy, but this time in a grid of buildings as opposed to a maze of paths. We were able to determine the probability of success for all possible positions of Amy around a single building, and were able to demonstrate conditions under which Tigernal will almost never find Amy in such a grid. We then investigated a much more complicated problem involving two dogs and two owners seeking each other. We were able to solve two simple cases and demonstrate techniques that can be used to solve more complex cases. Finally, we provide examples of applications for each of the three models. 1 Challenge One To answer Challenge One, this section will first derive a general approach that is later used to answer the specific questions. 1.1 The Approach Let the street grid be divided into segments s 1 ,s 2 ,s 3 , ... with lengths l 1 ,l 2 ,l 3 , ..., where l i are expressed as fractions of the total length of all the streets in the grid. Note that l i is the probability that a randomly placed dog or Amy lies on segment s i . We can construct a matrix S whose entry i, j is the probability (0 or 1) of the dog finding Amy given that the dog is at s i and Amy is at s j . Let the value of S ij =1 if the dog reaches Amy eventually, and let S ij =0 if the dog fails.
18

A Mazing Problem - NUS High€¦ · A Mazing Problem Team #1106 23 May 2012 We examined three problems involving dogs searching for their owners. The rst involved a dog, Tigernal,

Sep 23, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: A Mazing Problem - NUS High€¦ · A Mazing Problem Team #1106 23 May 2012 We examined three problems involving dogs searching for their owners. The rst involved a dog, Tigernal,

A Mazing Problem

Team #1106

23 May 2012

We examined three problems involving dogs searching for their owners. The first involved a dog, Tigernal,looking for his owner, Amy, in a maze. We were able to calculate, given a particular grid, the probability thatTigernal will be able to locate Amy. Furthermore, we designed an algorithm that will indicate, given an initialposition for Amy, the set of all points from which Tigernal will be able to find her. We then determined theexpected length of path along which Tigernal will travel before finding Amy.

We investigated a similar question involving Tigernal searching for Amy, but this time in a grid of buildingsas opposed to a maze of paths. We were able to determine the probability of success for all possible positions ofAmy around a single building, and were able to demonstrate conditions under which Tigernal will almost neverfind Amy in such a grid.

We then investigated a much more complicated problem involving two dogs and two owners seeking eachother. We were able to solve two simple cases and demonstrate techniques that can be used to solve morecomplex cases. Finally, we provide examples of applications for each of the three models.

1 Challenge One

To answer Challenge One, this section will first derive a general approach that is later used to answer the specificquestions.

1.1 The Approach

Let the street grid be divided into segments s1, s2, s3, ... with lengths l1, l2, l3, ..., where li are expressed asfractions of the total length of all the streets in the grid. Note that li is the probability that a randomly placeddog or Amy lies on segment si.

We can construct a matrix S whose entry i, j is the probability (0 or 1) of the dog finding Amy given that thedog is at si and Amy is at sj. Let the value of Sij = 1 if the dog reaches Amy eventually, and let Sij = 0 if thedog fails.

Page 2: A Mazing Problem - NUS High€¦ · A Mazing Problem Team #1106 23 May 2012 We examined three problems involving dogs searching for their owners. The rst involved a dog, Tigernal,

Team #1106 Page 2 of 18

We can similarly construct a vector l = 〈l1, l2, l3, ...〉.We have that the matrix-vector product

Sl =

S11 S12 · · ·S21 S22 · · ·

......

. . .

l1

l2...

=

l1 · S11 + l2 · S12 + · · ·l1 · S21 + l2 · S22 + · · ·

...

(1)

Then, Sl gives a vector whose ith entry is the probability of the dog finding Amy given that it is in segment siand Amy is placed randomly.

Now, the dot product

l · (Sl) = l1(l1 · S11 + l2 · S12 + · · · ) + l2(l1 · S21 + l2 · S22 + · · · ) + · · ·

which is in fact the probability that the dog finds Amy given that both are placed randomly.

We thus seek to divide the grid into appropriate segments si, such that whenever the dog and Amy are placedanywhere within two segments, the dog will either always or never find Amy. We proved two theorems thatshow how to divide the grid appropriately.

1.1.1 Theorem 1

If Amy is on one side of the angle bisector drawnfrom an intersection, between the two streets ofthat intersection, and the dog is at that in-tersection, the dog will follow the street thatis on the same side of the angle bisector asAmy.

Proof: The dog is at intersection X andseeks to minimize the angle between the vec-

tor−−→XA and the vector in the direction of

the dog’s path. Let−→XS be the vector rep-

resenting the path on the same side of the

angle bisector as Amy and let−−→XO be the

vector representing the path on the oppositeside.

If Amy lies between−→XS and

−−→XO, the angle AXS

must be less than ∠AXO because, as shown in thediagram, ∠AXS = ∠OXS − ∠AXO and ∠AXS <∠OXS

2. Therefore, ∠AXS < ∠AXO so Tigernal will travel in the direction

−→XS. �

1.1.2 Theorem 2

Page 3: A Mazing Problem - NUS High€¦ · A Mazing Problem Team #1106 23 May 2012 We examined three problems involving dogs searching for their owners. The rst involved a dog, Tigernal,

Team #1106 Page 3 of 18

If a line can be drawn through Amy’s position at A which is per-pendicular to a segment s, then the dog will fail if it is on segments.

Proof: Let such a line be AX, where X is on s. If the dog is on any point D ons, we have that ∠AXD = 90◦, so 4AXD is right and then ∠ADX < 90◦.The opposite path has an angle ∠ADY = 180◦ − ADX > 90◦ > ∠ADX.Thus, the dog will travel in the direction of the least angle, which brings itcloser to point X.

If the dog is at point X, either path it takes is an angle of 90◦ from the line AX, by the construction ofpoint X. Thus, the dog will get stuck, as it has not found a least angle to pursue.

So if the dog is on segment s, it will always travel towards the point X, and when it reaches X, it willbe stuck. Thus, if the dog starts on any point on segment s, it will fail. �

1.1.3 Theorem 3

If the dog enters a 2-way intersection, and Amy is located between the per-pendiculars drawn from the two streets of the intersection, the dog will getstuck.

Proof: Without loss of generality, let Amy be located above the angle bi-

sector−−→XB of the angle ∠SXO. There are two cases: the dog enters from the

left or the bottom.

If the dog enters from the left, the angle ∠ADX will be smaller than ∠ADSfor all positions, leading the dog to the intersection X. Now, once at the intersection, ∠SXA > ∠AXObecause Amy is above the angle bisector

−−→XB. So the dog will proceed back the way he came–however, this

leads the dog back to the intersection. The dog is stuck.

If the dog enters from the bottom, it will be led to the intersection and to the left by the same logic asabove. However, upon going to the left, it will be led back to the intersection and will again be stuck. In eithercase, the dog is stuck. �

Another obvious fact is that if Amy and the dog are on the same street, they will always meet.

A consequence of the proof of Theorem 2 is that the dog travels in the direction−−→DX that makes ∠ADX

increase. Then, upon starting from a segment, the dog will travel along a segment until it either stops orreaches an intersection that changes its direction as dictated by Theorem 1. Thus, if angle bisectors are drawnfor each pair of adjacent streets at a 3-or-more-way intersection, and if street perpendiculars are drawn from2-way intersections, the resulting points are enough to divide the grid into segments such that if the segmentlocations of Amy and the dog are known, we can predict if the dog will succeed or fail.

We can do this as follows: for each segment si, let Amy be somewhere on si. We can use Theorem 2 to

Page 4: A Mazing Problem - NUS High€¦ · A Mazing Problem Team #1106 23 May 2012 We examined three problems involving dogs searching for their owners. The rst involved a dog, Tigernal,

Team #1106 Page 4 of 18

deduce which segments sj the dog will fail in if it starts there. We can also mark off segments that are collinearwith si–these segments are always winning segments–as the dog can start there and will find Amy. We can thenuse Theorems 1 and 3 to determine which starting segments lead the dog to the failing segments–these leadingsegments are also failing segments–and to the winning segments–these segments are also winning segments. Wecan proceed recursively until all segments are accounted for. In this way, we can build the matrix S describedabove, letting Sij = 0 if segment sj is a failing segment when Amy is in si and Sij = 1 if sj is a winningsegment when Amy is in si.

The method by which the dog moves leaves another possibility for the dog to fail, namely if Amy is at thepoint of intersection of the angle bisector drawn from an intersection (Case 2 in Challenge One). The dog isdrawn to that intersection and stops. However, since this is only one point location for Amy to make the dogstuck, the probability of Amy being randomly placed there is 0, and thus we do not consider cases like this.

1.2 Part A

We used this technique to determine S for the given network of streets shown in Annex One. That matrix isalso given in Annex One. We used the Mathematica and Geometers Sketchpad software packages to calculatethe value of P = l · (Sl) and found this to be 0.52991.

1.3 Part B

Theorems 1, 2, and 3 proven above give necessary and sufficient conditions for the dog to find Amy, becausethey allow us to uniquely determine the value of Sij for each pair of segments i, j. This is because each segmentwill either lead into a 2-way intersection (apply Theorem 3), a 3-or-more-way intersection (apply Theorem 1),Amy (success), or a stop position (apply Theorem 2).

1.4 Part C

The above two theorems and the algorithm they provide give us a way to divide into segments and determinethe matrix S for an arbitrary number and orientation of straight-line roads, which allows us then to figure outthe probability P = l · (Sl) of the dog finding Amy.

We can also use the matrix form of l · (Sl) to calculate the average expected path length of the dog, giventhat he reaches Amy. If we know what segments Amy and the dog start in, we can calculate the expected pathlength of the dog to Amy given those segments as follows.

The path from segment to segment that the dog takes is uniquely determined, by our theorems above. Thus,we know the length of the path the dog takes along the intermediate segments. Then, we need to calculate theaverage length the dog travels within his and Amy’s segments. Since the dog and Amy are placed at randompoints within the segments si and sj, it is a known result that the expected distance from the dog to an endpoint

of his segment is li2

and the expected distance from Amy to an endpoint of her segment islj2

[1]. Then, if thecombined length of all intermediate segments is lint, the average path length the dog takes between si and sj is

〈lij〉 = lint +li + lj2

Page 5: A Mazing Problem - NUS High€¦ · A Mazing Problem Team #1106 23 May 2012 We examined three problems involving dogs searching for their owners. The rst involved a dog, Tigernal,

Team #1106 Page 5 of 18

.

We can construct a new matrix Sw, whose Sij entry is 0 if the dog does not reach Amy and 〈lij〉 if thedog does reach Amy. Then, l · (Swl) is the expected path length the dog will take to Amy, with the path lengthset to 0 if the dog does not reach Amy. We can normalize this length by dividing by the probability p = l · (Sl)that the dog reaches Amy in the first place. This gives us the average path length the dog takes, given that itreaches Amy.

So, the expected length, given that Tigernal will each Amy, is given by

Average Path Length =l · (Swl)

l · (Sl)

For an example, see Annex 2.

2 Challenge Two

2.1 Part A

Consider the diagram below.

Figure 1: A diagram of a building in Amy’s world. The grey represents the areas in which Amy must be forP < 1. A is Amy’s location.

For P < 1, there must be a way for Tigernal to get stuck. This will only happen when Tigernal and Amy areon opposite sides of parallel walls, such that the line between them is orthogonal to their walls. This can onlyhappen if Amy is in one of the grey areas (and Tigernal is on the opposite grey area). Otherwise, P = 1. Forwhen Amy is in one of the grey areas, find the set N of all points such that Tigernal does not finds Amy if hestarts at point N (Note that T = A \N , where A is the set of all points).

This is given by the shaded area BCDE.

[BCDE] = [ADE]− [ABC] = πr2 · θ2π− [ABC]

Page 6: A Mazing Problem - NUS High€¦ · A Mazing Problem Team #1106 23 May 2012 We examined three problems involving dogs searching for their owners. The rst involved a dog, Tigernal,

Team #1106 Page 6 of 18

Figure 2: A diagram of Amy relative to a house when she is standing in a grey area from Figure 1. The shadedgrey region to the right is the set of all starting points such that Tigernal will not reach Amy.

Note that [ABC] does not depend on r, but [ADE] does. Find 1− P , the probability that Tigernal does notfind Amy. Then we have

1− P = limr→∞

[BCDE]

πr2= lim

r→∞

θ

2π− [ABC]

πr2

Clearly, the first term does not depend on r, and the second term will tend to zero as r →∞. So we have

1− P = limr→∞

[BCDE]

πr2=

θ

Thus, we only need to consider the angles for which Tigernal is unable to reach Amy. From the diagram, wesee that∠BAC = θ. So,

P = 1− θ

2π= 1− ∠BAC

2π(2)

2.2 Part B

The minimum number of buildings in a configuration of P = 0 is 8. First, we prove that 8 buildings is sufficient,and then we prove that it is necessary for the number of buildings to be at least 8 for P = 0.

2.2.1 Proof of Sufficiency

To prove that a configuration has P = 0, we can show that there is no angle from which Tigernal can reachAmy. Equivalently, this is saying that θ in Equation 2 is equal to 2π. In this case, P = 1− θ

2π= 1− 2π

2π= 0.

The following is a configuration with 8 buildings with P = 0 (next page).It is necessary to show that starting from any angle, the dog will end in one of the Stuck stars. In this example,we defined ε = 0.001 and H = 0.05. Since this configuration is symmetric across the x- and y-axis, examineonly the top right region. There are two areas of interest. First, examine the top angle (next page, secondfigure).

We must show that the angle that appears smaller, θ1, is indeed smaller than the angle that appears larger, θ2.

Page 7: A Mazing Problem - NUS High€¦ · A Mazing Problem Team #1106 23 May 2012 We examined three problems involving dogs searching for their owners. The rst involved a dog, Tigernal,

Team #1106 Page 7 of 18

Figure 3: A configuration with 8 buildings such that P = 0. Left: A schematic drawing of the overall strategy.Right: A drawing with useful labels, with ε = 0.001 and H = 0.05

Figure 4: A zoom in on the first region of interest. We must show that the angle that appears smaller is indeedsmaller than the angle that appears larger.

This overlap will ensure that the dog does not slip between the buildings.

θ1 = arctan(0.5ε+ 0.5 + ε

0.5 +H + 1) = arctan(

0.5015

1.55) ≈ 0.313

θ2 = arctan(0.5ε+ 0.5

0.5 + ε+ 1) = arctan(

0.5005

1.501) ≈ 0.322

θ1 < θ2

So, region one satisfies the conditions needed. Examine the lower angle (next page).We must show that the angle that appears smaller, θ3, is indeed smaller than the angle that appears larger, θ4.This overlap will ensure that the dog does not slip between the buildings.

Page 8: A Mazing Problem - NUS High€¦ · A Mazing Problem Team #1106 23 May 2012 We examined three problems involving dogs searching for their owners. The rst involved a dog, Tigernal,

Team #1106 Page 8 of 18

Figure 5: A zoom in on the first region of interest. We must show that the angle that appears smaller is indeedsmaller than the angle that appears larger.

θ3 = arctan(0.5 +H

0.5ε+ 1 + 0.5) = arctan(

0.55

1.5005) ≈ 0.351

θ4 = arctan(0.5

0.5ε+ 1) = arctan(

0.5

1.0005) ≈ .463

θ3 < θ4 �

2.2.2 Proof of Necessity

There are no configurations that use less than 8 buildings such that P =0.

Proof: Proceed by contradiction. Assume there is a configuration with lessthan 8 buildings such that P = 0. Examine Amy’s position, as shown be-low.

From Section 2.1 (Challenge 2, Part a), we need only to look at the po-tential angles of approach of Tigernal (see right). From Figure 2, ∠CABis at most 2 arctan(.5/1) ≈ .927 < π

2(when Amy is right up against the

wall). So a building can only “defend” Amy from one cardinal direction(North, South, East, or West). There will always be a cardinal direction such that the component of Tiger-nal’s movement in that direction will never be zero, unless Tigernal is stuck. In other words, it is possible tosay, “Tigernal is always moving East/West/North/South (pick one) until he reaches Amy or gets stuck”. Bydefinition of Tigernal’s movement we can say, “Tigernal can only be stuck due to a wall that blocks from theEast/West/North/South (pick one).” Since we are limited to only unit square buildings, and since each buildingcan only “defend” Amy from one direction, there must be at least one building defending Amy from each ofthese four cardinal direction so that P = 0, as shown below.

Page 9: A Mazing Problem - NUS High€¦ · A Mazing Problem Team #1106 23 May 2012 We examined three problems involving dogs searching for their owners. The rst involved a dog, Tigernal,

Team #1106 Page 9 of 18

Because the buildings cannot touch, there must be four more points of entries of Tigernal (show in red arrows).Since each building is only a unit square, each point of entry must be blocked by a unique building. By thecontrapositive of the Pigeon Hole Principle (we need at least four buildings to fill in four holes), we need atleast four buildings to ensure P = 0. We already have four buildings placed, so this means we need at least 8buildings. This is a contradiction to the assumption that there is a configuration with less than 8 buildings suchthat P = 0. So, a configuration with P = 0 needs at least 8 buildings. �

2.3 Part C

Something that facilitated the creation of the configuration in Challenge 2, Part B, was the small magnitude ofε.‘ However, if there is a minimum value for ε, our configuration may no longer be possible. That is, in Figure 4,θ1 > θ2, or in the diagram below, ∠CAG > ∠HAG. However, we want ∠CAG <= ∠HAG. To account forthis problem generally, we redefine our placement of the buildings. Again, examine only the top right quadrantsince the others are symmetric.

First, we will define the placement of the next box so that ∠CAG = ∠HAG. In other words, there is a linegoing through points C, H, and A. This ensures that Tigernal cannot get between the yellow and blue buildings.The angle of question is now ∠BAF , which we define as φ. We want to know if it will be less than the criticalangle ∠EAF , which we will define as φc. If φc > φ, then Tigernal will be unable to get between the yellow andgrey buildings, ensuring that P = 0.

So we need to construct a progression of buildings, each a positive distance ε from one another as shown inthe diagram below such that the angle formed by the positive x-axis and the green ray is smaller than the angle

Page 10: A Mazing Problem - NUS High€¦ · A Mazing Problem Team #1106 23 May 2012 We examined three problems involving dogs searching for their owners. The rst involved a dog, Tigernal,

Team #1106 Page 10 of 18

formed by the positive x-axis and the red ray. This will ensure that if Tigernal is anywhere in the first quadrantabove the red ray, that he will be redirected by the barrier of buildings either into (1) the building to the leftor (2) the region below the red ray. If he is directed to the left building, he will continue moving left until hereaches the building above Amy and get stuck. If he is in the region below the red ray, Tigernal will travel alongthe green ray and be blocked by the building to the right of Amy. By repeating this procedure on all sides ofAmy, one can ensure that P = 0. The only thing left to check is that this procedure will work for any given ε.

The way this is done is by placing each successive building in the progression of buildings such that its horizontaldistance from the previous (to the left on the coordinate plane) building is exactly ε and its upper-left corneris colinear to Amy and the upper-right corner of the previous building. From this, a set of recursive equationsdescribing the angle formed by the final building in the progression and the positive x-axis can be constructedas follows:

Let Amy’s location as shown in the setup in the previous diagram be defined as the origin of a rectangularcoordinate system. Let xi be the x-coordinate of the upper-right corner of each unit-square building in theplane. Let yi be the y-coordinate of the upper-right corner of each building in the plane. Since each upper-rightcorner is exactly one-unit plus ε from the previous upper-right corner, we have xi = xi−1 + 1 + ε. To ensurethat each upper-left corner is colinear to Amy and the previous houses upper-right corner, it is neccessary tostagger each house added by some vertical distance. Let us denote the vertical distance by which the ith houseis staggered hi. The recursive form for hi can be found by ensuring that the slope of the line between Amy (theorigin) and the upper-right corner of the previous house is equivalent to the slope of the line between the originand the upper-left corner of the house (since they are colinear).

Mathematically,yixi

=1 + yi−1 − hi

xi + ε

Solving this equation for hi gives hi = 1 − ε·yi−1

xi−1. Substituting this into the recursive equation for yi and

simplifying gives

yi = yi−1 ·(1 +

ε

xi−1

)

Page 11: A Mazing Problem - NUS High€¦ · A Mazing Problem Team #1106 23 May 2012 We examined three problems involving dogs searching for their owners. The rst involved a dog, Tigernal,

Team #1106 Page 11 of 18

.

Solving the recursive equation for xi can be done fairly easily, as xi simply grows linearly by an amount of1 + ε per iteration. Hence the explicit form is xi =

12+ i · (1 + ε). Note that xi →∞ as i→∞. Furthermore,

note that as i→∞, yi → yi−1 (since the term 1+ εxi−1→ 1). This implies that eventually, the y-coordinate of

each building is eventually approaching a constant value, whereas the x-coordinate continues to grow linearly.

So as long as φ < φc, we can ensure that Tigernal will always be funneled into the region bounded by φcand the positive x-axis. This will ensure that there is only a finite region of area from which he can reach Amyimplying that P → 0 as r → ∞. φ is given by π

2− arctan(xi+1

yi−1 ). Note that as i → ∞, xi−1yi−1 → ∞ because

the denominator is approaching a constant (as explained above) and the numerator grows without bound. Thisimplies that arctan(xi+1

yi−1 )→π2

implying that φ→ 0.

By definition of the limit of a sequence, this means that the angle can be made as small as sufficiently de-sired by using enough buildings in the setup (this number may be huge, but will always be finite). Since thisangle can be as small as sufficiently desired, given any ε and the corresponding φc > 0, one can make φ < φc bysimply adding enough buildings to the progression. This implies that no matter how large ε is, one can alwaysadd a finite number of buildings to the progression as prescribed above, and Tigernal will always be funneledinto the region such that the building immediately to Amys right will trap him. Hence, there is no bound on ε,the minimum distance between buildings, such that P = 0.

3 Challenge Three

3.1 L→ 0

The case L→ 0 is effectively 2 dogs seeking each other. In the real world, leashes are relatively small comparedto distance in streets, thus small leash lengths can be approximated by L = 0. To find the probability of success,we can still use the same method of p = l · (Sl) as demonstrated before, however the value of the matrix Smust be different. We proved theorems similar to our earlier theorems for a stationary Amy for the case of 2moving dogs with L→ 0.

3.1.1 Theorem 4 (similar to Theorem 2)

Dogs on two segments si and sj will fail in the middle of those segments if and only if they are parallel.

Proof: If si and sj are parallel, by Theorem 2, each dog will be drawn in the direction of the other, thusin opposite directions. When the dogs are directly opposite, they will stop as their paths are perpendicular tothe direction to the other. Now, stopping can only happen if there exists a point on each segment at which thedirection to the other point is perpendicular to the segment. By the parallel postulate, this is only true if thetwo segments are parallel. Thus, dogs in the middle of two segments will stop iff they are parallel. �

Theorem 4 implies that now, dogs on intersecting segments must meet each other, even if they fulfill thehypotheses of Theorem 2.

Page 12: A Mazing Problem - NUS High€¦ · A Mazing Problem Team #1106 23 May 2012 We examined three problems involving dogs searching for their owners. The rst involved a dog, Tigernal,

Team #1106 Page 12 of 18

3.1.2 Theorem 5 (similar to Theorem 3)

If one dog is at a 2-way intersection, the dogs will fail if:

1. the other dog is at a 2-way intersection and the dogs each fulfill Theorem 3, or

2. the other dog fulfills Theorem 3 for the first dog and a perpendicular line to the other dog’s segmentthrough the intersection intersects the other dog’s segment at a point that fulfills Theorem 3.

Proof:

1. If both dogs fulfill Theorem 3, they will stay in the same place and are stuck by Theorem 3.

2. If the other dog fulfills theorem 3 for the first dog, the first dog will stay the same place, and is stuck.The other dog comes to a halt and becomes stuck by Theorem 2.

�Theorem 6 deals with intersections that lead into failure by Theorem 4, that is, scenarios like the following.

The first dog is at D, whereas the second dog is in the segment y. These are the only scenarios that could leaddirectly into the two dogs failing.

3.1.3 Theorem 6

The probability of success in this intersection is:

{ yd·∫ y0xydx+

(1− y

d

)if d ≥ y∫ d

0xydx if d < y

Proof: The top dog will divert onto the parallel path only if the bottom dog has not reached the intersec-tion of the angle bisector AB by the time the top dog has reached the intersection A, by Theorem 1. Sincethe dogs travel at the same speed, this means that the bottom dog’s initial distance CB from the intersectionmust be less than the top dog’s distance x from the intersection.

If the top dog is a distance x from the intersection, the bottom dog will meet him then with probability

Page 13: A Mazing Problem - NUS High€¦ · A Mazing Problem Team #1106 23 May 2012 We examined three problems involving dogs searching for their owners. The rst involved a dog, Tigernal,

Team #1106 Page 13 of 18

xy

. Thus, if d < y, every value of x yields a set of possible positions for the bottom dog where the two dogswould meet. We can sum up these probabilities by taking the definite integral:

p =

∫ d

0

p(x)dx =

∫ d

0

x

ydx

If d ≥ y, there are a set of positions y < x ≤ d where the two will meet regardless of the position of the bottomdog. So we have a sum of two terms:

p =y

d·∫ y

0

x

ydx+

(1− y

d

)yd

is the probability that x < y, and the integral gives the probability of success given that x < y (proven above).The second term is simply the probability that x > y, the success probability of which is 1 �

The following method can be used to solve S just as in Challenge 1. Divide the graph in segments accordingto angle bisectors just as in Challenge 1. Given a segment position of one dog, we can use Theorems 4 and 5to find guaranteed failing segments, and Theorem 6 to find conditionally failing segments. Segments that leadinto intersections that include conditionally failing segments must be tackled by looking at the expected pathlengths again in an analysis similar to the proof of Theorem 6. This gives a method to solve S for these graphsand get a probability of success.

For leash lengths which cannot be approximated by L = 0, situations become even more complicated andrequire an intensive analysis. We provide an example here by trying to generalize Theorem 6 to any leash lengthL.

In the diagram above, the dashed line is the angle bisector. Imagine that dog D1 starts a random distance w fromthe corner, where 0 ≤ w < a. Dog D2 is a random distance L−z from its nearest intersection, where 0 ≤ z ≤ L.

If w < z, then D1 will reach the intersection F before the owner P2 reaches intersection A. Then, dogD1 will be able to chase and meet owner P2 along the vertical road, and a happy ending is reached. If w ≥ z,P2 will start along the bottom horizontal road, and the two dogs and owners will get stuck because of theparallel roads, by Theorem 4 (unhappy ending). We have that w < z with probability w

zif z ≤ a (which

happens with probability aL

) and 1 if z > a (happens with probability 1 − aL

. So, like in Theorem 6, we must

Page 14: A Mazing Problem - NUS High€¦ · A Mazing Problem Team #1106 23 May 2012 We examined three problems involving dogs searching for their owners. The rst involved a dog, Tigernal,

Team #1106 Page 14 of 18

use a definite integral to calculate the probability.

p =( aL

)∫ a

0

∫ a

0

z

wdzdw + (1− a

L)

There are several other possibilities for even a simple intersection like this, and even more complicated potentiallayouts require a thorough case-by-case analysis. The dependence on initial placement of the dogs and ownersmakes it difficult to generalize results like Theorem 6 to both arbitrary L and arbitrary initial placement.

3.2 L =∞In the case that the length of the leash is infinite or extremely large relative to the street lengths, Bob and Alanwill never move because they will never be pulled by their dogs. Thus, this is equivalent to two scenarios ofChallenge 1: there are two dogs, and they each must find their stationary owner. We know that for one pairof dog-owner, the probability that they will create a happy ending P1 can be found. So, the probability thatneither of the two dog-owner pairs have a happy ending is (1− P1)

2. So, the probability that there is a happyending with two dog-own pairs is given by P2 = 1− (1− P1)

2.

4 Challenge Four

4.1 City Planning

An application of this model would be in city planning. When deciding where to put major attractions, cityplanners would like to reduce the amount of traffic jams produced. For example, having the city hall at the endof a dead-end would be obviously poor planning. However, this problem becomes much more complicated whenmultiple streets are considered, none of which are obviously poor choices. To prevent traffic jams, city plannersmust recognize how people drive. Except for veteran commuters, who will most likely know non-intuitive shortcuts around the city to avoid traffic jams, most people will follow rules similar to Tigernal.

Figure 6: Two potential paths someone may take their destination. The blue path is more intuitive, whichfollows the rules of Tigernal.

For example, in the figure above, the blue path is more intuitive. Like Tigernal, people try to reduce theirdistance to their destination as quickly as possible, causing the angle between their movement and the directiontowards the destination is as small as possible. So, people’s movement can be simulated with this model. Inthis situation, the more times people get stuck, the more traffic jams there are. Although this is a short comingwhen trying to model the real world (e.g. people do not stay stuck forever if their destination is on the other

Page 15: A Mazing Problem - NUS High€¦ · A Mazing Problem Team #1106 23 May 2012 We examined three problems involving dogs searching for their owners. The rst involved a dog, Tigernal,

Team #1106 Page 15 of 18

side of a perpendicular wall), people will have to circumnavigate an obstacle only once they have reached astuck position. Since this is not optimal, more instances of people who reach stuck positions will result in morecongestion. So, when comparing different city floor plan, P will tell planners holistically which city floor plan isless traffic-jam prone.

Instead of comparing city floor plans, this model can also be used to determine where attractions should beplaced. The matrix lTS from Equation 1 tells which segments are most easily reached, given that a car (insteadof a dog) is placed at a random location. We transpose because we assume that the car is placed randomly,not the attraction. So for example, if segment 5 from lTS has a P (success) = 0.8 whereas segment 49 onlyhas a P (success) = 0.4, it would be much more advantageous for a new attraction to be placed in segment 5to prevent traffic jams.

4.2 Self-Guided Vehicles

Another useful application of the model presented in Challenge 1 is in the development of self-guided vehicles.Automated guided vehicles, or AGVs, are already being used in industry to help move goods around warehouses.One of the processes by which they select their paths is called frequency select mode. In this method, thevehicles read frequencies from wires on the floor which indicate when they have reached a split and must turnone direction or another; each is programmed with a table of preset paths which then helps it determine whereto turn[1]. If these vehicles are programmed simply to travel in the direction of their destination (determinedwirelessly) similarly to Tigernal, we can use the theorems discussed in Challenge 1 to predict their chosenpaths and expected path lengths. With this information, warehouses and manufacturing facilities can be moreeffectively laid out to minimize the distance covered by the AGVs, without having to program them withpredetermined paths to follow. [2]

4.3 Emergency Rescue

Firemen often use infrared cameras to scan through walls in order to find trapped people in buildings. Thusfiremen know the direction of, but not the best path to, a trapped person. Buildings must be designed such that,in case of emergency, trapped individuals can be easily found. Using the techniques developed in the analysisof Model 1, buildings can be designed that maximize the value of P and minimize the value of expected pathlength. This will ensure that in emergencies, trapped people can be rescued most efficiently. [3]

4.4 Pest Control

The model in Challenge 2 can be applied to pest control in both residential and agricultural settings. Providedthey know where a food source is, many insects will move in a straight path toward the source until theyencounter an obstacle. Like Tigernal, they will then travel along this obstacle (toward the food) until their pathis once again unobstructed. These movement patterns can be exploited when determining how and where toplace pesticide or barriers against insects. For instance, our solution from Challenge 2, Part B can show where toplace non-touching barriers to block pests from reaching a central destination, possibly crops or a home. It maybe important to prevent barriers from touching to allow room for movement. This is especially important if onewants to minimize the amount of pesticide/barriers used. Maximizing the distance from the central destinationto the barriers (as in Challenge 2, Part C) is important to decrease the proximity of the pest deterrents fromthe central destination. In cases where pest deterrents are toxic, this would be very desirable.

Page 16: A Mazing Problem - NUS High€¦ · A Mazing Problem Team #1106 23 May 2012 We examined three problems involving dogs searching for their owners. The rst involved a dog, Tigernal,

Team #1106 Page 16 of 18

References

[1] Dartmouth University. ”Continuous Probability Densities.” Dartmouth.edu. Dartmouth University. Web. 23May 2012. www.dartmouth.edu/ chance/teaching aids/books.../Chapter2.pdf.

[2] ”Guidance Options for Automatic Guided Vehicles.” Jervis Secondary. Web. 22 May 2012.¡http://www.jervisbwebb.com/Products/guidance options.aspx?pid=308¿.

[3] ”ICI Products.” Infrared Cameras Inc. Web. 23 May 2012. http://www.infraredcamerasinc.com/.

Page 17: A Mazing Problem - NUS High€¦ · A Mazing Problem Team #1106 23 May 2012 We examined three problems involving dogs searching for their owners. The rst involved a dog, Tigernal,

Team #1106 Page 17 of 18

Appendices

A Annex One

A.1 Map

A.2 Code

Implemented in MathematicaS = { {1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {1, 1, 1, 1, 1, 1,1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0}, {1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0},{1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, {1, 1, 1, 1, 1, 1, 1, 0,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, {1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, {0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0,0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1,1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1}, {0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1}, {0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 0, 0, 0, 1, 1, 1}, {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,

Page 18: A Mazing Problem - NUS High€¦ · A Mazing Problem Team #1106 23 May 2012 We examined three problems involving dogs searching for their owners. The rst involved a dog, Tigernal,

Team #1106 Page 18 of 18

0}, {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1}, {1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0,0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, {0,0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, {0, 0, 0, 0, 0, 0, 0, 1, 0, 0,0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0,0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1}, {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, {1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1,1, 1, 1, 1, 1, 1, 1, 0, 1, 1} };

Lengths = { {46}, {60}, {33}, {60}, {46}, {8}, {38}, {46}, {38}, {22}, {125}, {60}, {60}, {60}, {60},{38}, {72}, {15}, {57}, {3}, {72}, {72}, {26}, {15}, {19}, {38}, {3}, {69}, {3}, {72}, {15}, {57}};

sum = Total[Lengths];f = Table[N[Lengths[[i]]/sum], {i, Length[Lengths]}];Transpose[f].(S.f){{0.52991}}

B Annex Two

As an example, take the unit square. Let the sides be 1, 2, 3, 4 in clockwise order. We know that each of thepairs 13, 24 will fail (they satisfy the hypothesis of Theorem 2). So we have

S =

1 1 0 11 1 1 00 1 1 11 0 1 1

and l =

0.250.250.250.25

For each pair of adjacent sides, there are no intermediate segments that the dog will take to Amy. So,〈l〉 = 1+1

2= 1

2Now, we have

Sw =

0.5 0.5 0 0.50.5 0.5 0.5 00 0.5 0.5 0.50.5 0 0.5 0.5

so

Average Path Length =l · (Swl)

l · (Sl)=

0.0.375

0.75= 0.5