### Trgt_2021_explosion's blog

By Trgt_2021_explosion, history, 7 months ago,

Hi everyone I was solving this problem. I tried a lot for finding a general formula for — How many permutation out of $n!$ will lead to exactly $K$ different chocolates. Then we just have to find probability by dividing with $n!$ and find Expectation by multiplying with $K$ and finally add the expectation for all such $K$ in range $[1,N]$. But I am unable to find a general formula for this. Also I am not able to get the editorial basically proof of that.
Can anyone please provide some idea regarding this. It'll be of great help.

• -10

By Trgt_2021_explosion, history, 9 months ago,

Hi Almighty CF Community,

First I googled a lot but didn't get any explanation.(However code is available)

I feel it difficult to solve problems of type "no of ways to arrange some elements of chess so that they are attacking/not attacking each other." I was solving CSES Two Knights problem and I am struggling to come up by a general formula.

I will request if any one can explain the idea behind such problems in general? or at least for this Two Knights problem.

$If \,you\, know \,some \,chess \,based \,problems, \,I \,will\, request\, you \,to \,please \,share \,it. \,Thanks.$