There are $n$ people are at a party. The probability that each pair of people is friends is $\frac{1}{2}$ (independent). Let $X$ be the number of triples of people that are friends. Find $E[X]$
For example, in the triple $X,Y,Z$,
$X$ is friends with $Y, Y$ is friends with $Z,$ and $X$ is friends with $Z$.
I think this is similar to the Birthday Paradox/Problem.
This is my approach, can someone tell me if I went wrong somewhere?
The total number of triples is $\binom{n}{3}$
Let $X_{i,j,k}$ be the random variable that is equal to $1$ when person $i$ is friends with person $j$, person $j$ is friends with person $k$ and person $i$ is friends with person $k$, and $0$ otherwise; where $1 \leq i < j < k \leq n$
I'm not sure if this is correct, but $E[X_{i,j,k}] = P(X_{i,j,k}) = (\frac{1}{2})^3$
$E[X]= \sum_{1 \leq i < j < k \leq n} E[X_{i,j,k}] = \frac{\binom{n}{3}}{2^3}$
Note that I'm not sure if $E[X_{i,j,k}] = P(X_{i,j,k}) = n(\frac{1}{2})^3$ because we need to sum over $n$ people
In that case, $E[X] = \frac{n \binom{n}{3}}{2^3}$
The probability that any three selected people are mutual friends is $1/2^3$, due to the independence and identicallity of selection. Let $X_{i,j,k}$ be the indicator function for this event, so the probability of the event is the expectation of the indicator, that is $\mathsf E(X_{i,j,k})$.
Thus the expected count of triples of mutual friends is the expectation of the sum of all indicators for selections of triples.
$$\mathsf E(X)=\sum_{1\leqslant i\lt j\lt k\leqslant n}\mathsf E(X_{i,j,k})=\binom n 3 \dfrac 1{2^3} = \dfrac{n!}{3!\,(n-3)!\, 2^3}$$
EG when $n=4$ then $\mathsf E(X)=\mathsf E(X_{1,2,3}+X_{1,2,4}+X_{1,3,4}+X_{2,3,4})=\tfrac 1{2}$