Latticeville game!

Esther and Daniel are playing a video game called Latticeville. Each level in Latticeville consists of a grid of m × n m \times n rooms, and the two players start in the room at southwest corner. From each room in the level, the players are only permitted to move north or east. The level ends when both players reach the room at northeast corner. Esther and Daniel want to maximize the number of routes that they can explore collectively, never visiting the same room as the other person does in each route. But there seem to be many different ways to accomplish this.

For m = 5 m=5 and n = 8 , n=8, how many different subsets of rooms can Esther and Daniel visit?

Examples:

  • For m = 3 m = 3 and n = 3 , n = 3, the output should be latticevillePaths(3, 3) = 3. In this level, they can visit a maximum of 8 rooms, and there are 3 ways for them to do that. The three pairs of routes are depicted below.

  • For m = 3 m = 3 and n = 4 , n = 4, the output should be latticevillePaths(3, 4) = 6. They can visit a maximum of 10 rooms in this level, and there are 6 ways to do that, as depicted below.


The answer is 2520.

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.

1 solution

Hana Wehbi
May 23, 2018

Let a 1 , a 2 a_1, a_2 be two sources and b 1 , b 2 b_1,b_2 be two sinks. Note that each path has a distinct source and a distinct sink, illustrated in the figure. Now, that we have a cyclic graph, we can apply Lindstorm-Gessel-Viennot's Lemma. Let p ( m , n ) p(m,n) be the total number of lattice paths going up and right on an m m by n n grid. We let all weights be equal to 1, so we find:

e ( a 1 , b 1 ) = p ( m 1 , n 1 ) e(a_1,b_1)= p(m-1,n-1)

e ( a 1 , b 2 ) = p ( m 2 , n ) e(a_1,b_2)= p(m-2,n)

e ( a 2 , b 1 ) = p ( m , n 2 ) e(a_2,b_1)= p(m,n-2)

e ( a 2 , b 2 ) = p ( m 1 , n 1 ) e(a_2,b_2)= p(m-1,n-1)

Since no path is permutable and we took all weights equal to 1, we find the total number of intersecting paths to be:

p ( m 1 , n 1 ) 2 p ( m 2 , n ) × p ( m , n 2 ) p(m-1,n-1)^2-p(m-2,n) \times p(m,n-2) , using the well-known formula: p ( m , n ) = ( m + n 2 m 1 ) = ( m + n 2 n 1 ) p(m,n)=\tbinom{m+n-2}{m-1}=\tbinom{m+n-2}{n-1} '

the above statement can be expanded as: ( m + n 4 m 2 ) 2 ( m + n 4 m 1 ) ( m + n 4 n 1 ) \dbinom{m+n-4}{m-2}^2-\dbinom{m+n-4}{m-1}\dbinom{m+n-4}{n-1} ,

Taking m = 5 and n = 8 m=5 \text { and } n= 8 , plugging these values in the given formula yields:

( 5 + 8 4 5 2 ) 2 ( 5 + 8 4 5 1 ) ( 5 + 8 4 8 1 ) \dbinom{5+8-4}{5-2}^2-\dbinom{5+8-4}{5-1}\dbinom{5+8-4}{8-1} = ( 9 3 ) 2 ( 9 4 ) ( 9 7 ) = 7056 126 × 36 = 2520 \dbinom{9}{3}^2-\dbinom{9}{4}\dbinom{9}{7} = 7056-126\times 36 = \boxed{2520} ,

Hi. Why is not 20C18 correct?

My go at this problem was to find how many squares each player must have each. For the problem 5x8 grid it is 10 each + 2 together (start & goal). Each player must atleast have the squares at the edge in their domain (the first picture where the arrows follow the edge, they have some squares the other arrow cannot enter). since you cannot enter another players edge squares (which are the 10 distinct square each player at least must have) we can find out how many squares they can share. This is 5x8 -2x10 -2 = 18.

Now we have 3 possibilities, and following the pidgenhole example, the squares can be placed in these 3 "pidgeholes". 1 is in the middle of the arrows, 2 is above the top arrow and 3 is beneath the arrow at the bottom. We follow the pidgenhole example and get: (18+3-1)C18 <=> 20C18 = 190.

Why is this not correct?

Log in to reply

There could be more than one solution. It is not necessarily mine is unique.

Hana Wehbi - 3 years ago

Log in to reply

Hmmm, are you saying that this problem does not have a unique answer?

Pi Han Goh - 3 years ago

Log in to reply

@Pi Han Goh No, l meant probably there are multiple ways to approach the answer. Though, he didn’t get the right answer but l just wanted to clarify that there could another way to tackle this problem.

Hana Wehbi - 3 years ago

Wow! Very impressive. How did you come up with this?

Pi Han Goh - 3 years ago

Log in to reply

Thank you, l did some reading before writing the solution to be on the safe side.

Hana Wehbi - 3 years ago

Log in to reply

What motivates you to use Lindstorm-Gessel-Viennot's Lemma? That is a very advanced combinatorics technique and I don't know how you could have thought about making such a connection...

Pi Han Goh - 3 years ago

The result is correct, but severely lacking is interpretation and checking that your inputs match the conditions of the Lemma.

Setting \cal G \cal{G} to be the weighted, directed graph whose vertices are the squares (bar the bottom left and top right corners), whose edges are all of the form k = ( u , v ) k=(u,v) and of weight w ( k ) : = 1 Z w(k):=1\in\mathbb{Z} where v v is an adjacent square above or to the right of u u , we have as you mentioned to the sources a 1 , a 2 a_{1},a_{2} and two sinks b 1 , b 2 b_{1},b_{2} . As you state, each path from u u to v v , denoted P : u v P:u\rightarrow v , necessarily has weight w ( P ) : = i < P ω ( k i ) = 1 w(P):=\prod_{i<|P|}\omega(k_{i})=1 where k 0 , k 1 , k_{0},k_{1},\ldots are the edges in the path. Thus the e e -term in the Lemma has the value

e ( u , v ) : = P : u v ω ( P ) = { P P a path from u to v } . e(u,v):=\sum_{P:u\rightarrow v}\omega(P)=|\{P\mid P~\text{a path from}~u~\text{to}~ v\}|.

Now we consider twisted path-tuples : P = ( P 1 , P 2 ) \vec{P}=(P_{1},P_{2}) where P 1 : a 1 b σ ( 1 ) P_{1}:a_{1}\rightarrow b_{\sigma(1)} and P 2 : a 2 b σ ( 2 ) P_{2}:a_{2}\rightarrow b_{\sigma(2)} are ‘paths’ in the graph from a 1 a_{1} to b σ ( 1 ) b_{\sigma(1)} resp. from a 2 a_{2} to b σ ( 2 ) b_{\sigma(2)} , whereby σ = σ ( P ) \sigma=\sigma(\vec{P}) is a permutation on { 1 , 2 } \{1,2\} (there are only two). Our goal is actually, to just compute the number of twisted paths P \vec{P} whose components share no nodes in common, and for which σ ( P ) = 1 \sigma(\vec{P})=1 the identity permutation. Call such twisted path-tuples non-entangled . Note that the number of non-entangled twisted path-tuples P \vec{P} with permutation σ ( P ) 1 \sigma(\vec{P})\neq 1 is 0, since in the 2-dimensional grid, a path going from a 1 a_{1} to b 2 b_{2} will necessary cross at some point any path going from a 2 a_{2} to b 1 b_{1} (this is easy to prove, but should nonetheless be proved in a more thorough treatment). We thus obtain the following expression, relevant to the Lemma:

[ m c ] r c l P non-entangled s g n ( σ ( P ) ) i w ( P i ) = P non-entangled, σ ( P ) = ( 12 ) 1 i 1 = 0 , as no such paths exist + P non-entangled, σ ( P ) = 1 1 i 1 = 0 + P non-entangled, σ ( P ) = 1 1 1 = { P non-entangled twisted path-tuples from ( a 1 , a 2 ) t o ( b 1 , b 2 ) } l a t t P a t h s ( m , n ) \begin{array}{c}[mc]{rcl} \sum_{\vec{P}~\text{non-entangled}}\mathrm{sgn}(\sigma(\vec{P}))\cdot\prod_{i}w(P_{i}) &= &\underbrace{ \sum_{\vec{P}~\text{non-entangled,}~\sigma(\vec{P})=(1 2)}-1\cdot\prod_{i}1 }_{=0,~\text{as no such paths exist}} +\sum_{\vec{P}~\text{non-entangled,}~\sigma(\vec{P})=1}1\cdot\prod_{i}1\\ &= &0+\sum_{\vec{P}~\text{non-entangled,}~\sigma(\vec{P})=1}1\cdot 1\\ &= &\underbrace{|\{\vec{P}\mid\text{non-entangled twisted path-tuples from}~(a_{1},a_{2})~\mathrm{to}~(b_{1},b_{2})\}|}_{\mathrm{lattPaths}(m,n)}\\ \end{array}

Now the Lindström–Gessel–Viennot lemma says,

P non-entangled s g n ( σ ( P ) ) i w ( P i ) = det ( w ( \cal G ) ) \sum_{\vec{P}~\text{non-entangled}}\mathrm{sgn}(\sigma(\vec{P}))\cdot\prod_{i}w(P_{i})=\det(w(\cal{G}))

where

w ( \cal G ) = ( [ m c ] c c e ( a 1 , b 1 ) e ( a 1 , b 2 ) e ( a 2 , b 1 ) e ( a 2 , b 2 ) ) = ( [ m c ] c c p ( m 1 , n 1 ) p ( m , n 2 ) p ( m 2 , n ) p ( m 1 , n 1 ) ) . w(\cal{G})=\left(\begin{array}{c}[mc]{cc} e(a_{1},b_{1}) &e(a_{1},b_{2})\\ e(a_{2},b_{1}) &e(a_{2},b_{2})\\ \end{array}\right) =\left(\begin{array}{c}[mc]{cc} p(m-1,n-1) &p(m,n-2)\\ p(m-2,n) &p(m-1,n-1)\\ \end{array}\right).

Putting all of this together, one has

l a t t P a t h s ( m , n ) = P non-entangled s g n ( σ ( P ) ) i w ( P i ) = det ( w ( \cal G ) ) = p ( m 1 , n 1 ) 2 p ( m , n 2 ) p ( m 2 , n ) \mathrm{lattPaths}(m,n) =\sum_{\vec{P}~\text{non-entangled}}\mathrm{sgn}(\sigma(\vec{P}))\cdot\prod_{i}w(P_{i}) =\det(w(\cal{G})) =p(m-1,n-1)^{2}-p(m,n-2)\cdot p(m-2,n)

It remains to determine the expressions p ( , ) p(\cdot,\cdot) . Since p ( m , n ) p(m,n) is the number of paths traversing a 2d grid from ( 1 , 1 ) (1,1) units to ( m , n ) (m,n) using only moves of the form ( 1 , 0 ) (1,0) and ( 0 , 1 ) (0,1) , it is a simple matter of computing the combinatorial number of ways of arranging right-moves and up-moves, which yields the expression p ( m , n ) = ( m 1 + n 1 m 1 ) p(m,n)=\tbinom{m-1+n-1}{m-1} .

R Mathe - 2 years, 11 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...