A and B two people are throwing n fair coins.X and Y are the times they get heads. If throwing coins are mutually independent events,
(1)When n=5, what is the possibility of X=Y?
(2)When n=6, what is the possibility of X=Y+1?
1. **Define the problem and notation:**
   - Let $H$ represent heads and $T$ represent tails.
   - There are $2^5$ possible ordered 5-tuples of $H$'s and $T$'s for 5 throws of a coin.
   - Let $X$ and $Y$ be the number of heads obtained by person A and person B, respectively.
   - We need to find the probability that $X = Y$ when $n = 5$.

2. **Calculate the probability of getting $k$ heads in 5 throws:**
   - The probability of getting $k$ heads in 5 throws of a fair coin is given by the binomial distribution:
     \[
     P(X = k) = {5 \choose k} \left(\frac{1}{2}\right)^k \left(\frac{1}{2}\right)^{5-k} = {5 \choose k} \left(\frac{1}{2}\right)^5
     \]
   - Since the events are independent, the probability that both A and B get exactly $k$ heads is:
     \[
     P(X = k \text{ and } Y = k) = \left({5 \choose k} \left(\frac{1}{2}\right)^5\right)^2
     \]

3. **Sum the probabilities for all possible values of $k$:**
   - We need to sum the probabilities for $k = 0, 1, 2, 3, 4, 5$:
     \[
     P(X = Y) = \sum_{k=0}^5 \left({5 \choose k} \left(\frac{1}{2}\right)^5\right)^2
     \]
   - Simplify the expression:
     \[
     P(X = Y) = \sum_{k=0}^5 \left({5 \choose k} \left(\frac{1}{32}\right)\right)^2 = \sum_{k=0}^5 {5 \choose k}^2 \left(\frac{1}{32}\right)^2 = \frac{1}{1024} \sum_{k=0}^5 {5 \choose k}^2
     \]

4. **Use the identity for the sum of squares of binomial coefficients:**
   - The identity for the sum of squares of binomial coefficients is:
     \[
     \sum_{k=0}^n {n \choose k}^2 = {2n \choose n}
     \]
   - For $n = 5$, we have:
     \[
     \sum_{k=0}^5 {5 \choose k}^2 = {10 \choose 5} = 252
     \]

5. **Calculate the final probability:**
   - Substitute the value back into the expression:
     \[
     P(X = Y) = \frac{1}{1024} \times 252 = \frac{252}{1024} = \frac{63}{256}
     \]

The final answer is $\boxed{\frac{63}{256}}$