Answer the question
In order to leave comments, you need to log in
How to solve this problem according to probability theory?
Couldn't find a solution, can't solve it myself.
Let's imagine such a situation. In my right hand I hold a stack of examination papers. Each has a ticket number, from 1 to n. The order is random. In my left hand I have a pack of these tickets, also n pieces, but already laid out in order. To check the exam paper, I take out a random paper from the right pack and leaf through the tickets in the left pack in order until I find the right number. At the next iteration, I again have to scroll through the tickets from this position until I find the right one, and so on until the end. Question: how many flips should be done on average to check the entire pack? The interest is purely mathematical. The transition from paging to, for example, binary search will reduce the number of paging, but will not fundamentally change its dependence on n.
Answer the question
In order to leave comments, you need to log in
Solution:
The average number of flips to the first ticket is (N-1)/2
The average number of flips between two evenly distributed tickets on the segment 1..N is (N-1)/3,
in total after the first flip it drops out exactly (N-1) such pairs
Total average number of all flips:
(N-1)/2 + (N-1)*(N-1)/3
Which is the answer.
The maximum is given in my previous answer, it fits even after clarification of the conditions.
Since the condition is not complete, namely, it is not indicated whether the ticket is withdrawn from the pack, and the rules for paging are also fuzzy,
I think that it remains - I have the right :-), and I scroll from top
to each ticket with number k, I need to scroll (k-1) times - sum from Sum(k= 1 to N, (k-1)) = (N-1)*N/2
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question