Doubt in expected value

how is expected value for arr= [1,2] at l,r==1

(1/2)(1/2)(1)

what exactly we have to find in the whole problem

Hey @SATVIK
So first we need to find probability of an index getting picked
So we have to pick two indexes L and R from a set of N values ( 1 to N )
So probability of picking an index is 1/2 ( We need to pick 1 index out of N = 2 values )
Similar is for R
Now finally number of unique elements in region [1,1] which is 1
So expected probability becomes 1/2 ( for L ) * 1/2 ( for R ) * 1 ( Unique elements )

If your doubt is resolved please close it.

1 Like

Ya, but isn’t the expected probability is E(x) = 1/p
so by that it should be E(x)= 1/((1/2)*(1/2))
as probability of picking 1(no of unique elements) / (no of possible positions)

@SATVIK
The basic expected value formula is the probability of an event multiplied by the amount of times the event happens: (P(x) * n). The formula changes slightly according to what kinds of events are happening.

P(x) being 1/2 * 1/2 here which n being 1