Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 40121

doubt in calculating expectations

$
0
0

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! and if possible please give some questions to practice :)


Viewing all articles
Browse latest Browse all 40121

Trending Articles