How To Solve Bloomberg's Random Seating Interview Question

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ธ.ค. 2024

ความคิดเห็น • 184

  • @shakesmctremens178
    @shakesmctremens178 7 ปีที่แล้ว +14

    Awesome! Keep these probability problems coming.

  • @MrDamojak
    @MrDamojak 7 ปีที่แล้ว +198

    5 people will be seated round the table. What is the probability that 2 people will be seated next to each other?
    Answer: 100%
    Thank me l8r.

    • @rasowa2958
      @rasowa2958 7 ปีที่แล้ว +9

      Unless there is 10 or more seats at the table.

    • @1985gvs
      @1985gvs 7 ปีที่แล้ว +8

      rasowa x no. Even if there are empty seats, they're still next to each other

    • @MrDamojak
      @MrDamojak 7 ปีที่แล้ว +15

      That's my boy.

    • @CoughSyrup
      @CoughSyrup 7 ปีที่แล้ว +2

      Precisely. Furthermore, the word 'randomly' seems to be superfluous. But since it's there, one might deduce that its not to simply mislead, but they are providing you more information about the problem. Since there is no indication that there are distinct spots to randomly assign a person, one might take 'randomly' to mean with random spacing. Given such interpretation, not only is there a 100% chance that 2 people will be adjacent to one another, but there is a greater than 0% probability that two people will be overlapping, or placed directly on top of each other, assuming that zero is a valid value of spacing, to be picked randomly. All this is problematic of course, as the range of valid values, nor is the unit of length specified.

    • @stevethecatcouch6532
      @stevethecatcouch6532 7 ปีที่แล้ว +3

      +1985gvs No they're not. They're next to empty chairs.
      "Next to" may have different meanings in different contexts, although I can't, off the top of my head, think of one in which it would include being separated by empty chairs. When I'm in a theater, I generally prefer not to sit next to a stranger. In that context "next to" means in an immediately adjacent seat. Strangers separated from me by empty seats don't count. The same is true for seats on buses, trains and airplanes.

  • @yaiirable
    @yaiirable 7 ปีที่แล้ว +43

    Theres a simpler way of solving for the row.
    Imagine a circular table with an empty seat somewhere random. This means the people next to the empty seat are the ones at the end of the row.
    This allows you to use the same method as the circular table but adding 1 to n for the empty seat.
    This gives 2/(n + 1 - 1) or 2/n

    • @stevethecatcouch6532
      @stevethecatcouch6532 7 ปีที่แล้ว +3

      Very nice! I think you would get the job.

    • @Lyblix
      @Lyblix 7 ปีที่แล้ว +2

      thats beautiful

    • @joshodom9046
      @joshodom9046 7 ปีที่แล้ว

      That's how I did it; definitely the easy solution

    • @keejj
      @keejj 7 ปีที่แล้ว

      Another easier(?) way: Cut the people sitting in a circle somewhere to get the row. There is 1/n-th of the pairs that is cut. So you need to multiply with (n-1)/n to count for the non-cut pairs.

    • @MindYourDecisions
      @MindYourDecisions  7 ปีที่แล้ว +6

      Wonderful--this is more evidence you guys are the smartest people on TH-cam ;) I had written about linear vs circular seating in one of my puzzle books--too bad I forgot that detail when making this video.

  • @JibranAbbasi_1
    @JibranAbbasi_1 2 ปีที่แล้ว +4

    for the Row Seating (5 people), I think there is an easier way to solve it. While your method definitely makes sense, it may be tricky to come up with the reasoning during an interview. This is how I would solve it.
    We split the question into two parts
    Part 1: How many ways are there to seat 5 people in a row?
    Part 2: How many ways are there to seat 5 people in a row such that 2 specific people are always together?
    Part 1 is simple permutation -> 5!
    Part 2 is also simple permutation -> 4!*2!
    Hence the probability is Part2/Part1 = 4!*2!/5! = 2/5
    This can be generalized to 2/n for the next part

  • @Tehom1
    @Tehom1 7 ปีที่แล้ว +5

    1:06 First, of course, we must nail down the usual thinking-outside-the-box assumptions:
    * We're assuming that it's two pre-labelled people; you're obviously not asking if, after seating, there exist any two people such that they are seated next to each other.
    * We're assuming that the 5 are seated contiguously; we're not putting an empty chair between each pair so that nobody is next to anybody or something like that.
    * Were assuming equiprobable assignments of people to chairs; we are not, say, seating them ordered by some predetermined characteristic such as their height.
    Having idealized it, let's proceed:
    Round table of 5: Initially label two people A and B. Without loss of generality, seat A anywhere and call that the first position. B can be in 4 positions. 2 are adjacent to A, 2 aren't. 50%.
    Straight table of 5: Consider a round table of 6 with 6 people, and label another person C. There is a one-to-one mapping between this and seatings at a round table of 6 with one missing person that preserves is-next-to(A,B) - just remove C.
    There is also an injective mapping between seatings at a round table of 6 with one person missing and seatings at a straight table of 5 that preserves is-next-to(A,B) - just let the people adjacent to the empty seat be at the ends of the straight table. Observe that this mapping meets stronger conditions: it is N-to-1 for a fixed N (in fact N=6), and for every set in the pre-image that maps to one configuration in the image, is-next-to(A,B) is either always true or always false. Together with the equiprobable assignment condition, this tells us that the probability of is-next-to(A,B) is the same in the two situations.
    B can be in 5 positions in the table of 6, of which 2 are adjacent to A. We've shown that the probability here is the same as for the straight table of 5. So 2/5 or 40%.
    The N-person cases are essentially the same as above, just replacing 5 with N:
    Round table of N: B can be in any of N-1 positions, 2 positions satisfy. p(is-next-to(A,B)) = 2/N-1
    Straight table of N: B can be in any of N positions at a table of N+1, 2 satisfy. p(is-next-to(A,B)) = 2/N

  • @ianrayner7522
    @ianrayner7522 7 ปีที่แล้ว +4

    Another nice problem.
    Oddly I didn't use either of the two methods you describe - I just used permutations:
    For the row: number of ways of arranging n different things in a row = n! If we count a sitting next to b as a thing (i.e. (a+b), c, d, e vs. a, b, c, d, e) then there are 2.(n - 1)! arrangements - the multiplication to allow for (a, b) and (b, a). So the odds of a sitting on either the left or the right of b is 2. (n - 1)! / n! = 2 / n.
    For the circle: number of ways of arranging n different things in a circle = (n - 1)! Merge a and b into a single object, and we get 2.(n - 2)! arrangements for a circle - the multiplication is a above. So the odds of a sitting on either the left or the right of b is 2. (n - 2)! / (n - 1)! = 2 / (n - 1). (Note, if you want to count the 5 different start points for the circular arrangements as distinct, then you add in a multiplier of n on the top and the bottom, and they cancel out.)
    Can someone check this: if you further generalize to m out of n people sitting together
    row : m! (n - m + 1)! / n! = 3 / 10 for n=5, m=3
    circle: m! (n - m)! / (n - 1)! = 1 / 2 for n=5, m=3

    • @subtlethingsinlife
      @subtlethingsinlife 7 ปีที่แล้ว

      Ian Rayner I did it the same way . Thanks

    • @charetjc
      @charetjc 7 ปีที่แล้ว

      +Ian Rayner. You lost me when you mentioned "number of ways to arrange n different things in a circle = (n - 1)!".
      Is this because rotational [symmetry?] excludes certain arrangements we would find for rows? E.g. {abcde} on the circle is the same as {bcdea}, {cdeab}, {deabc}, and {eabcd}; likewise for other unique arrangments.

    • @ianrayner7522
      @ianrayner7522 7 ปีที่แล้ว +1

      +boxofrox yes! I just arbitrarily decided to count the arrangements you listed as being indistinct.
      If you want to treat them as distinct, then there are 5 times as many arrangements of 5 in a circle - you listed them for one ordering. There are also 5 times as many arrangements of a pair plus 3 singles. That final point is a little counter-intuitive, but if b is next to a, you still have 5 arrangements because a can be in 5 different locations. Your examples serve to illustrate that too: a is next to b and there are 5 versions of essentially the same ordering!

  • @joshdyer7217
    @joshdyer7217 7 ปีที่แล้ว +1

    Your videos make me feel clinically stupid because I can almost never solve them without looking at the solution despite loving these kinds of puzzles, but I watch them religiously since I'm looking for internships soon and like to learn through osmosis - thanks Presh.

  • @manickn6819
    @manickn6819 7 ปีที่แล้ว +6

    Ok this was too easy. I figured it out without even writing anything.

  • @reynaldowify
    @reynaldowify 5 ปีที่แล้ว

    1/12 is the probility for 2 specific people sit toguether randomly around a round table with five seats randomly assigned. When person A sits on a place, there are 2 possibilities to get just next with person B. But person A can sit in five different places, so the total chances to sit together is 5 X 2=10 And the total of random assignements for each person is 120 since it is 5 factorial It concludes that in a random assignemet for a seat for each person, there is a probability that 2 specific person sit together is 10/120= 1/12
    Thanks for the videos. Enjoy much

    • @reynaldowify
      @reynaldowify 5 ปีที่แล้ว

      Sorry, have said somthing bad, the total manners that 5 persons can be located on 5 chairs is 120, not the possibility of a single person

  • @naomiparsons462
    @naomiparsons462 ปีที่แล้ว +1

    I got them all right, and I know that this is one of your easiest problems and simple probability, but I'm still shamelessly proud! 😂 I'm 14 and potentially want to work with probability.

  • @patrickwienhoft7987
    @patrickwienhoft7987 7 ปีที่แล้ว

    Two faster (and imo more elegant) ways for the row case:
    1 - View the row as a circle with an empty seat (someone already mentioned this in the comments)
    2 - Take the probability of the circular case 2/(n-1). Now cut the circle between two seats and "roll it out". There are n ways to make this cut, but only 1 out of those cases will seperate A and B if they were next to each other. So (n-1)/n cuts will leave A and B next to each other if they were next to each other in the circular case. This gives a pobability of (2/(n-1)) * ((n-1)/n) = 2/n

  • @ProProboscis
    @ProProboscis 7 ปีที่แล้ว +1

    For the round table it doesn't make a difference if we approach the problem in an opposite way but for the row it makes a much more simple approach/formula.
    Instead of considering the 4 others yet to be in place, think of A yet to be in place and B,C,D,E already in (conditional probability is not required).

  • @88Nieznany88
    @88Nieznany88 7 ปีที่แล้ว

    First the circle:
    50% and 2/(n-1) - counted all possiblities for a&b next to each other ( which is n possiblities to place a, 2 to place b, and (n-2)! For others since they permutate)and divided them by all possiblities(simply n!)
    A row: 40% and 2/n
    Here its a bit trickier, first i numered places in a row from 1 to 5 and assumed b would be at the right of a. We have 4 possiblities for a(1 to 4) and 1 for b. Also multiply it by 2 because they can switch places( and when they do, b would be at the left of a)
    I haven't done probablity stuff for like last 3 months ( you know holidays break between secondary school and university) so its really nice training

  • @a1tre680
    @a1tre680 7 ปีที่แล้ว +10

    I have an interesting question I'm not sure I can solve the general case:
    Take a large jar full of "n" marbles, "k" of which are red and "n-k" of which are white.
    Take "s" amount of empty smaller jars, each with an equal capacity of "n/s" marbles.
    Randomly distribute the marbels of the large jar into the smaller jars, where each smaller jar is filled to capacity.
    What is the probability that a majority of the smaller jars will have a majority of red marbles in them?
    For example: n=25, k=11, s=5
    small jar "A" has 3 red and 2 white -> red majority
    small jar "B" has 3 red and 2 white -> red majority
    small jar "C" has 3 red and 2 white -> red majority
    small jar "D" has 1 red and 4 white -> white majority
    small jar "E" has 1 red and 4 white -> white majority
    In total 11 red (=k) and 14 white (=n-k).
    This is 1 case in which a majority of small jars has a majority of red marbles.

    • @windowslogo3577
      @windowslogo3577 7 ปีที่แล้ว +3

      should be white majority everywhere in the world.

    • @ProfessorSyndicateFranklai
      @ProfessorSyndicateFranklai 7 ปีที่แล้ว +1

      Well, what happens if there's a tie?

    • @fnors2
      @fnors2 7 ปีที่แล้ว

      The general solution is not easy to compute, but finding a solution is not complicated, per say.
      This can be done nicely with conditional probabilities.
      First, you compute P(A_i) = P( Jar A has "i" red balls in it ) for i = 0 to s.
      You'd get : P(A_i) = ( k choose i )*(n-k choose n/s - i ) / (n choose n/s ).
      Next, you do the same thing for B conditioned on all possible A_i and the new number of remaining balls of each colors with
      P(B_j | A_i ) = P( Jar B has "j" red balls ) = (k-i choose j)*( (n-k) - (n/s-i) choose s-j ) / (n - n/s choose n/s).
      Keep going like this until you get to the last jar. Then you can find the probability that X jars have a majority of reds.
      Your probability tree will have depth s, with at most n/s + 1 branches at each level, for something in the order of (n/s + 1)^s final possible outcomes to compute.
      You might be able to write the problem differently if you look at the problem as "randomly separating the red balls in boxes". You will still have to do conditional probabilities, though.

    • @ajnelson1431
      @ajnelson1431 7 ปีที่แล้ว +1

      Tough question! You could figure out the total number of ways that k red marbles can be distributed across s jars using the "stars and bars" method, or stirling numbers. But finding the desired number of ways that a majority of jars are red-dominant is difficult. I'd love to hear someone's answer for this.

    • @a1tre680
      @a1tre680 7 ปีที่แล้ว

      Fnors
      That was also my first thought, but then the problem arose that P(B_i) is dependent on P(A_i). If A has 5 red marbles, then the probability that B will have at least 3 reds is smaller than if A only had 3 reds.

  • @L375
    @L375 7 ปีที่แล้ว

    Managed to solve this using an overly-complex factorial-based formula. It still worked in the end!

  • @hanskopf9746
    @hanskopf9746 7 ปีที่แล้ว

    I solved it combinatorically:
    - Round Table:
    - Total possibilities to be seated: n!
    - Total possibilities of a being seated next to b:
    (places for a to sit) * (places for b to sit to sit next to a given seat of a) * (permutation of other people) = n*2*(n-2)!
    Hence, P =n*2*(n-2)!/n! = 2/(n-1)
    - Seated in row:
    Nothing changes except that 'places for b to sit to sit next to a given seat of a' changes from n to n-1
    Hence, P = (n-1)*2*(n-2)!/n! = 2/n

  • @vitriolicAmaranth
    @vitriolicAmaranth 2 ปีที่แล้ว

    For any given location of a, there are four possible locations of b, two of which result in adjacence, so 50%. For the second problem, there are two instances of 25% and three instances of 50%, averaging to 40%. For the third, for circular, 2/(n-1), and for the row, ((n-2)(2/n-1)+2(1/n-1))/n (there may be a simpler way to express that, but I don't think that simplification is as important as arriving at the correct answer). For the fourth... Oh good, there isn't a fourth. What this channel has taught me is I should start applying for jobs at big tech and media companies, since their bar is apparently set at really easy logic and maths puzzles.

  • @Vladislavchooo
    @Vladislavchooo 7 ปีที่แล้ว

    Your approach is way different than mine. Still a very fun problem to solve.
    My answer where n = number of people and m = number of people you want to seat next to each other.
    ((n-m+1)! * m!) / n! + ( ( n - m)! * m! ) / n!
    the first fraction finds the number of ways to seat people together in a row and the second one adds the corrner cases: a (cdefg)b ; b(cdefg)a. Also looks weird for cases where m > 2.

  • @TorgeirKruke
    @TorgeirKruke 7 ปีที่แล้ว

    I would like to see a solution for the second problem building on the answer for the first. Like this: A row of chairs can be seen as a circle of chairs cut at a point between two of the chairs. There are n possible points to make that cut, out of which there are n-1 that won't separate the two people seated next to each other. So the probability for two people to be seated next to each other in a row of n seats will be (n-1)/n times the probability that they are seated next to each other in the ring (which we know from answering the first problem). Alas: ((n-1)/n) * (2/(n-1)). This nicely simplyfies to 2/n.

  • @twwc960
    @twwc960 7 ปีที่แล้ว

    This is way better than your previous video. (The one with the 13 line segments which become 12.)

  • @quantquantquant11235
    @quantquantquant11235 5 ปีที่แล้ว +1

    Another solution: treat (a,b) as one person. Then we have 4 people instead of 5. Number of ways of arranging 4 people on a circular table is 3! and because (a,b) can change position, the total number of ways where (a,b) are paired is 3!*2 = 12. Total number of ways of arranging 5 people on the circular table is 4! = 24, so answer is indeed 12/24 = 0.5. Similarly for the row table, we will have 4!*2/5! = 2/5.

  • @sonicyellow
    @sonicyellow 7 ปีที่แล้ว

    heyy nice i got it
    A person, p, sits next to 2 other people on a circular table.
    If there are n people seated randomly, then p sits next to 2 of the n-1 people remaining.
    Thus, the probability of p sitting next to a specific other person, q, is 2/(n-1).
    A person, p, sits next to either 1 or 2 other people in a linear row.
    Case 1: p is next to one person (on the edges).
    This has a probability of occuring 2/n times.
    The probability of p sitting next to a specific other person, q, is 1/(n-1).
    Case 2: p is next to two other people (not on the edges).
    This has a probability of occurring (n-2)/n times.
    The probability of p sitting next to a specific other person, q, is 2/(n-1).
    Adding the cases together, we have ((2*1)/(n-1) + (2*(n-2))/(n-1))/n
    -> (2/(n-1) + (2n-4)/(n-1))/n
    -> ((2n-2)/(n-1))/n
    -> (2(n-1)/(n-1))/n
    -> 2/n
    Thus, the overall probability of a person, p, sitting next to a specific other person, q, when seated randomly in a row with n people is 2/n.

  • @davidb5205
    @davidb5205 7 ปีที่แล้ว

    Before looking at the answer: 50% for circular table, 40% for row, in a general case for circular table 2/(n-1) and for a row (2n-2)/[n(n-1)]
    Edit: Yay. I got it. Should've simplified the last answer to 2/n, but I still prefer it the way I wrote it because it describes each step of the process.

  • @Skippy3rd
    @Skippy3rd 7 ปีที่แล้ว

    Row can be expressed as a circular table where one person is actually a cut in the table. so p(circular n) = p(row (n + 1)).

  • @user-Number346
    @user-Number346 2 ปีที่แล้ว

    for the row you can just admit that it's a citcle that we've cut so we just have to calculate the probability that two people are next to each other in a circulat table (so 2/(n-1) , here 2/4) and then multyplythe result by the probability that we DO NOT cut the circle right were it will separate the people sat together (so (n-1)/n and here 4/5) wich gives us the probability that two people are sat together in a row : 2(n-1) / (n-1)n = 2/n here 2*4 / 4*5 = 2/5 = 40%

  • @ranjitthakur9852
    @ranjitthakur9852 ปีที่แล้ว +1

    How we count 10pair of sets in 2nd question

  • @AlDunbar
    @AlDunbar 2 ปีที่แล้ว

    My guess is 0.5. For every seating arrangement that the second person sitting in either of the two adjacent seats, there is an arrangement in which that person is seated in the seat on the other side of that seat. And vice versa.

  • @ironicdutchmoonshade
    @ironicdutchmoonshade 7 ปีที่แล้ว +1

    It's interesting that the chance a and b sit next to each other in a line and the chance that a is sitting at the end of the line are the same

  • @MalevolentDivinity
    @MalevolentDivinity 7 ปีที่แล้ว

    Around a circular table, 50%.
    There are two adjacent chairs, two non, the odds of two specific people sitting next to each other is 50%.
    It'd be 2/(x-1).
    In a straight line, the only difference is if person A is at the end of the table.
    So ((x-2)/x)(2/(x-1))+(2/x)(1/(x-1))
    3/5(1/2)+2/5(1/4)
    3/10+2/20
    40% chance.

  • @Ze_No_One
    @Ze_No_One 7 ปีที่แล้ว

    I don't know if it has anything to do with me being a programmer but I figured it out right after u said the question

  • @vivekkumarsingh6349
    @vivekkumarsingh6349 7 ปีที่แล้ว +1

    2/(n-1) for circle
    2/n for row

  • @borstenpinsel
    @borstenpinsel 7 ปีที่แล้ว

    5 at a table. let A have his seat, let B choose one of the remaining 4. there are two seats next to A and 2 seats whic aren't. the probability is 0,5
    5 in a row. Let A choose a seat 2,3 or 4 and there are again 2 seats next to A and 2 are not.
    The chance of A choosing a middle chair is 3/5 and the chance of B chosing a seat next to A is 1/ or 0,5. The probabilty of this constellation is 3/5*1/2 = 3/10
    but A can also choose a seat at the end. the chance of that happening is 2/5
    now B can choose only one seat out of 4 and sit next to A
    The probability of this scenarion is 2/5*1/4=2/20=1/10
    the prob of A sitting next to B is thus 1/10+3/10= 4/10=0,4

  • @oni_thefirst
    @oni_thefirst 7 ปีที่แล้ว +6

    100%
    I would put name tags in each seat
    What?! They say it's good to think outside of the box...

    • @stevethecatcouch6532
      @stevethecatcouch6532 7 ปีที่แล้ว

      All you've done is changed the question to, "what is the probability that a's name tag is next to b's name tag?' If the name tags aren't placed randomly, then the seating is not random.

    • @twinkacast
      @twinkacast 7 ปีที่แล้ว

      100 percent, class people is in each seat.

  • @sonicpawnsyou
    @sonicpawnsyou 7 ปีที่แล้ว +1

    I don't know. The generalized solution looks flawed to me, as it doesn't bound _n_ and therefore you will get a probability of _2_ for n = 2, divide by zero for n = 1, and have _p = -2_ if there are no people. This should really be a piecewise-defined function, e.g. something like this might work:
    p(n) = {
    0, if n ≤ 1.
    1, if n = 2.
    2 / (n - 1) else.

  • @GtmNayan
    @GtmNayan 6 ปีที่แล้ว

    You modified the question. The answer to the original question is 100% since there are always 2 people next to each other.

  • @moochoopr9551
    @moochoopr9551 3 ปีที่แล้ว

    This was a popular question in my high school...
    Probably one of the few probability question I can answer correctly...

  • @JuanMataCFC
    @JuanMataCFC 5 ปีที่แล้ว

    u forget one corner case, when n=2 for the circular table the formula gives P=200% which is ofcourse impossible. other than that this is perfect! :)

  • @iwersonsch5131
    @iwersonsch5131 7 ปีที่แล้ว

    Part 1: 2 out of 4, which equals 50%. Person A is seated at just one of the seats since they're all equal, and Person B can be seated at one out of 4 more seats - 2 next to A and 2 not.
    Part 2: Out of the 5 seats for Person A, 3 provide the same 2/4 chance of being seated next to B, while 2 only more provide a 1/4 chance. Thus, the chance is 6/20+2/20, which is 2/5=40%.
    OVER SEVEN MINUTES?

    • @iwersonsch5131
      @iwersonsch5131 7 ปีที่แล้ว

      Part 3: 2/(n-1) in case 1, and 2/n in case 2.
      As we found out, Person A blocks one chair that Person B cannot sit on.
      In case 2, the first and the last seat are always 2 chairs that each half their probabilities, which just equals out with the chair blocked by Person A.

  • @АлексейБеляев-х1т
    @АлексейБеляев-х1т 7 ปีที่แล้ว

    5 people seated around the table is really a graph on 5 vertices with 5 edges. The full graph on 5 vertices would have (5 choose 2) = 10 edges. Thus, P(A, B are seated together) = P(edge [A,B] is there) = 5/10 = 50%
    Wrote it before watching the video

  • @Rote2Zwei
    @Rote2Zwei 7 ปีที่แล้ว

    Pretty easy (I did it in my head), but way better than the last video!

  • @Vaaaaadim
    @Vaaaaadim 7 ปีที่แล้ว

    I've watched alot of the videos on this channel and haven't watched any in a while, and was caught a bit off guard when he ended the video with "I make video's on math...", because I am accustomed to him saying "videos on math and game theory".

  • @Pantopam
    @Pantopam 7 ปีที่แล้ว

    Here's the way I solved it. I thought I'd share just for fun.
    Circular: There are n! ways to put the people. For *a* there are n places to choose. After that *b* has two options so we have n*2 cases for these. Then we have the remaining n-2 which can be arranged into the free seats (n-2)! ways.
    That gives (2n(n-2)!)/n!=(2n(n-2)!)/((n-2)!(n-1)n)=2/(n-1)
    Row: For this I first ignore the limitations of the corners. First there are again 2n(n-2)! ways to put them so that *a* and *b* are next to each other. Now taking the corners into account there are 2(n-2)! cases so the I need to subtract those those
    (2n(n-2)!-2(n-2)!)/n!=2*(n-2)!(n-1)/((n-2)!(n-1)n)=2/n

  • @ternvall
    @ternvall 7 ปีที่แล้ว +6

    Two People at round table gives 200% chans of being next to eachother as they are om both sides?

    • @furrane
      @furrane 7 ปีที่แล้ว +1

      This is an edge case for this equation, a probability of 2 means nothing.

    • @Tehom1
      @Tehom1 7 ปีที่แล้ว +1

      It means nothing as a probability, but for the expected value of the number of adjacent seatings between A and B it works.

    • @martijnbouman8874
      @martijnbouman8874 7 ปีที่แล้ว +2

      A true programmer would have conditioned on IF n > 2, ... ELSE ...

    • @rmsgrey
      @rmsgrey 7 ปีที่แล้ว

      A true programmer would come up with an empirical solution:
      input n
      let tries=hits=0
      for i = 1 to n-1
      for j = i+1 to n
      if j = i+1 then hits = hits +1
      tries = tries + 1
      next j
      next i
      print hits/tries
      (more optimisation is possible, but at the expense of more time spent coding and/or debugging, which a quick first order optimisation says will swamp any savings in run time or maintainability)

    • @ternvall
      @ternvall 7 ปีที่แล้ว

      I am a true programmer. 😁 💻
      and I am sticking to my answer!

  • @Mirgeee
    @Mirgeee 7 ปีที่แล้ว

    Another way to solve this is simply by counting the two people as one giving (2*3!)/4! in the first and (2*4!)/5! in the second case and so on for general case.

  • @geocarey
    @geocarey 7 ปีที่แล้ว

    What about this variation... Four sets of twins are arranged randomly around a circular table. What is the probability that a twin ends up next to his/her twin? Is the maths the same?

  • @DodoDonnaRS
    @DodoDonnaRS 7 ปีที่แล้ว

    As a programmer, I read this question wrong. I thought it was "How many ways is there all 5 in a row (around the table) Which is easy 2 / (n-1)! And then when he said rows, I was like OH and paused and thought about all 5 in a row(in a row) which is clearly 2/(n)!
    As always, making every question twice as hard as it needs to be.

  • @kirtansrubiktutorials7681
    @kirtansrubiktutorials7681 2 ปีที่แล้ว

    I think it is equal to 4/5! = 4/120 = 1/30. The exclamation is a factorial.

  • @luckydannumber2
    @luckydannumber2 7 ปีที่แล้ว

    You take the probability1 - P(of a and b seated next to each other) gives the answer.
    Similar question what is probably of recieving a hand with all the same suit 1 - 2*(P of all red hand) times 2 for (all black and all red).

  • @timotholen7255
    @timotholen7255 7 ปีที่แล้ว

    For the people in a row I just took the average of seats one has adjacent to it and divided that through the four possible seats was way simpler than calculating the probabilitys

  • @pauljustin9583
    @pauljustin9583 7 ปีที่แล้ว

    Very simple and great explanations. Thank you.

  • @jacksonsay37
    @jacksonsay37 7 ปีที่แล้ว

    Here is a puzzle that you might remember from the same book that you got the Secret Word puzzle from:
    Sam, Alex, and Charlie are related. One is Sam's spouse, another is Alex's sibling, and the third is Charlie's sister in law. Sam's spouse and Alex's sibling are of the same gender. All three are heterosexual, and none of them are incestuous. Which one is a married male?

  • @orionsstardom
    @orionsstardom 7 ปีที่แล้ว

    I got the right answers, but did it differently, using classic probability p = (no of useful outcomes) / (no of total outcomes). For the row, the total outcomes is how many ways n people can sit in a row, which is n! For the total ways with two particular people sitting together, treat those two people as a single person for (n-1)! , which we double because for each of those, the two people can distinctly sit (a, b) or (b, a). So, the probability is p = (n-1)!*2 / n! = 2/n . For the circle, because of rotational symmetry, the total ways are (n-1)! and the ways with two particular people together are (n-2)!*2, giving p = (n-2)!*2 / (n-1)! = 2/(n-1) . This generalises nicely to a group of k (< n) particular people sitting together, which for a row is (n-k+1)!*k!/n! , and for a circle (n-k)!k!/(n-1)!

    • @sairamchittibomma5702
      @sairamchittibomma5702 7 ปีที่แล้ว

      Nice buddy!! This is the ultimate approach, which was not explained in the video....

  • @HenryFabianGT
    @HenryFabianGT 6 ปีที่แล้ว +1

    *Who solved these using permutation? :D*

  • @nidadursunoglu6663
    @nidadursunoglu6663 11 หลายเดือนก่อน

    I have an even easier method than the previous comment. Actually, being in a row is just a little different than a circle. If you imagine that at the end of a row there is a ghost, you would realize both people at the end are sitting next to the ghost. So everthing is the same except there is an extra person whom i called the ghost. There are x people +the ghost in the circle
    2/(n=x+1)-1 =2/(x+1-1)=2=2/(x
    2/x is the same as 2/n cause x was the amount of people.

  • @aelfheim6608
    @aelfheim6608 7 ปีที่แล้ว

    I think if I was asked that at an interview my first question would be "Do you want me to solve this mathematically or write a program to brute force the solution?" Because the program to process the solved equations is extremely trivial.

  • @1337Leva
    @1337Leva 7 ปีที่แล้ว

    I got a slightly different answer, tho.
    For the row example, the amount of possible seating permutations is 5!=120.
    Amount of possible permutations where a and b are seated together is 8.
    So p(a and b together) = 8/120
    Not sure why it is wrong tho...

    • @1337Leva
      @1337Leva 7 ปีที่แล้ว

      awesomeatlife I guess my dumb ass would not get that job. Thanks for the reply :)

    • @anitamcsd1
      @anitamcsd1 6 ปีที่แล้ว

      You can’t forget about the seating of the other three people for each seating of those two. 3! is the amount of seatings of other people for those two. 3!=6. 6x8=48. 48/120=2/5.

  • @eddysteady3354
    @eddysteady3354 7 ปีที่แล้ว +2

    At row seating ,method 1: Why "If person a is in a middle seat" has 3/5 chance? Why it isn't just 1/5?

    • @taggedJC
      @taggedJC 7 ปีที่แล้ว

      Because there are five seats, and three of them are in the middle.

    • @eddysteady3354
      @eddysteady3354 7 ปีที่แล้ว

      taggedJC oh, thanks... I thought he meant in "the" middle seat.

    • @sutfolsemaj
      @sutfolsemaj 7 ปีที่แล้ว +1

      Because there are 3 middle seats. A middle seat doesn't have to be the exact center, just not an edge.

    • @furrane
      @furrane 7 ปีที่แล้ว

      In the context, a middle seat is every seat except the starting or ending one.
      We're spliting the cases because starting and ending seat only have one neighbor, whereas every other seat have two.

  • @ofekzeevi5506
    @ofekzeevi5506 7 ปีที่แล้ว

    Yay! I solved the general cases successfully!

  • @ihordrahushchak5439
    @ihordrahushchak5439 6 ปีที่แล้ว

    import random
    a=[0,1,2,3,4]
    success=0
    amount_of_experiments=0
    for i in range(1000000):
    a=random.sample(a, len(a))
    index=a.index(0)
    if index == 0:
    if a[index+1]==1 or a[len(a)-1]==1:
    success+=1
    elif index == len(a)-1:
    if a[index-1]==1 or a[0]==1:
    success+=1
    else:
    if a[index+1]==1 or a[index-1]==1:
    success+=1
    amount_of_experiments+=1
    print(str(100*success/amount_of_experiments)+'%')
    Output:
    50.0837%

  • @TimesOfSilence
    @TimesOfSilence 7 ปีที่แล้ว +1

    I now learned another word: adjacent

  • @yosid1702
    @yosid1702 7 ปีที่แล้ว +1

    very interesting question

  • @xnick_uy
    @xnick_uy 7 ปีที่แล้ว +3

    The general solution doesn't apply for n = 0, n = 1 or n = 2 n_n'

    • @yaiirable
      @yaiirable 7 ปีที่แล้ว +3

      n = 0 or 1 doesnt make sense.
      n = 2 people can't sit in a circle - only a row. In this case the row solution does work.
      You need n=3 people to be able to form a circle, in which case it does work.

    • @xnick_uy
      @xnick_uy 7 ปีที่แล้ว

      Are you sure? For circular sitting the probability was found to be 2/(n-1), which gives a probability of 2 for n=2 (200% chance!). The n=2 case must be discussed separately.

    • @yaiirable
      @yaiirable 7 ปีที่แล้ว +1

      My point is that 2 people cant sit in a circle. So in the same way that n=0 or n = 1 are undefined because they dont make sense, 2 is the same.
      2 people can sit next to each other in a row, though. So the formula for row (2/n) does work.

    • @neplatnyudaj110
      @neplatnyudaj110 7 ปีที่แล้ว

      Why can't two people sit in a circle? All people have both left and right neighbor(which in the case of 2 people is the same person). Why does adding another person suddenly make it a circle? By your logic you could also say that 3 people is also not a circle, but a triangle.

    • @IQuick143cz
      @IQuick143cz 7 ปีที่แล้ว

      By that logic the question is flawed as 5 people also can't sit in a circle so the Question should say:
      n people sit in a n-sided polygon what is the provability that certain pair of people sit next to each other.
      In that case the logic that n=2 isn't a polygon but a line would apply.
      Also 200% gives sense as in a circle there would be theoreticaly 2 pairs of people sitting next to each other.

  • @tijmenvanarkel2735
    @tijmenvanarkel2735 7 ปีที่แล้ว

    If you have a 60 cards deck and put in 3 cards you want to draw. You draw 7 cards. how are the odds of you just getting one of them.

  • @Sam_on_YouTube
    @Sam_on_YouTube 7 ปีที่แล้ว

    Solved each variation before he finished reading them.

  • @skillet7805
    @skillet7805 7 ปีที่แล้ว

    Its eazy to solve if you create the problem. The answer to an individual baby being boy or girl is always 1in2 so you are wrong. Statistics are not a reality. Stats just play the odds. So you cannot say the answer is anything but 1in2.

  • @MikeDunn
    @MikeDunn 7 ปีที่แล้ว

    I passed exam P in 2014 but forgot some of this stuff.

  • @kookeekwisp
    @kookeekwisp 7 ปีที่แล้ว

    Again you still hold the title of KING when it comes to having little context

  • @furrane
    @furrane 7 ปีที่แล้ว +2

    1/2 and 2/5

    • @furrane
      @furrane 7 ปีที่แล้ว +2

      for n people :
      2/n-1 and (2n-2)/(n(n-1))

    • @furrane
      @furrane 7 ปีที่แล้ว

      YES !

  • @md.mahbubalam3805
    @md.mahbubalam3805 6 ปีที่แล้ว

    (x+x to the power3+x to the power 9+x to the power 27+…………+x to the power 243) devided by (x to the power 2 minus 1)=?

  • @christianfunintuscany1147
    @christianfunintuscany1147 4 ปีที่แล้ว

    Fantastic !!!!

  • @JohnSmithEx
    @JohnSmithEx 7 ปีที่แล้ว

    The recruiters are quickly running out of interview questions!

  • @ethanpfeiffer7403
    @ethanpfeiffer7403 7 ปีที่แล้ว

    I counted using factorials.

  • @bastivaterrodt9025
    @bastivaterrodt9025 5 ปีที่แล้ว

    5:01 is only true for n>2

  • @cmilkau
    @cmilkau 2 ปีที่แล้ว

    wlog start with A's seat as seat 1 (there are 5 rotations of each case, exactly one of each has A in seat 1)
    All: A????, 4! = 24
    Next 1: AB???, 3! = 6
    NotNext1: A?B??, 3! = 6
    NotNext2: A??B?, 3! = 6
    Next 2: A???B, 3! = 6
    Prob = (6 + 6)/24 = 1/2
    This is like a 1 minute solution. Why is this video so long >:-P

  • @ethanpfeiffer7403
    @ethanpfeiffer7403 7 ปีที่แล้ว

    I got the infinite answer but forgot to simplify my factorials.

  • @blazearmoru
    @blazearmoru 7 ปีที่แล้ว

    A, (3 no), (1 yes), (2 attempts... 1 left, 1 right)
    Restructure the problem into marbles. 4 marbles, 3 blue 1 red. Chance to take a red marble out if you take out 2 marbles. 3/4 miss * 2/3 miss rate = 6/12 miss rate. 50% chance of getting red in two attempts.
    Continue this if whatever the fuck n but start with a higher denominator bc more marbles.
    If row then uh... well, shit. Factor in the probability of dude sitting on the sides?
    2/5 chance of 1 attempt. 3/5 chance of two attempts.
    If 2 attempts then 50% = 0.6*0.5 = 0.3
    If 1 attempts then 25% = 0.4*0.25= 0.1
    Add these together to get 0.4 for 40% chance?
    If more than 5 people then increase the 2 attempts & fuck with the probabilities for for 1 and 2 attempts.
    >-> I don't see a common pattern...

  • @bobfrank678
    @bobfrank678 7 ปีที่แล้ว

    Is the question what is the probability that a will be seated next to b (50%) or something else? Edit-literally watched the next 5 seconds lel. Also general case is 2/(n-1)
    Oh the row thing is the actual question
    Is it like 2/(n^2-n)+((n-2)/n)(2/n-1)
    Lol if you expect me to simplify that

  • @Anonymous-jo2no
    @Anonymous-jo2no 7 ปีที่แล้ว

    My high school teacher actually asked this question to my class...

  • @ProfessorSyndicateFranklai
    @ProfessorSyndicateFranklai 7 ปีที่แล้ว

    You should be sponsored by brilliant.org , which is a math problem's website.

    • @cycklist
      @cycklist 7 ปีที่แล้ว +1

      Sir Francis You need an apostrophe lessons website.

  • @fenlet6062
    @fenlet6062 7 ปีที่แล้ว

    Bonus Question: What is probability a,b, and c will be sitting together on a round table? (any order)

  • @AngelWedge
    @AngelWedge 7 ปีที่แล้ว

    Interesting one. I did the row seating by saying the row is the same as a circle with a break in it; so the answer is the same as the circular one, minus the probability that they're sat at opposite ends = 2/n*1/(n-1).

  • @francescocariaggi1145
    @francescocariaggi1145 7 ปีที่แล้ว +1

    Make sure you know how to answer this kind of questions if you are looking for a shitty job!

  • @opytmx
    @opytmx 7 ปีที่แล้ว

    For the row option it should be 2 divided by n, but for the circle version 2 divied by (n-1), because a closed circle eliminates one positional option each of them.

  • @rivenlife6780
    @rivenlife6780 7 ปีที่แล้ว

    For the first one I did (3!*2!)/4!, and for the last one I did (4!*2!)/5!. I can try to explain it if anyone wants

  • @sutfolsemaj
    @sutfolsemaj 7 ปีที่แล้ว

    Part A: 50%. Every person is sitting next to half of the other people.
    Part B: 40%. In 3 out of 5 scenarios, A has 2 neighbors, giving B a 50% chance to be adjacent to him. In the other 2 scenarios, A is on an edge, having only one neighbor and reducing the likelihood of being next to B to 25%. Calculating that out means that putting A and B in random seats leads to a 40% chance that they will be next to each other.

  • @ThatGuy-nv2wo
    @ThatGuy-nv2wo 7 ปีที่แล้ว

    That wasn't hard, might be when you're under stress though if you don't get any paper

  • @yoavshati
    @yoavshati 7 ปีที่แล้ว +2

    For the circle, 2/(n-1)
    For the row, 1/(n-1)

    • @yoavshati
      @yoavshati 7 ปีที่แล้ว +3

      miscalculated, the row one should be 2/n

  • @kirtansrubiktutorials7681
    @kirtansrubiktutorials7681 2 ปีที่แล้ว

    Not 1/30, the answer is 1/15.

  • @kookeekwisp
    @kookeekwisp 7 ปีที่แล้ว

    50%, 40%. easy as pi

  • @ananyagupta1409
    @ananyagupta1409 6 ปีที่แล้ว

    Got it

  • @SwattiClears
    @SwattiClears 7 ปีที่แล้ว

    Stats is not fun.

  • @ArabianShark
    @ArabianShark 7 ปีที่แล้ว

    The phrasing of the problem could have been a little better (consider "What is the probability that *two given people* will be seated next to each other?"), but a fun little problem nonetheless.
    And I got it on the first try.

  • @Ecl1psed276
    @Ecl1psed276 7 ปีที่แล้ว +17

    I literally solved it 5 seconds after you said the problem lol

    • @Fe-tw7gd
      @Fe-tw7gd 7 ปีที่แล้ว +25

      Lol how dumb are you I solved it in 4 seconds

    • @SpencerTwiddy
      @SpencerTwiddy 7 ปีที่แล้ว

      Ecl1psed276 maybe the specific case, not all three (including general)

    • @Ecl1psed276
      @Ecl1psed276 7 ปีที่แล้ว

      I solved the specific case of the circle table in 5 seconds and then I unpaused the video and realized he talked about a general case, and I solved that in 5 more seconds (the exact same way I did the specific case).

    • @iwersonsch5131
      @iwersonsch5131 7 ปีที่แล้ว

      Yeah - I took the odds of writing my solution down. I didn't pause the video and finished before he started.

    • @rmsgrey
      @rmsgrey 7 ปีที่แล้ว

      I got to n/C(n,2) and (n-1)/C(n,2) in my head, but didn't bother expanding and simplifying. On the other hand, I did get there before he finished reading the question out...

  • @Zonnymaka
    @Zonnymaka 7 ปีที่แล้ว

    I solved the row seating problem using the second method...but i solved the circular seating problem in a different way. Fixing A, then B can seat only in the remaining (n-3) seats while all the other (n-2) ppl can seat around him in (n-2)! different ways. So we have (n-3)*(n-2)! where B DOESN'T sit next to A out of (n-1)! total combinations.
    Hence the the prob that A and B sit next to each other around a table is:
    1-[(n-3)*(n-2)!/(n-1)!]= 2/(n-1)

  • @krunalkp1032
    @krunalkp1032 7 ปีที่แล้ว +2

    This question was aked in my 11 th examination .. if this type of que will asked in interview so i will definitly select 😂

  • @usernamenotfound4047
    @usernamenotfound4047 7 ปีที่แล้ว +10

    I'd say your definition is incorrect.
    The probability that 2 people sit next to each other is 100% so the question is flawed.
    But fixing it would be 2 people with following letters sitting together.
    Therefore it should be a&b|b&c|c&d|d&e.
    Which would be 1 - 2/4 * 1/3 * 1/2.
    (The only chance of none of them being next to each other.)
    Which in turn equals 91.7%.
    The other way of seeing it would be the probability of pairs sitting next to each other. In which case a&b|c&d would be a potential "win". In which case it would be a 5/6 or 83.3% chance.
    (You basically only accounted for one pair)
    Coming from a programmer this seems like an imcomplete solution.

    • @franzluggin398
      @franzluggin398 7 ปีที่แล้ว +4

      Hm, a and b are considered "following" letters but e and a are not?
      The question that he was trying to ask was what is the probability of _you_ sitting next to _one specific person_ in a group of size n if you're seated randomly a) around a table or b) in a row.

    • @usernamenotfound4047
      @usernamenotfound4047 7 ปีที่แล้ว

      Franz Luggin I wouldn't consider e and a following. But the same percentage applies. The only way no of the other is following automatically includes a e would not be together.
      (Star Shape principle - giving the furthest distance between each but also equally spacing them)
      And I know what he answered. But he said this question was asked in an interview. And this question is either completely flawed or is trying to figure out your personal definition - which a lot of interview questions are doing.

    • @AdeonWriter
      @AdeonWriter 7 ปีที่แล้ว +5

      Litterally addresed within the first 17 seconds of the video.

    • @shakesmctremens178
      @shakesmctremens178 7 ปีที่แล้ว +1

      It astonishes me the length people go to sometimes just so that they can be wrong.

  • @yuval2be
    @yuval2be 7 ปีที่แล้ว

    :( Solution will apear in... 3 2 1! Advertising

  • @carcaperu4041
    @carcaperu4041 7 ปีที่แล้ว

    If I were asked this problem at a job interview I would walk away because it would be evidence that the job is too simple.

  • @kckcmctcrc
    @kckcmctcrc 7 ปีที่แล้ว

    50%40%

    • @kckcmctcrc
      @kckcmctcrc 7 ปีที่แล้ว

      perhaps the easiest Presh quiz ever.

  • @christopherdahl992
    @christopherdahl992 7 ปีที่แล้ว

    Once again I question your Definition. You fail to define either the number of chairs at the table or the number of seats in a row.
    Therefore any correct answer must account for all possibilities in the number of chairs. One of those infinite possibilities is that there is only one chair. In that case there is ZERO chance any two people, much less a and b, will be seated next to each other.
    If there are an infinite number of seats then there is an infinitesimal chance that any two people, much less a and b, will be seated adjacently.
    Beyond that I will leave you to pursue a refresher course in the proofs of Euclidian geometry. Logic first, then arithmetic.

    • @stevethecatcouch6532
      @stevethecatcouch6532 7 ปีที่แล้ว

      +Christopher Dahl Fewer than n chairs is not possible. The problem description states that the people are seated, so there must be at least as many chairs as people.
      If there are infinitely many seats, then the probability will depend on the probability distribution function and maybe on the meaning of "next to".