I sort of understand linearity of expectation: "Linearity of expectation is the property that the expected value of the sum of random variables is equal to the sum of their individual expected values, regardless of whether they are independent."
But in this case individual expected value shall be P*1 for 1 banana per word. And hence the sum shall be P*N. Please help me understand. Best Vivek On Tue, Apr 25, 2017 at 12:00 AM, Xiongqi ZHANG <[email protected]> wrote: > You need to learn more about linearity of expectation. > > This becomes very obvious when you understand how expectation works. > >> Hi >> >> The explanation says: >> "By linearity of expectation, the expected number of copies is then >> just P multiplied by the number of places the string can occur, which >> is S-L+1. This is a convenient fact to use, because we don't need to >> take into account that the string occurring in one position and the >> string occurring in an overlapping position are not independent >> events." >> >> I didn't understand that how come expected number of copies is P*(S-L+1). >> >> Shouldn't the min_copies be ( P*(S-L+1) )* n, where n is 1+(S-L)/(L-O) >> i.e. maximum number of copies that can fit in S? >> >> Please help me understand this. >> >> Best regards >> Vivek > > -- > You received this message because you are subscribed to the Google Groups > "Google Code Jam" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/google-code/5ce7851a-d6c0-423a-ac56-3b235c7fcee0%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Google Code Jam" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/google-code/CABaJBvL%3DwiF66jMmSfNLDnPYH_JoWYbPm0OyB0z%2BHsmB0NREBQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
