Let S be the set of { ( 1 , 1 ) , ( 1 , − 1 ) , ( − 1 , 1 ) , ( 1 , 0 ) , ( 0 , 1 ) } -lattice paths which begin at ( 1 , 1 ) , do not use the same vertex twice, and never touch either the x -axis or the y -axis. Let S x , y be the set of paths in S which end at ( x , y ) . For how many ordered pairs ( x , y ) subject to 1 ≤ x , y ≤ 3 1 , is ∣ S x , y ∣ a multiple of 3 ?
Details and assumptions
A lattice path is a path in the Cartesian plane between points with integer coordinates.
A step in a lattice path is a single move from one point with integer coordinates to another.
The size of the step from ( x 1 , y 1 ) to ( x 2 , y 2 ) is ( x 2 − x 1 , y 2 − y 1 ) .
The length of a lattice path is the number of steps in the path.
For a set S = { ( x i , y i ) } i = 1 k , an S -lattice path is a lattice path where every step has size which is a member of S .
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.
Oops, I just realized I didn't keep my formatting the same; I used both f ( x ) and f x .
It turns out the traditional rectangular cartesian coordinates are not the optimal way to look at the problem. It is better to look at the problem in terms of taking steps between the lines x + y = k and along them. Note that from any point on a line x + y = k , we can walk to any other point on the line and there is exactly one way to do it. Now if N is the number of ways to reach a line x + y = k from the point ( 1 , 1 ) (but we are not yet moving along the line) then every point on the line has exactly N ways to reach it when we allow traversing along a line. Now call a n the numbers of ways to get to each point on the line x + y = n . It is easy to see that for n ≥ 4 , we have a n = 2 ( n − 1 ) a n − 1 + ( n − 2 ) a n − 2 . Now by induction we can prove that a n ≡ n ( m o d 3 ) by utilizing the fact that 2 ( n − 1 ) 2 + ( n − 2 ) 2 − n ≡ 3 ( n 2 − 3 n + 2 ) ≡ 0 ( m o d 3 ) and the base cases are trivial.
Thus the problem is reduced to counting the number of points ( x , y ) such that x + y ≡ 0 ( m o d 3 ) . This is just: 1 0 ⋅ 1 1 + 2 1 ⋅ 1 0 = 3 2 0 because that are 1 0 cases when 1 1 such points lie on the line x = k , i.e. when k ≡ 2 ( m o d 3 ) and 1 0 cases otherwise.
Your induction step is fine, but the induction fails because you have no working base cases. Note that if n = 2 (i.e. ( x , y ) = ( 1 , 1 ) ), then a n = 1 . In fact, a n ≡ n − 1 ( m o d 3 ) , for all positive integers n > 1 .
Log in to reply
Oops, for some reason I thought 1 + 1 = 1 for the point ( 1 , 1 ) . This also changes the recursion formula to a n = 2 ( n − 2 ) a n − 1 + ( n − 2 ) a n − 2 so the same general idea still works.
Log in to reply
Typo, I meant ( n − 3 ) a n − 2 .
Right, I see I also did that last thing wrong.
Let T n be the set of lattice paths from ( 1 , 1 ) to any point in Q n , with the last step in { ( 1 , 1 ) , ( 1 , 0 ) , ( 0 , 1 ) } and all other steps in S .
I claim that, for any point ( x , y ) in Q n ,
∣ S x , y ∣ = ∣ T n ∣ .
This can easily be seen, as in order for a lattice path to go to ( x , y ) , it first needs to go to any point in Q n , and if that point isn't ( x , y ) , then it can go to ( x , y ) by using the steps ( − 1 , 1 ) and ( 1 , − 1 ) .
Note that this implies that S x , y is constant for any point ( x , y ) in Q n .
For all k ≥ 3 ,
∣ T k ∣ = 2 ( n − 1 ) ∣ T k − 1 ∣ + ( n − 2 ) ∣ T k − 2 ∣ ,
because from any point ( a , b ) in Q k − 1 (there are k − 1 of those), there are two ways to go to Q k in one step ( i.e. with ( 1 , 0 ) and ( 0 , 1 ) ) and ∣ S a , b ∣ = ∣ T k − 1 ∣ . Similarly, from any point in Q k − 2 , there is one way to go to Q k in one step ( i.e. with ( 1 , 1 ) ) .
I claim that for any positive integer n > 1 ,
∣ T n ∣ ≡ n − 1 ( m o d 3 ) .
I will prove this by strong induction. It is easy to see that this is true for n ∈ { 2 , 3 } , because ∣ T 2 ∣ = 1 and ∣ T 3 ∣ = 2 . Now, let's assume that it is true for k − 2 and k − 1 , for some positive integer k > 3 . We know that
∣ T k ∣ = 2 ( k − 1 ) ∣ T k − 1 ∣ + ( k − 2 ) ∣ T k − 2 ∣ ≡ 2 ( k − 1 ) ( k − 2 ) + ( k − 2 ) ( k − 3 ) ≡ ( 2 k 2 − 6 k + 2 ) + ( k 2 − 5 k + 6 ) ≡ 3 k 2 − 1 1 k + 8 ≡ k − 1 .
So, all lattice points ( x , y ) such that ∣ S x , y ∣ is a multiple of 3 , are exactly all points in Q 3 k + 1 for some positive integer k . In other words, ∣ S x , y ∣ is a multiple of 3 if and only if x + y ≡ 1 ( m o d 3 ) .
We know that 1 ≤ x , y ≤ 3 1 , but if we look at 1 ≤ x ≤ 3 0 instead, we see that a third of those points ( x , y ) satisfies x + y ≡ 1 ( m o d 3 ) , which are 3 1 ⋅ 3 0 ⋅ 3 1 = 3 1 0 ordered pairs. If x = 3 1 ≡ 1 ( m o d 3 ) , then y has to be a multiple of 3 , and there are 1 0 positive multiples of 3 no larger than 3 1 . Hence, the total number of ordered pairs ( x , y ) that satisfy the conditions is 3 1 0 + 1 0 = 3 2 0 .
I've made a mistake:
∣ T k ∣ = 2 ( n − 1 ) ∣ T k − 1 ∣ + ( n − 2 ) ∣ T k − 2 ∣
should be
∣ T k ∣ = 2 ( n − 2 ) ∣ T k − 1 ∣ + ( n − 3 ) ∣ T k − 2 ∣ .
My induction still worked, because for some reason, I said that
2 ( k − 1 ) ( k − 2 ) = 2 k 2 − 6 k + 2 .
In a given diagonal of the lattice 1 ≤ x , y ≤ 3 1 , one may only travel within the diagonal in one direction to the point ( x , y ) (either ( − 1 , 1 ) , up-and-left, or ( 1 , − 1 ) , down-and-right). For lattice paths that include both in a given diagonal, at least one vertex is used twice. Furthermore, for any point ( x , y ) on diagonal D n , defined as the set of lattice points ( k + 1 , n − k ) , 0 ≤ k ≤ n − 1 , one may travel to it directly from the points ( x − 1 , y − 1 ) or ( x − 1 , y ) , or any other point on diagonal D n by means of steps of size ( 1 , − 1 ) or ( − 1 , 1 ) . We may find that S ( n ) = ∣ S x , y ∣ for a point on diagonal D n is equal to ( n − 2 ) ⋅ S ( n − 2 ) + ( n − 1 ) ⋅ S ( n − 1 ) , with S ( 1 ) = 1 and S ( 2 ) = 1 , which can be rewritten as P 0 ( n ) ⋅ S ( n ) + P 1 ( n ) ⋅ S ( n + 1 ) + P 2 ( n ) ⋅ S ( n + 2 ) = 0 , where P 0 ( n ) = n , P 1 ( n ) = n + 1 , and P 2 ( n ) = − 1 . Thus, ∑ j = 0 k P j ( n ) ⋅ S ( n + j ) = 0 , where k = 2 . We may find the exponential generating function for this by applying the formula for the exponential generating function Y ( t ) = ∑ n = 0 ∞ a ( n ) n ! t n to get ∑ j = 0 k P j ( ϕ ) Y [ j ] = 0 , where ϕ is the operator t D t = t d t d . Thus, the recurrence relation for S has the exponential generating function defined by the differential equation ( t − 1 ) Y ′ ′ + ( t + 1 ) Y ′ = 0 ⇒ Y ′ ′ = − t − 1 t + 1 Y ′ , Y ′ ( 0 ) = 1 . Working backwards from our exponential generating function, S ( n ) = n ! ⋅ Y [ n ] ( 0 ) , which we may find by some ansatz to be ( n + 1 ) ( n − 1 ) ! ∑ k = 0 n + 1 k ! ( − 1 ) k = ( n + 1 ) ( n − 1 ) ! ∑ k = 0 n ( k ! ( − 1 ) k ) − n ( − 1 ) n . By plugging and testing n = 3 k , n = 3 k + 1 , and n = 3 k + 2 for k ∈ N , we may find that S ( n ) ≡ 0 (mod 3) for all n = 3 k .
Of course, the recurrence equation can simply be tested for small n to find that every diagonal D n such that n ≡ 0 (mod 3) gives S ( n ) ≡ 0 (mod 3) as well. In a given diagonal D n constrained by 1 ≤ x , y ≤ 3 1 , there are 3 1 − ∣ n − 3 1 ∣ lattice points. We sum 3 1 − ∣ n − 3 1 ∣ over all multiples of 3 from 3 to 6 0 . Our answer is the sum ∑ k = 1 2 0 ( 3 1 − ∣ 3 k − 3 1 ∣ ) = 3 2 0
Consider one particular set S x , y and let x + y = k ≥ 4 . How do all the paths in S x , y look like? For any path in S x , y , consider the moment when it first reaches the diagonal x + y = k . Since that moment, the path is uniquely determined: as we cannot use the same vertex twice, we can only walk along the diagonal (using either ( − 1 , 1 ) steps only, or ( 1 , − 1 ) steps only) until we reach ( x , y ) .
Now consider the step in which we reached the diagonal x + y = k . There are two possibilities: First, this can be a step by ( 1 , 1 ) . In that case, what we have before the step is any valid path that ends at the diagonal x + y = k − 2 . Second, it can be a step by ( 1 , 0 ) or by ( 0 , 1 ) . In this case, what we have before can be any valid path that ends at the diagonal x + y = k − 1 .
This is clearly a bijection.
Once again in other words. If we fix a cell at the diagonal x + y = k , we can construct all paths that end in this cell as follows: we can extend any path that ends on x + y = k − 2 in one way, and we can extend any path that ends on x + y = k − 1 in two ways.
From the above argument it follows that for any k ≥ 4 if we consider the sets S x , y for all ( x , y ) such that x + y = k , these sets all have the same size. This is also trivially true for k = 2 and k = 3 .
Thus, let T k = ∣ S k − 1 , 1 ∣ . (Note that we just showed that T k = ∣ S x , y ∣ for any x + y = k .) We clearly have T 2 = 1 and T 3 = 2 . We can now use the above observations to write the following recurrence: ∀ k ≥ 4 : T k = 2 ( k − 2 ) T k − 1 + ( k − 3 ) T k − 2
Computing modulo 3, we can now easily verify that ∀ k : T k ≡ k − 1 ( m o d 3 ) . Thus the answer is the number of ( x , y ) such that 1 ≤ x , y ≤ 3 1 and x + y ≡ 1 ( m o d 3 ) . This is easily computed to be 3 2 0 .
First of all, note that all steps either increase (x+y) by 1 or 2, or keep it constant. That is, once we reach a certain value of coordinate sum, it is not possible to reduce it by taking any more steps.
Next, note that if we reach (x,y) with a step from a coordinate with a lower value of coordinate sum, there is exactly one way to reach any (x',y') with same coordinate sum.
Combining these ideas, we obtain that the total number of ways of reaching any point with given coordinate sum is equal to the total number of ways of reaching some point with that coordinate sum. But from any point (x',y') with coordinate sum x+y - 1 or 2, there is exactly one way to reach some point with x+y as coordinate sum.
Let |S(x,y)| = N(x+y). We obtain the recurrence N(l) = (l-1)N(l-1) + (l-2) N(l-2). With the given starting values N(1)=0,N(2)=1 it is easy to see that N(l) divides 3 iff l=1 mod 3.
Thus we need the number of points with x+y=1 mod 3 and 1<=x,y<=31. There are 320 such points.
I agree with your conclusion,
N(l) divides 3 iff l=1 mod 3.
but I don't think everything is written correctly before that. For one thing, I believe you want
N(l) = 2(l-1)N(l-1) + (l-2) N(l-2)
Log in to reply
Oh, I get it. When I solved the problem, I had seen only the first four step sizes :( That is why I don't have the factor of two. Luckily the error didn't change the final answer.
Problem Loading...
Note Loading...
Set Loading...
We can rotate the coordinate plane 1 3 5 ∘ degrees clockwise, forming a pyramid, and our steps are now:
From this, we can tell that you cannot go up levels, and once you are on a level, there is exactly one way to move to any of the points there (since points can't be repeated). Therefore, every point on a level has the same ∥ S x , y ∥ , and it is equal to the number of ways to get to that level.
Define f ( x ) to be the number of ways to get to a point on level x . For every dot on the previous level, we can go down in two ways (SW and SE), and for every dot two levels above, we can go down in one way (S). Therefore, we have a recurrence relation: f ( x ) = 2 ( x − 1 ) f ( x − 1 ) + ( x − 2 ) f ( x − 2 ) Our initial values are f 1 = 1 and f 2 = 2 . We can calculate modulo 3, since we want to find multiples of 3. Calculating: f 3 ≡ 0 ( m o d 3 ) f 4 ≡ 1 ( m o d 3 ) f 5 ≡ 2 ( m o d 3 ) Now, we have the same values as we started with, and since 1 ≡ 4 ( m o d 3 ) and 2 ≡ 5 ( m o d 3 ) , we have a pattern: 1,2,0,1,2,0,1,2,0...
Therefore, our answer is, since we have a square and are finding every third row. 3 + 6 + 9 + ⋯ + 2 7 + 3 0 + 2 9 + 2 6 + 2 3 + ⋯ + 5 + 2 This is equal to 1 6 5 + 1 5 5 = 3 2 0 .