Probability computation, tossing two dice I have some ideas on how to solve the problem, but simulations do not support my analytical results :)
Toss two dice and sum their value and write it down: Denote by $X_n$ the result at $n$-th toss. Clearly
$$P(X_n = k)=\frac{k-1}{36}.$$
I would like to compute $P(X_{n+1}=X_n)$, that is the probability that two consequent tosses give me the same sum. Of course $X_n$ and $X_{n+1}$ are independent but something tells me that it is not just $\frac{11}{11*11}=\frac{1}{11}$ (which means, the sum is something between 2 and 12 (11 cases), so the difference is 0 in 11 cases out of 11*11).
Any suggestion on how to do it? Empirical results give me something around (0.1125, 0.1179)
Thanks!
 A: I don't think your formula for $P(X_n=k)$ is at all right (assuming fair dice, the probability starts going down at 7).
You do have independence, so it is true that
$$P(X_{n+1}=k\mid X_n=k) = P(X_{n+1}=k);$$
we need to then add all those up for all the possible $k$'s, weighted by the probability that $P(X_n=k)$ happened in the first place.  That is, we need to find
$$\sum_{k=2}^{12} P(X_n=k)\cdot P(X_{n+1}=k \mid X_n=k) = \sum_{k=2}^{12} (P(X_n=k)^2).$$
A: Its easy to do this by brute force with a computer as there are only $6^4 =1296$ possible results each is equally likely.
#include <stdio.h>

int main (void){
    int a,b,c,d,match = 0, count= 0;

    for(a = 1; a<7; a++){
        for(b = 1; b<7; b++){
            for(c=1; c<7; c++){
                for(d=1; d<7; d++){
                    count++;
                    if ((a+b)==(c+d)){
                        match++;
                    }
                }
            }
        }
    }
    printf("there were %d matches in %d trials. Probabilty: %f",
           match, count, (1.0 * match)/count);
    return(0);
}

With the result that the probability is $\frac{146}{1296} = \frac{73}{648} \approx 0.11265$
A: As hinted above, assuming $X_n$ is the sum of dices, $$P(X_n = k)\ne\frac{k-1}{36} $$
But, letting $D_i$, with $i=1,2$ be the value on the ith-die, 
$$P(X_n = k)=\sum_{j=1}^{j<\min(k,6)}P(D_1=i)P(D_2=k-i)= \frac 1 {6^2} \min(k-1,6)$$
Where the last term is multiplied by the ammount of times you iterate the sum. To find the second step, just do as @tabstop showed.
A: You're wrong with your initial assumption. Actually, we have $$P (X_n = k) = \frac {6 - |k - 7|} {36}.$$ Also, the probability you ask for is the sum $$\sum_{k = 1}^{12} (P(X_n = k)^2) = \sum_{k = 1}^{12} \left ( \frac {6 - |k - 7|} {36} \right )^2 = \frac {1} {1296} \sum_{k = 1}^{12} (36 + (k - 7)^2 - 12 |k - 7|) = \frac {12 \cdot 36 + 146 - 12 \cdot 36} {1296} = \frac {146} {1296} = \frac {73} {648}.$$
