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.
