For part ($a$) we can view walking one block east as an east-step and walking one block north as a north-step. So, different walks correspond to the different combinations of east-steps and north-steps. Thus the number of ways the student can walk $28$ blocks where she walks $12$ east-steps and $16$ north-steps is ${28\choose 12}={28!\over 12!16!}={28\choose 16}$.
For part ($b$) we will first count the number of ways the girl can walk to her friends house. The number of ways she can walk $11$ blocks to her friends house where she takes $5$ east-steps and $6$ north-steps is ${11\choose 5}={11!\over 5!6!}={11\choose 6}$. Now, she must walk the remaining $17$ blocks where she must take $7$ east-steps and $10$ north-steps. So, she can do this in ${17\choose 7}={17!\over 7!10!}={17\choose 10}$ ways. Thus she can walk to school while stopping at her friends house in ${11!\over 5!6!}\cdot {17!\over 7!10!}$ ways.
For $1\le i\le6,\;$ let $a_i$ be the number of dice which have the digit $i$ appearing.
The product of the rolls will be a perfect square when $a_2+a_6,\;$ $a_3+a_6,\;$ and $a_5$ are all even;
so we can consider two cases:
$\textbf{1)}$ When $a_2, a_3, a_6$ are all odd, we get the exponential generating function
$\;\;\;\displaystyle\underbrace{\big(1+x+\frac{x^2}{2!}+\cdots\big)^2}_{a_1, a_4}\underbrace{\big(x+\frac{x^3}{3!}+\frac{x^5}{5!}+\cdots\big)^3}_{a_2, a_3, a_6}\underbrace{\big(1+\frac{x^2}{2!}+\frac{x^4}{4!}+\cdots\big)}_{a_5}$
$\;\;\;\displaystyle=e^{2x}\left(\frac{e^x-e^{-x}}{2}\right)^3\left(\frac{e^x+e^{-x}}{2}\right)=\color{red}{\frac{1}{16}\big(e^{6x}-2e^{4x}-e^{-2x}+2\big)}$
$\textbf{2)}$ When $a_2, a_3, a_6$ are all even, we get the exponential generating function
$\;\;\;\displaystyle\underbrace{\big(1+x+\frac{x^2}{2!}+\cdots\big)^2}_{a_1,a_4}\underbrace{\big(1+\frac{x^2}{2!}+\frac{x^4}{4!}+\cdots\big)^4}_{a_2,a_3, a_5, a_6}$
$\;\;\;\displaystyle=e^{2x}\left(\frac{e^x+e^{-x}}{2}\right)^4=\color{red}{\frac{1}{16}\big(e^{6x}+4e^{4x}+6e^{2x}+e^{-2x}+4\big)}$
Adding the two cases gives the generating function
$\;\;\;\displaystyle g_e(x)=\frac{1}{16}\big[2e^{6x}+2e^{4x}+6e^{2x}+6\big]=\color{red}{\frac{1}{8}\big[e^{6x}+e^{4x}+3e^{2x}+3\big]}$
$\hspace{.3 in}\displaystyle=1+\frac{1}{8}\sum_{n=1}^{\infty}\left(6^n+4^n+3\cdot2^n\right)\frac{x^n}{n!},\;\;$ so there are
$\displaystyle \hspace{.5 in}\color{blue}{\frac{1}{8}\big(6^n+4^n+3\cdot2^n\big)}$ ways to roll $n$ dice and get a product which is a perfect square.
Best Answer
Let's assume the only moves you are allowed are moving north and moving east. Denote a move north as
n
and a move east ase
. Hence, we need to make 7n
moves and 6e
moves, and we seek to compute the number of arrangements of these moves.This is equivalent to the problem
How many distinct rearrangements are there of the above letters. Through some combinatorics, we find the answer is $${13\choose6}=\frac{13!}{6!7!}=\color{red}{1716}$$