Consider a 8 × 8 grid of city streets, and let S be the points of intersections of the streets and let P be the set of paths from the bottom left corner to the top right corner which consist of only walking to the right and up. A point s is chosen at random from S . The expected number of paths in P which contain s can be expressed as a + c b where a , b , c are positive integers, b and c are coprime, and b < c . What is the value of a + b + c ?
Details and assumptions
There are 8 rows and columns of city streets, and a total of 64 points of intersection in S . (This corresponds to 7 city blocks in each direction.)
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.
Yup. This question was very similar to a question about 2-3 months ago which asked basically the same thing except instead of the expected value of number of paths it asked the probability that a path chosen at random contains it. Anyways, good solution Jimmy as usual.
Absolutely stunning solution! I hacked it out using a combinatorial sum, wish I thought of this! Would have saved me a good hour...
Log in to reply
If something seems like it takes way too much calculation to solve, then you're probably right! I always try to find a more simple solution before deciding to brute force it like that.
Elegant!
Wonderful solution! Especially compared to mine (i.e. calculate expectations for a couple of smaller grids and then use OEIS to find a pattern in the numbers :)
E ( ) = ∑ i = 1 6 4 P ( i ) ∗ (paths through i)
P(i)=1/64 for all points
Total no. of paths from bottom left corner to top right corner is ( 7 1 4 )
Each path goes through 15 points.
E ( ) = 1 / 6 4 ∑ i = 1 6 4 (paths through i)
∑ i = 1 6 4 (paths through i)=total paths*no of points across each path= ( 7 1 4 ) ∗ 1 5 (This is because each path will add 1 each to 15 different points )
Thus the ans. is 1 / 6 4 ∗ ( 7 1 4 ) ∗ 1 5 = 8 0 4 + 3 / 8
At any time, the remaining distance to the top right hand corner will be an integer, say N . Since our grid is 8 × 8 we have 0 ≤ N ≤ 1 4 . At each possible distance, the total number of paths to the top right hand corner will equal the total number of paths in S which is ( 1 4 7 ) = 3 4 3 2
Since we have 1 5 possible distances and the number of paths at each distance is 3 4 3 2 counting the total number of paths through any intersection gives 1 5 × 3 4 3 2 .
Since we had 8 × 8 = 6 4 intersections the expected number of paths is 6 4 3 4 3 2 × 1 5 = 8 0 4 + 8 3 and thus our answer is 8 0 4 + 3 + 8 = 8 1 5
The number of paths is the no. of arrangements of 7 N and 7 E s, which is ( 7 1 4 ) , If we tilt our diagram 45 degress clockwise, we will have 15 rows. Each row will contain the same total no. of paths, since every path from its neighboring row must intersect this row. Hence, expected no. of paths= 6 4 1 5 × ( 7 1 4 ) . Ans= 8 1 5
my solution is similar to Sumit G.
a + c b = # _ o f _ p o i n t s # _ o f _ s t r e e t s × # _ o f _ p o i n t s _ p e r _ s t r e e t
# of streets = ( 7 1 4 )
# of points per street = 15
# of points = 64
6 4 ( 7 1 4 ) ⋅ 1 5 = 6 4 3 4 3 2 ⋅ 1 5 = 8 4 2 9 ⋅ 1 5 = 8 6 4 3 5 = 8 0 4 + 8 3
8 0 4 + 3 + 8 = 8 1 5
{
public static double factorial(int n) {
double result = 1;
for (int i = n; i >= 2; i--) {
result *= i;
}
return result;
}
public static void main(String[] args) {
double sum = 0;
for (int i=1; i<=8; i++) {
for (int j=1; j<=8; j++) {
sum += factorial(i+j-2)*factorial(16-i-j)/(factorial(i-1)*factorial(j-1)*factorial(8-i)*factorial(8-j));
}
}
System.out.println(sum/64);
}
}
sum/64 = 804.375 = 804 + 3/8 = a + b/c => a+b+c = 815
CHEATER!
By the way, you can do much more efficient cheating by coding an nCr method.
Problem Loading...
Note Loading...
Set Loading...
Let N s be the number of paths in P which contain s . We want E [ N s ] .
Count the number of (path,point) pairs ( p , s ) ∈ P × S such that p contains s .
There are 8 ⋅ 8 = 6 4 points in the grid, each having N s paths through it.
So, the total number of (path,point) pairs is ∑ s ∈ S N s = 6 4 E [ N s ] .
Every path takes 7 right steps and 7 up steps in some order.
There are ( 7 7 + 7 ) = 3 4 3 2 such paths, each with 7 + 7 + 1 = 1 5 points on it.
So, the total number of (path,point) pairs is 3 4 3 2 ⋅ 1 5 = 5 1 4 8 0 .
However, both methods must yield the same number of (path,point) pairs.
Thus, 6 4 E [ N s ] = 5 1 4 8 0 ⇝ E [ N s ] = 8 0 4 + 8 3 ⇝ a + b + c = 8 1 5 .