i had recently learned expectation in math and trying to solve : https://www.codechef.com/problems/RRPLAYER
i read the editorial and able to understand it but i want to know where my approach is lacking?
my approach :
E(x) = ((1 + E(x-1))*(1/n) + (2 + E(x-1))*(1/n^2) + ...........)*n
i thought that if we can take any song from list in one attempt(prob : 1/n) and then have to choose (n-1) different songs + (if i choose that song in two attempt (1/n^2) and then choose n-1 left songs E(x-1)) + ........
and finally i can choose any of the songs from the list as my current song(song that i have choosing 1 time+ 2 times+…) so, multiply my answer by n!
can anyone please explain where i am going wrong!
if possible please give some questions to practice