An ant is standing at the point ( 0 , 0 ) in the Cartesian plane. The ant begins by walking a units in the negative y direction, for some positive integer a . The ant then turns left and walks b units in the positive x direction for some positive integer b . The ant again turns left and walks c units in the positive y direction for some positive integer c . Finally the ant turns left once again and walks d units in the negative x direction, for some positive integer d . An observer is watching the ant as it starts walking, but quickly gets bored of watching the ant. The observer only watched the first 1 4 units of the ant's walk, and noticed that the ant did not visit the same point on the plane more than once in this time. How many different possible paths could the observer have seen?
Details and assumptions
If the observer only watched the first 4 units of the ant's walk, then a = b = c = d = 1 is not a valid walk since the origin would be visited twice, namely at the start and at the end.
The ant walked for more than 14 units.
If the ant walked for a = 1 4 , then all that the observer saw was the ant walking 1 4 units in the negative y direction. This is one of the possible paths.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Considering cases based on how many turns were observed is the most promising avenue for success on this question. Students who did not consider this struggled with answering the question.
Can you see how to generalize this when we replaced 20 by another even number? What, if anything, changes if we observe an odd number instead of an even number?
Why did you take a+b+c+d = 20 insteead of 14
If a >= 20, then the observer only saw the ant moving 20 units downwards. There is obviously no overlapping of the path, so this is 1 possible path. If a < 20 but a+b >= 20, then the observer saw the ant moving downwards then rightwards (for 20 units in total). There is no overlapping of the path as well, so we consider all solutions to a+b=20. Since a and b are positive, then (a,b) = (1,19), (2,18), ... , (19,1). There are 19 possible paths. If a+b < 20 but a+b+c > 20, then the observer saw the ant moving downwards then rightwards then upwards (for 20 units in total). There cannot be overlapping of the path as well, so we consider all solutions to a+b+c=20. There are 19C2 = 171 possible paths for this. If a+b+c<20, then the observer must have seen the ant moving downwards then rightwards then upwards then leftwards (for 20 units in total). So a+b+c+d=20. There are 19C3=969 such paths. But there might be overlapping of paths, and this happens precisely when two conditions are satisfied: (1) the ant moves fewer or equal units upwards compared to downwards; (2) the ant moves fewer or equal units rightwards compared to leftwards. In other words, the ant crosses its own path iff c<=a and b<=d. We consider the number of such possibilities. In such a scenario, we can let a = c+m and b = d+n, where m and n are non-negative integers. So now we have 2b+2c+m+n=20. Letting e = b-1 and f = c-1 (note that b and f are now non-negative integers), we have 2e+2f+m+n=16. Now all the possible (e+f, m+n) are (0,16), (1,14), (2,12), (3,10), ... , (8,0). For any non-negative integers p,q and r such that p+q=r, there are r+1 possibilities for (p,q) [which are (0,r), (1,r-1), ... (r,0)]. Using this fact, we can easy calculate the number of possibilities of e, f, m and n for the cases above. The total number of possibilities is thus 1(17)+2(15)+3(13)+...+9(1)=285. Note that for any unique (e,f,m,n), we can reconstruct a unique (a,b,c,d). So there are 285 possibilities for (a,b,c,d). Now we need to subtract these 285 possibilities from the 969 to give us 684 possible non-overlapping paths when a+b+c+d=20.
The total number of possible paths should thus be 1+19+171+684=875.
Note that the ant begins with positive a units in the negative y direction and, as only 20 first units are observed, may or may not continue its path in other directions, which means that the paths should ensure the conditions of a>0; if c=0 then d must equals 0 and if b=0 then c=0 and d=0.
Considering two cases:
1) a > 0 , c = d = 0 : always satisfactory because only two directions are followed: a may take any value from 1 to 20 (then b=20-a), so 20 paths
2) a,b,c>0: So as for the ant to visit no point more than once, d < b (stays to the right of the y axis) or c > a (goes up over the x axis before walking to the left) Number of paths = paths( d < b )+paths( c > a )-paths( d < b and c > a ) (Refer here )
In conclusion the total number of different possible paths is: 20+615+525-285=875
There are a few cases to consider for this problem.
~~~~
Case 1: The ant didn't turn before it has walked 20 units. There is only 1 possible path.
Case 2: The ant turned once before it has walked 20 units. It must have turned before walking the 20th unit, so it could have turned after walking 1 unit, after walking 2 units, ..., or after walking 19 units. Hence the number of possible paths is ( 1 1 9 ) = 1 9 .
Case 3: The ant turned twice before it has walked 20 units. Again, it must have turned before walking the 20th unit, so the number of possible paths is ( 2 1 9 ) = 1 7 1 .
~~~~
It is easy to see that in these first three cases, it is impossible for the ant's path to cross itself. Hence we don't have to subtract from the number of paths calculated above.
~~~~
Case 4: The ant turned three times before it has walked 20 units. As above, the number of possible paths should be ( 3 1 9 ) = 9 6 9 . However, in some of these paths, the ant visits some point twice; we have to count how many such paths there are.
Firstly, observe that the path of the ant can only cross itself at most once, and this point must be on the negative y -axis.
Let's say the path crosses itself at ( 0 , 0 ) . How many such paths are there? We count as follows:
So the total number of paths that cross themselves at ( 0 , 0 ) is 9 + 8 + ⋯ + 1 = ( 2 1 0 ) .
By a similar argument, we see that:
Hence the total number of paths that cross themselves is ( 2 1 0 ) + 2 { ( 2 9 ) + ( 2 8 ) + ⋯ + ( 2 2 ) } = ( 2 1 0 ) + 2 ( 3 1 0 ) = 2 8 5
~~~~
Therefore the total number of possible paths that do not cross themselves is 1 + 1 9 + 1 7 1 + 9 6 9 − 2 8 5 = 8 7 5 .
We will solve the question in general for when the observer watches the ant travel 2 k units.
There are 4 legs to the ant's journey. If the observer did not see the 4th leg, then the ant could not have possibly intersected it, no matter the values of a , b , c . We consider 4 cases, based on how many of the legs the observer saw.
If the observer saw only the first leg (or part of it), then the ant walked 2 k units down, so there is only one possible observed path.
If the observer saw parts of the first two legs, then the ant walked a units down and 2 k − a units to the right. Both a and 2 k − a are positive integers, so 1 ≤ a ≤ 2 k − 1 , so there are 2 k − 1 possible paths that could have been seen.
If the observer saw parts of the first three legs, then the ant walked a units down, b units to the right, and 2 k − a − b units up. This is equivalent to saying that a − 1 and b − 1 are non-negative integers with sum at most 2 k − 1 . There are ( 2 2 k − 1 ) ways this can happen, so there are ( 2 2 k − 1 ) possible paths that could be seen.
We lastly consider the case where the observer saw parts of all 4 legs. For simplicity, we will assume that a + b + c + d = 2 k . We will consider all possible paths the ant could have taken with these parameters, and note that the ant will step on the same intersection more than once if and only if a ≥ c and d ≥ b . Since a , b , c , d are all positive integers, we can rewrite our equation as ( a − 1 ) + ( b − 1 ) + ( c − 1 ) ≤ 2 k − 4 . This inequality will have the same set of solutions as the original equation. We have 3 non-negative integers that sum to 2 k − 4 so there are ( 3 2 k − 1 ) solutions.
Let S be the set of ( 3 2 k − 1 ) solutions to a + b + c + d = 2 k . We divide S into 4 sets:
S a c , b d are the solutions in S with a = c , b = d
S a c , b d are the solutions in S with a = c , b = d
S a c , b d are the solutions in S with a = c , b = d
S a c , b d are the solutions in S with a = c , b = d
Paths corresponding to solutions in S a c , b d contain the point ( 0 , 0 ) twice, so do not give paths the ant could have travelled. Paths corresponding to solutions in S a c , b d give paths the ant could have travelled if and only if b > d . This occurs half of the time, since if we swap b and d then this is also a solution. Similarly, half of the solutions in S a c , b d will give valid paths. Three quarters of the solutions in S a c , b d will also give valid paths. We will now determine the sizes of these 4 sets.
A solution in S a c , b d gives a solution to the equation a + b = k , of which there are k − 1 such solutions, so ∣ S a c , b d ∣ = k − 1 .
A solution in S a c , b d gives a solution to the equation 2 a + b + d = 2 k . When a = k − 1 there is 1 solution, when a = k − 2 , there are 3 solutions, and as we decrease a by 1 we get 2 additional solutions. Thus, the total number of solutions is 1 + 3 + ⋯ + 2 k − 3 = ( k − 1 ) 2 . However, this also counts solutions with b = d , of which there are k − 1 , so ∣ S a c , b d ∣ = ( k − 1 ) ( k − 2 ) . We also have ∣ S a c , b d ∣ = ( k − 1 ) ( k − 2 ) by symmetry.
This means that ∣ S a c , b d ∣ = ( 3 2 k − 1 ) − 2 ( k − 1 ) ( k − 2 ) − ( k − 1 ) = 3 2 ( k − 1 ) ( k − 2 ) ( 2 k − 3 ) . This tells us that the number of valid paths when the observer sees all 4 legs will be 2 ( k − 1 ) ( k − 2 ) + 2 ( k − 1 ) ( k − 2 ) + 2 ( k − 1 ) ( k − 2 ) ( 2 k − 3 ) = 2 ( k − 1 ) ( k − 2 ) ( 2 k − 1 ) .
This gives the total number of paths as 2 ( k − 1 ) ( k − 2 ) ( 2 k − 1 ) + 2 ( 2 k − 1 ) ( 2 k − 2 ) + ( 2 k − 1 ) + 1 = 2 2 k 3 − 3 k 2 + 5 k . When k = 7 , we get 2 8 7 paths the ant could have taken.
Problem Loading...
Note Loading...
Set Loading...
We consider the number of paths where the ant visits the same point again. We can simply set d = 2 0 − a − b − c since the observer will not see anything beyond that.
As the ant only makes 4 anti-clockwise turns at right angles, it can only visit the same point after turning three times where it's y-coordinate is c − a . Since the first section of the path lies between ( 0 , 0 ) and ( 0 , − a ) , we get that the point of intersection is ( 0 , c − a ) and since it lies in that path, c − a ≤ 0 ⇒ c ≤ a .
The ant will travel in a rectangle to reach that point and the total distance traveled to reach that point is a + b + c + b and for the observer to notice the repeat, this value must be at most 20. Therefore, we want to count the number of positive integer triplets a , b , c satisfying c ≤ a and a + 2 b + c ≤ 2 0
For a given b , we have c + a ≤ 2 0 − 2 b and as c l e q a we have 1 ≤ c ≤ 1 0 − b and for each c , we have c ≤ a ≤ 2 0 − 2 b − c which gives 2 1 − 2 b − 2 c values of a so the total number of possible pairs of ( a , c ) is ( 2 1 − 2 b − 2 ) + . . . + ( 2 1 − 2 b − 2 ( 1 0 − b ) ) = 1 + 3 + . . . + ( 1 9 − 2 b ) = ( 1 0 − b ) 2
a + c ≥ 2 ⇒ 0 < 2 b ≤ 1 8 ⇒ 1 ≤ b ≤ 9 so the number of positive integer solutions is ( 1 0 − 1 ) 2 + ( 1 0 − 2 ) 2 . . . + ( 1 0 − 9 ) 2 = 1 + 4 + . . . + 8 1 = 2 8 5
We then consider the total number of possible paths regardless of the condition. Each path is uniquely determined by when the ant decides to turn. Out of the first 19 points visited excluding ( 0 , 0 ) the ant can choose to turn at up to 3 points. Therefore, the total number of paths is ( 0 1 9 ) + ( 1 1 9 ) + ( 2 1 9 ) + ( 3 1 9 ) = 1 + 1 9 + 1 7 1 + 9 6 9 = 1 1 6 0 and thus the number of paths satisfying the condition is 1 1 6 0 − 2 8 5 = 8 7 5