Step step step step step

Probability Level pending

Let S S be the set of { ( 1 , 1 ) , \{(1,1), ( 1 , 1 ) (1,-1) , ( 1 , 1 ) (-1,1) , ( 1 , 0 ) (1,0) , ( 0 , 1 ) } (0,1)\} -lattice paths which begin at ( 1 , 1 ) (1,1) , do not use the same vertex twice, and never touch either the x x -axis or the y y -axis. Let S x , y S_{x,y} be the set of paths in S S which end at ( x , y ) . (x,y). For how many ordered pairs ( x , y ) (x,y) subject to 1 x , y 31 1 \leq x,y \leq 31 , is S x , y |S_{x,y}| a multiple of 3 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 ) (x_1,y_1) to ( x 2 , y 2 ) (x_2,y_2) is ( x 2 x 1 , y 2 y 1 ) (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 S = \{(x_i,y_i)\}_{i=1}^{k} , an S S -lattice path is a lattice path where every step has size which is a member of S S .


The answer is 320.

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.

6 solutions

Daniel Chiu
Jul 22, 2013

We can rotate the coordinate plane 13 5 135^\circ degrees clockwise, forming a pyramid, and our steps are now:

  1. down two levels (S)
  2. down and to the left (SW)
  3. down and to the right (SE)
  4. left (W)
  5. right (E)

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 \|S_{x,y}\| , and it is equal to the number of ways to get to that level.

Define f ( x ) f(x) to be the number of ways to get to a point on level x 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 ) f(x)=2(x-1)f(x-1)+(x-2)f(x-2) Our initial values are f 1 = 1 f_1=1 and f 2 = 2 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_3\equiv 0\pmod 3 f 4 1 ( m o d 3 ) f_4\equiv 1\pmod 3 f 5 2 ( m o d 3 ) f_5\equiv 2\pmod 3 Now, we have the same values as we started with, and since 1 4 ( m o d 3 ) 1\equiv 4\pmod 3 and 2 5 ( m o d 3 ) 2\equiv 5\pmod 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 + + 27 + 30 + 29 + 26 + 23 + + 5 + 2 3+6+9+\cdots+27+30+29+26+23+\cdots+5+2 This is equal to 165 + 155 = 320 165+155=\boxed{320} .

Oops, I just realized I didn't keep my formatting the same; I used both f ( x ) f(x) and f x f_x .

Daniel Chiu - 7 years, 10 months ago
Lawrence Sun
Jul 21, 2013

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 x + y = k and along them. Note that from any point on a line x + y = k 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 N is the number of ways to reach a line x + y = k x+y=k from the point ( 1 , 1 ) (1,1) (but we are not yet moving along the line) then every point on the line has exactly N N ways to reach it when we allow traversing along a line. Now call a n a_n the numbers of ways to get to each point on the line x + y = n x+y = n . It is easy to see that for n 4 n \ge 4 , we have a n = 2 ( n 1 ) a n 1 + ( n 2 ) a n 2 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 ) a_n \equiv n \pmod{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 ) 2(n-1)^2 + (n-2)^2 - n \equiv 3(n^2 - 3n + 2) \equiv 0 \pmod{3} and the base cases are trivial.

Thus the problem is reduced to counting the number of points ( x , y ) (x,y) such that x + y 0 ( m o d 3 ) x + y \equiv 0 \pmod{3} . This is just: 10 11 + 21 10 = 320 10 \cdot 11 + 21 \cdot 10 = \boxed{320} because that are 10 10 cases when 11 11 such points lie on the line x = k x=k , i.e. when k 2 ( m o d 3 ) k \equiv 2 \pmod{3} and 10 10 cases otherwise.

Your induction step is fine, but the induction fails because you have no working base cases. Note that if n = 2 n=2 (i.e. ( x , y ) = ( 1 , 1 ) (x,y)=(1,1) ), then a n = 1 a_{n}=1 . In fact, a n n 1 ( m o d 3 ) a_n \equiv n-1 \pmod{3} , for all positive integers n > 1 n>1 .

Tim Vermeulen - 7 years, 10 months ago

Log in to reply

Oops, for some reason I thought 1 + 1 = 1 1 + 1 = 1 for the point ( 1 , 1 ) (1,1) . This also changes the recursion formula to a n = 2 ( n 2 ) a n 1 + ( n 2 ) a n 2 a_n = 2(n-2)a_{n-1} + (n-2)a_{n-2} so the same general idea still works.

Lawrence Sun - 7 years, 10 months ago

Log in to reply

Typo, I meant ( n 3 ) a n 2 (n-3)a_{n-2} .

Lawrence Sun - 7 years, 10 months ago

Right, I see I also did that last thing wrong.

Tim Vermeulen - 7 years, 10 months ago
Tim Vermeulen
Jul 23, 2013
  • Let Q n Q_n be the set of points ( x , y ) (x,y) with positive integers x , y x,y and x + y = n x+y=n . Note that Q n Q_n is exactly the set of all lattice points in the first quadrant that are on the diagonal through the points ( 0 , n ) (0,n) and ( n , 0 ) (n,0) .
  • Let T n T_n be the set of lattice paths from ( 1 , 1 ) (1,1) to any point in Q n Q_n , with the last step in { ( 1 , 1 ) , ( 1 , 0 ) , ( 0 , 1 ) } \{ (1,1),(1,0),(0,1) \} and all other steps in S S .

    I claim that, for any point ( x , y ) (x,y) in Q n Q_n ,

S x , y = T n . \lvert S_{x,y} \rvert = \lvert T_n \rvert.

This can easily be seen, as in order for a lattice path to go to ( x , y ) (x,y) , it first needs to go to any point in Q n Q_n , and if that point isn't ( x , y ) (x,y) , then it can go to ( x , y ) (x,y) by using the steps ( 1 , 1 ) (-1,1) and ( 1 , 1 ) (1,-1) .

Note that this implies that S x , y S_{x,y} is constant for any point ( x , y ) (x,y) in Q n Q_n .

For all k 3 k \geq 3 ,

T k = 2 ( n 1 ) T k 1 + ( n 2 ) T k 2 , \lvert T_k \rvert = 2(n-1)\lvert T_{k-1} \rvert + (n-2)\lvert T_{k-2} \rvert ,

because from any point ( a , b ) (a,b) in Q k 1 Q_{k-1} (there are k 1 k-1 of those), there are two ways to go to Q k Q_k in one step ( i.e. with ( 1 , 0 ) and ( 0 , 1 ) ) \left(\text{i.e. with }(1,0)\text{ and }(0,1)\right) and S a , b = T k 1 \lvert S_{a,b}\rvert =\lvert T_{k-1} \rvert . Similarly, from any point in Q k 2 Q_{k-2} , there is one way to go to Q k Q_k in one step ( i.e. with ( 1 , 1 ) ) \left(\text{i.e. with }(1,1)\right) .

I claim that for any positive integer n > 1 n > 1 ,

T n n 1 ( m o d 3 ) . \lvert T_n \rvert \equiv n-1 \pmod{3}.

I will prove this by strong induction. It is easy to see that this is true for n { 2 , 3 } n \in \{ 2,3 \} , because T 2 = 1 \lvert T_2\rvert =1 and T 3 = 2 \lvert T_3\rvert =2 . Now, let's assume that it is true for k 2 k-2 and k 1 k-1 , for some positive integer k > 3 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 11 k + 8 k 1. \begin{aligned} \lvert T_k \rvert &= 2(k-1)\lvert T_{k-1} \rvert + (k-2)\lvert T_{k-2} \rvert\\ &\equiv 2(k-1)(k-2) + (k-2)(k-3)\\ &\equiv (2k^2-6k+2) + (k^2-5k+6)\\ &\equiv 3k^2-11k+8\\ &\equiv k-1. \end{aligned}

So, all lattice points ( x , y ) (x,y) such that S x , y \lvert S_{x,y}\rvert is a multiple of 3 3 , are exactly all points in Q 3 k + 1 Q_{3k+1} for some positive integer k k . In other words, S x , y \lvert S_{x,y}\rvert is a multiple of 3 3 if and only if x + y 1 ( m o d 3 ) x+y\equiv 1 \pmod{3} .

We know that 1 x , y 31 1\leq x,y \leq 31 , but if we look at 1 x 30 1\leq x \leq 30 instead, we see that a third of those points ( x , y ) (x,y) satisfies x + y 1 ( m o d 3 ) x+y\equiv 1\pmod{3} , which are 1 3 30 31 = 310 \frac{1}{3} \cdot 30 \cdot 31 = 310 ordered pairs. If x = 31 1 ( m o d 3 ) x=31\equiv 1\pmod{3} , then y y has to be a multiple of 3 3 , and there are 10 10 positive multiples of 3 3 no larger than 31 31 . Hence, the total number of ordered pairs ( x , y ) (x,y) that satisfy the conditions is 310 + 10 = 320 310+10=\boxed{320} .

I've made a mistake:

T k = 2 ( n 1 ) T k 1 + ( n 2 ) T k 2 \vert T_k \rvert = 2(n-1)\vert T_{k-1} \rvert + (n-2)\lvert T_{k-2} \rvert

should be

T k = 2 ( n 2 ) T k 1 + ( n 3 ) T k 2 . \vert T_k \rvert = 2(n-2)\vert T_{k-1} \rvert + (n-3)\lvert T_{k-2} \rvert.

My induction still worked, because for some reason, I said that

2 ( k 1 ) ( k 2 ) = 2 k 2 6 k + 2. 2(k-1)(k-2) = 2k^2-6k+2.

Tim Vermeulen - 7 years, 10 months ago
Michael Lee
Jul 25, 2013

In a given diagonal of the lattice 1 x , y 31 1 \leq x, y \leq 31 , one may only travel within the diagonal in one direction to the point ( x , y ) (x, y) (either ( 1 , 1 ) (-1, 1) , up-and-left, or ( 1 , 1 ) (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 ) (x, y) on diagonal D n D_n , defined as the set of lattice points ( k + 1 , n k ) (k+1, n-k) , 0 k n 1 0 \leq k \leq n-1 , one may travel to it directly from the points ( x 1 , y 1 ) (x-1, y-1) or ( x 1 , y ) (x-1, y) , or any other point on diagonal D n D_n by means of steps of size ( 1 , 1 ) (1, -1) or ( 1 , 1 ) (-1, 1) . We may find that S ( n ) = S x , y S(n) = |S_{x, y}| for a point on diagonal D n D_n is equal to ( n 2 ) S ( n 2 ) + ( n 1 ) S ( n 1 ) (n-2)\cdot S(n-2) + (n-1)\cdot S(n-1) , with S ( 1 ) = 1 S(1) = 1 and S ( 2 ) = 1 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 P_0(n) \cdot S(n) + P_1(n)\cdot S(n+1) + P_2(n)\cdot S(n+2) = 0 , where P 0 ( n ) = n P_0(n) = n , P 1 ( n ) = n + 1 P_1(n) = n+1 , and P 2 ( n ) = 1 P_2(n) = -1 . Thus, j = 0 k P j ( n ) S ( n + j ) = 0 \sum _{j=0}^k P_j(n)\cdot S(n+j) = 0 , where k = 2 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 ) t n n ! Y(t) = \sum _{n=0}^{\infty } a(n) \frac{t^n}{n!} to get j = 0 k P j ( ϕ ) Y [ j ] = 0 \sum _{j=0}^k P_j(\phi ) Y^{[j]} = 0 , where ϕ \phi is the operator t D t = t d d t t D_t = t \frac{d}{dt} . Thus, the recurrence relation for S S has the exponential generating function defined by the differential equation ( t 1 ) Y + ( t + 1 ) Y = 0 Y = t + 1 t 1 Y (t-1) Y'' + (t+1) Y' = 0 \Rightarrow Y'' = -\frac{t+1}{t-1} Y' , Y ( 0 ) = 1 Y'(0) = 1 . Working backwards from our exponential generating function, S ( n ) = n ! Y [ n ] ( 0 ) S(n) = n!\cdot Y^{[n]}(0) , which we may find by some ansatz to be ( n + 1 ) ( n 1 ) ! k = 0 n + 1 ( 1 ) k k ! = ( n + 1 ) ( n 1 ) ! k = 0 n ( ( 1 ) k k ! ) ( 1 ) n n (n+1) (n-1)! \sum _{k=0}^{n+1} \frac{(-1)^k}{k!} = (n+1) (n-1)! \sum _{k=0}^n \left(\frac{(-1)^k}{k!}\right)-\frac{(-1)^n}{n} . By plugging and testing n = 3 k n = 3k , n = 3 k + 1 n = 3k+1 , and n = 3 k + 2 n = 3k+2 for k N k \in \mathbb{N} , we may find that S ( n ) 0 (mod 3) S(n) \equiv 0 \text{ (mod 3)} for all n = 3 k n = 3k .

Of course, the recurrence equation can simply be tested for small n n to find that every diagonal D n D_n such that n 0 (mod 3) n \equiv 0 \text{ (mod 3)} gives S ( n ) 0 (mod 3) S(n) \equiv 0 \text{ (mod 3)} as well. In a given diagonal D n D_n constrained by 1 x , y 31 1 \leq x, y \leq 31 , there are 31 n 31 31-\left| n-31\right| lattice points. We sum 31 n 31 31-\left| n-31\right| over all multiples of 3 3 from 3 3 to 60 60 . Our answer is the sum k = 1 20 ( 31 3 k 31 ) = 320 \sum _{k=1}^{20} (31-\left| 3 k-31\right| ) = \boxed{320}

Michal Forišek
Jul 23, 2013

Consider one particular set S x , y S_{x,y} and let x + y = k 4 x+y=k\geq 4 . How do all the paths in S x , y S_{x,y} look like? For any path in S x , y S_{x,y} , consider the moment when it first reaches the diagonal x + y = k 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 ) (-1,1) steps only, or ( 1 , 1 ) (1,-1) steps only) until we reach ( x , y ) (x,y) .

Now consider the step in which we reached the diagonal x + y = k x+y=k . There are two possibilities: First, this can be a step by ( 1 , 1 ) (1,1) . In that case, what we have before the step is any valid path that ends at the diagonal x + y = k 2 x+y=k-2 . Second, it can be a step by ( 1 , 0 ) (1,0) or by ( 0 , 1 ) (0,1) . In this case, what we have before can be any valid path that ends at the diagonal x + y = k 1 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 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 x+y=k-2 in one way, and we can extend any path that ends on x + y = k 1 x+y=k-1 in two ways.

From the above argument it follows that for any k 4 k\geq 4 if we consider the sets S x , y S_{x,y} for all ( x , y ) (x,y) such that x + y = k x+y=k , these sets all have the same size. This is also trivially true for k = 2 k=2 and k = 3 k=3 .

Thus, let T k = S k 1 , 1 T_k = |S_{k-1,1}| . (Note that we just showed that T k = S x , y T_k = |S_{x,y}| for any x + y = k x+y=k .) We clearly have T 2 = 1 T_2=1 and T 3 = 2 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 \forall k\geq 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 ) \forall k: T_k \equiv k-1 \pmod 3 . Thus the answer is the number of ( x , y ) (x,y) such that 1 x , y 31 1\leq x,y\leq 31 and x + y 1 ( m o d 3 ) x+y\equiv 1\pmod 3 . This is easily computed to be 320 \fbox{320} .

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)

Peter Byers - 7 years, 10 months ago

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.

Raziman Thottungal Valapu - 7 years, 10 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...