n students are arranged in a line such that each student is sitting next to their good friends, and each student has no other good friends other than the students they are sitting next to.
If a teacher randomly reallocates their seats, what is the probability P n that none of these n students sit next to their good friends?
Submit your answer as the limit n → ∞ lim P n .
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
I think that the probability for a givent student to sits next to none of their friends is number of non-adjacent to friends places divided by total of possibles places. So if we place the 2 friends first, which both have 2 adjacents seat when n goes infinite, we should end up with p = n − 2 n − 4 . And it turns out that I obtain the same result as you with this formula ! So both were correct ! Interesting ! :D
Log in to reply
Let the student be X and the 2 friends be A and B. Your probability ignores the fringe cases that A is next to or one away from B. Assuming seat n is next to seat 1 (Basically ignoring end seats and treating all seats the same), and ignoring errors from sampling with replacement as before:
P(A is next to B) = n − 1 2 P(X is NOT next to A or B | A is next to B) = n − 2 n − 4
P(A is one away from B) = n − 1 2 P(X is NOT next to A or B | A is one away from B) = n − 2 n − 5
Otherwise P(X is NOT next to A or B) = n − 2 n − 6
Adding these together: n − 1 2 n − 2 n − 4 + n − 1 2 n − 2 n − 5 + n − 1 n − 5 n − 2 n − 6 = ( n − 1 ) ( n − 2 ) n 2 − 7 n + 1 2 = 1 − n 2 − 3 n + 2 4 n − 1 0
This can be worked out simply by placing A and B after X, with probability n − 1 n − 3 n − 2 n − 4 . But this involves placing 2 students for every initial 1. So we must take l i m n → ∞ ( 1 − n 2 − 3 n + 2 4 n − 1 0 ) 2 n = l i m k → ∞ ( 1 − k 2 ) k .
A different way to tackle the problem would be to look at the student to the right of a given one, (If no one is to the right of their friends, no one can be to the left of their friends [assuming seat n is next to seat 1 as n tends to infinity] ):
Assuming Seat n is next to seat 1 again:
P(X is not to the right of A) = n − 1 n − 3
Hence, P(No one is next to their friends) = ( n − 1 n − 3 ) n = ( 1 − n − 1 2 ) n .
Log in to reply
But 1 − n 2 − 3 n + 2 4 n + 1 0 is negative for n in the interval (1,8). Are you sure this is correct?
Log in to reply
@Parth Sankhe – Apologies, should be 4 n − 1 0 . Equal to n − 1 n − 3 n − 2 n − 4 .
Yes, exactly. BTW, this relationship between (1-p)^n and exp(-pn) is used very often in probabilistic methods.
Let the student be X and the 2 friends be A and B. Assuming seat n is next to seat 1 (Basically ignoring end seats and treating all seats the same), and ignoring errors from sampling with replacement as before:
P(A is next to B) = n − 1 2 P(X is NOT next to A or B | A is next to B) = n − 2 n − 4
P(A is one away from B) = n − 1 2 P(X is NOT next to A or B | A is one away from B) = n − 2 n − 5
Otherwise P(X is NOT next to A or B) = n − 2 n − 6
Adding these together: n − 1 2 n − 2 n − 4 + n − 1 2 n − 2 n − 5 + n − 1 n − 5 n − 2 n − 6 = ( n − 1 ) ( n − 2 ) n 2 − 7 n + 1 2 = 1 − n 2 − 3 n + 2 4 n − 1 0
This can be worked out simply by placing A and B after X, with probability n − 1 n − 3 n − 2 n − 4 . But this involves placing 2 students for every initial 1. So we must take l i m n → ∞ ( 1 − n 2 − 3 n + 2 4 n − 1 0 ) 2 n = l i m k → ∞ ( 1 − k 2 ) k .
A different way to tackle the problem would be to look at the student to the right of a given one, (If no one is to the right of their friends, no one can be to the left of their friends [assuming seat n is next to seat 1 as n tends to infinity] ):
Assuming Seat n is next to seat 1 again:
P(X is not to the right of A) = n − 1 n − 3
Hence, P(No one is next to their friends) = ( n − 1 n − 3 ) n = ( 1 − n − 1 2 ) n .
Let's define the random variable X i such that
X i = { 1 , 0 , if i is is sitting next to their good friends otherwise
Notice that, since the students are arranged in a line, student 1 and student n have just one good friend. Hence,
P ( X 1 = 0 ) = P ( X n = 0 ) = n − 1 n − 2
while
P ( X k = 0 ) = ( n − 1 n − 2 ) 2 , 2 ≤ k ≤ n − 1
The number of student sitting next to their good friends is N = i = 1 ∑ n X i . So,
P n = P ( N = 0 ) = P ( X 1 = 0 ∩ X 2 = 0 ∩ ⋯ ∩ X n = 0 ) = ( n − 1 n − 2 ) 2 [ ( n − 1 n − 2 ) 2 ] ( n − 2 ) = ( n − 1 n − 2 ) 2 ( n − 1 )
Eventually
n → ∞ lim P n = n → ∞ lim ( n − 1 n − 2 ) 2 ( n − 1 ) = ( 1 − n − 1 1 ) 2 ( n − 1 ) = e 2 1 ≈ 0 . 1 3 5 3
P ( X 1 = 0 ) = P ( X 1 is placed on the edge again ) n − 1 n − 2 + P ( X 1 is not placed on the edge again ) ( n − 1 n − 2 ) 2 = n ( n − 1 ) 2 ( n − 2 ) + n ( n − 1 ) ( n − 2 ) ( n − 2 ) 2 ( n − 3 ) = n n − 2
Similarly,
P ( X k = 0 ) = n ( n − 1 ) 2 ( n − 3 + n ( n − 1 ) ( n − 2 ) ( n − 2 ) ( n − 3 ) ( n − 4 ) = n ( n − 1 ) ( n − 2 ) ( n − 3 )
Why does everybody here seems to asume that the X_{i} are stochastically independent? I dont think this is generally true with finite n.
Log in to reply
Agreed. Not sure how to upvote this comment
The events X i are not independent for any finite n , but, in the limit as n goes to infinity, cross terms between different X i become negligible.
If you instead look a circle of A i instead, such that A 1 is next to A n , and define Y i = 1 if A i is to the right of a good friend, and 0 otherwise.
For a and b greater than 3 apart, P ( Y a = 0 ) = P ( Y b = 0 ) = n − 1 n − 3 and P ( Y a = 0 , Y b = 0 ) = ( n − 1 ) ( n − 2 ) n 2 − 7 n + 1 4 = ( n − 1 n − 3 ) 2 + ( n − 1 ) 2 ( n − 2 ) 4 .
Similarly, for a next to b , P ( Y a = 0 , Y b = 0 ) = ( n − 1 n − 3 ) 2 − ( n − 1 ) 2 ( n − 2 ) n − 5 .
These examples are both asymptotic to ( n − 1 n − 3 ) 2 as n goes to infinity.
The approximation that the people sit in a circle as apposed to a straight line can be made at this limit.
Agreed. All these solutions are wrong. I manually computed pn for n=4,5,6. If you write pn=an/n! Then a4 = 2 a5 = 14 a6 = 90
Sequence number A002464 at OEIS is “number of permutations of length n without rising or falling successions”.
The probability P n is n ! a ( n ) , as there is n ! possible permutations.
On OEIS, it's written that the sequence has asymptotic n ! a ( n ) ∼ e 2 ( 1 − n 2 2 − 3 n 3 1 0 − n 4 6 − 1 5 n 5 1 5 4 ) .
(I'll write my solution here, since it seems that I cannot add my own solution...) I worked out the exact probability, and my result corresponds to the formula by Max Alekseyev for A002464 .
Let S 1 , … , S n be the students, and let T i be the event that S i sits next to S i + 1 . By the inclusion-exclusion principle we have P n = 1 + k = 1 ∑ n − 1 ∣ A ∣ = k A ⊆ { 1 , … , n − 1 } , ∑ ( − 1 ) k P ( i ∈ A ⋂ T i ) Each chain of consecutive integers in A forms a group of students, who must sit together in order, or in reverse order. Call the number of groups g . E.g. if A = { 1 , 2 , 4 } , then we have two groups: ( S 1 , S 2 , S 3 ) and ( S 4 , S 5 ) , so k = 3 and g = 2 . Note that 1 ≤ g ≤ min ( k , n − k ) always.
For a given A , there are g groups and n − k − g single students, giving ( n − k ) g ways to place the groups, where ( n ) m is the falling factorial. Each group has two possible orderings (ascending and descending), and there are ( n ) k + g ways in total to place the k + g grouped students on the n seats. We get: P ( i ∈ A ⋂ T i ) = ( n ) k + g ( n − k ) g ⋅ 2 g = ( n ) k 2 g
Now lets count the number of sets A with k elements and g chains of consecutive numbers. We might classify the sets into chain-types. E.g. our example set A = { 1 , 2 , 4 } has chain-type ( ∗ ∗ , ∗ ) or ( 2 , 1 ) , since there is one chain of length 2 and one chain of length 1, in that order. There are k elements to be distributed into g distinct, non-empty chains, giving ( g − 1 k − 1 ) chain-types by "stars and bars".
How many sets have a given chain-type? We consider the g chains as bars in another "stars and bars"-argument. All but the last chain must be followed by an element not in A , so we get ( n − 1 ) − ( k + g − 1 ) = n − k − g "stars", which gives ( g n − k ) sets.
Putting it all together: P n = 1 + k = 1 ∑ n − 1 ( n ) k ( − 1 ) k g = 1 ∑ min ( k , n − k ) ( g − 1 k − 1 ) ( g n − k ) 2 g
EDIT: I haven't worked it out, but we also want to show that the above converges to e − 2 for n → ∞ . Notice that the expression can be written as: P n = 1 + k = 1 ∑ n − 1 k ! ( − 1 ) k g = 1 ∑ min ( k , n − k ) ( k n ) ( g − 1 k − 1 ) ( g n − k ) 2 g The fraction with the binomial coefficients seems to converge to 1 for g = k and to 0 otherwise, and the inner sum converges to 2 k , which nicely gives the Taylor series for e − 2 . With some work, I suppose this could be made rigourous.
Problem Loading...
Note Loading...
Set Loading...
The probability that a given student (not the first or last in the line) sits next to none of their friends, is number of non-friends divided by total number of students: p = n n − 2 = 1 − n 2 We want to pick each student in the line, and see how probable it is for them to sit next to a non-friend. For a near infinitely large number of students n , we may ignore terms to the probability that arise from sampling the students without replacement. Therefore we may assume the probabilities of each student sitting next to a non-friend are independent, thus P n = p n . Hence: n → ∞ lim P n = n → ∞ lim p n = n → ∞ lim ( 1 − 2 / n ) n = exp ( − 2 ) ≈ 0 . 1 3 5 3 In the equation above the identity lim n → ∞ ( 1 + a / n ) n = exp ( a ) is used.