Loading web-font TeX/Main/Regular

Problem #168

L's Ideology

L is sure that Light is kira and Misa is second Kira . He randomly selects two permutation of 1 to N and store it in A[0],A[1],...A[N-1] and B[0],B[1],...B[N-1]. All permutations are equally probable . Now he randomly selects a integer X , 0 <= X < N , and shifts permutation B to left by X .

For Example - [ 2,3,1,4,5 ] be a permutation , shifting it left by 2 will result [ 1,4,5,2,3 ].

He defines another sequence g[i] = (A[i] * 1) mod B[i] + (A[i] * 2) mod B[i] + (A[i] * 3) mod B[i] ...... (A[i] * B[i]) mod B[i] .

Find expected value of g[0]+g[1]+ ........ + g[N-1] for N = 1111.

Answer greatest integer of expected value.

Contributed by sajal sourav

Solved by 20 users

Log in to submit answers.

Is something wrong?

Maintaining a collection of high quality questions is our top priority. If, however, you do find an error, report the problem and we'll make sure it is reviewed soon.