In how many ways can the ball come back to $A$ after seven passes? There are 4 basketball players $A,B,C,D$.Initially the ball is with $A$.The ball is always passed from one person to a different person.In how many ways can the ball come back to $A$ after seven passes?
I could somehow get the solution as $2.3^5=486$ passes but I am not sure
about my answer.An answer with full explanation would be helpful.Thanks.
 A: Let $A(n)$ be the number of ways to end at $A$ after $n$ passes.  Let $B(n)$ be the number of ways to end at $B$ after $n$ passes.  Clearly $C(n)=B(n)=D(n)$.
$A(1)=0,B(1)=1$
$A(n+1)=3B(n)$
$B(n+1)=2B(n)+A(n)$
It is now simple to calculate $A(7)$.
When $A$ receives the $n+1^{th}$ pass, the previous player was $B,C or D$ after $n$ passes, so $A(n+1)=B(n)+C(n)+D(n).$
When $B$ receives the $n+1^{th}$ pass, either $A,C or D$ received the nth pass, so $B(n+1)=A(n)+C(n)+D(n)$.
Since $B(n)=C(n)=D(n)$, that means $A(n+1)=3B(n)$.
To calculate $A(7)$, first calculate $A(2)$ and $B(2)$, then $A(3)$ and $B(3)$, and so on.
A: For each number of passes $n$, let $u_n$ be the number of pass sequences ending at $A$ and $v_n$ be the number of pass sequences not ending at $A$. Then we have:
$$u_{n+1} = v_n$$
$$v_{n+1} = 3u_n + 2v_n$$
Substituting $u_n = v_{n-1}$ in the second equation gives
$$v_{n+1} = 3v_{n-1} + 2v_n$$
This is a standard linear recurrence (see for instance this Wikipedia article). The polynomial $x^2-2x-3$ has roots $3$ and $-1$, so $v_n=A\cdot3^n+B\cdot(-1)^n$ for some constants $A$ and $B$. Using the initial values $v_0=0$ and $v_1=3$, we get $A+B=0$ and $3A-B=3$, which gives $A=\frac34, B=-\frac34$.
Hence $v_n = \frac34(3^n-(-1)^n)$, and $u_n$ (which is what we want here) is equal to $v_{n-1} = \frac34(3^{n-1}-(-1)^{n-1}) =\frac143^n + \frac34(-1)^n$.
The final answer is therefore $u_7 = \frac14(3^7-3) = 546$.
A: Let the number of circuits that get back to $A$ after $n$ passes be $f(n)$
We have two cases. Either pass $n-2$ is to $A$ or it is not.
If pass $n-2$ is to $A$, then the pass $n-1$ can be to any other player. Thus, the number of such circuits is $3f(n-2)$.
If pass $n-2$ is not to $A$, then pass $n-1$ is to one of the two people other than $A$ and the person who got pass $n-2$. Thus, we can substitute $A$ for the receiver of pass $n-1$, and get a unique $n-1$ circuit. Thus, the number of such circuits is $2f(n-1)$.
Therefore, we get the recursion
$$
f(n)=2f(n-1)+3f(n-2)
$$
with $f(0)=1$ and $f(1)=0$. This linear recurrence has the solution
$$
f(n)=\frac{3^n+3(-1)^n}4
$$
A: A_ _ _ _ _ _ A : we have to find out in how many ways we can fill the 6 dashes with players B,C,D,A .
Case 1: when A does not gets ball in between. then A can pass the ball in 3 ways (B,C,D) , then B,C OR D can pass the ball in 2 ways and so on...
so we have : 3*2*2*2*2*2 ways in which A gets ball.
Case 2: When A gets ball once in between either in the 2nd, 3rd, 4th or 5th pass. 
then we have 4*(3*3*2*2*2) ways of arranging the players.
Case 3: When A gets ball twice in between ( twice is the maximum times it can get the ball in between):
the two times A gets the pass can be 2nd and 5th, 2nd and 4th, 3rd and 5th. 
so there are 3*(3*3*2*2) ways.
Total: 162+ 96+288=546 
:)
