Consider a sequence of $ n $ independent bernoulli trials with a success probability of $ p $. Let $ X $ be the number of successes and $ Y $ the number of failures.
Find $ \mathbb{E}\left[XY\right] $.
So, I'm kinda stuck in this exercise. I tried to build a table of the joint distribution and then write down the expected value to find some pattern but it doesn't look very helpful. Any help here?