9

6 cans are placed on a shelf in a circular arrangement. After tidying and cleaning the kitchen, the cans are placed again in new, random positions around a circle. What is the probability that none of the cans are in their initial positions or their adjacent?

Isn't it $(\frac{3}{6})^6$?

Pradeep Suny
  • 1,603
  • @all: To avoid confusion, I wish to clarify that my original question is "What is the probability...?". I wrote "isn't it $(\frac{3}{6})^6$ in my attempt to provide a solution. So yes, would you please try to calculate the probability. I don't want to exclude solutions with code, because after all it validates the result, so we have an indication of the correct result! I would like, however, to also have a way of thinking, in order to provide solutions to such problems. Like I said, I did in in Excel, but if, instead of 6, I had 400 cans, I wouldn't be able to calculate anything using excel! – Pradeep Suny Feb 15 '19 at 12:30

2 Answers2

2

If you think it is $(\frac{3}{6})^6$ because you assume these are all independent events ... then you are making a wrong assumption. For example, if the first can is put in the place of where the second can was, then the probability that the second can gets put in a place other than its initial or adjacent position is $\frac{3}{5}$, rather than $\frac{3}{6}$

In general, the placement of cans effects the placement of other cans, making the outcomes of these events dependent on each other.

Bram28
  • 100,612
  • 6
  • 70
  • 118
  • Yes I did it in Excel and found the probability to be 18/720 = 1/40 but I don't know how to calculate it analytically! – Pradeep Suny Feb 14 '19 at 19:18
  • 1
    @PradeepSuny It's a pretty nasty calculation if you try it analytically I would think. For example, there are indeed $3$ ways to put the first can in a position other than where it was or adjacent to that, but the probability of the second can ending up 'elsewhere'; is highly dependent on where exact that first can ends up, and then for the third, it gets more complicated yet. So, if you do it like a tree, you get a lot of different branches. Therefore, just exhausting all possibilities like you did is really not a bad approach! – Bram28 Feb 14 '19 at 19:19
  • Well, the "because" introduces one possibility of going wrong with the answer $(3/6)^6$, we still need some reason it is not this number by coincidence... – dan_fulea Feb 14 '19 at 19:45
  • @dan_fulea Good point! :) – Bram28 Feb 14 '19 at 19:53
  • @Bram28 But the reason is already there, there are at most $3^6$ posibilities by an obious reason, at each place we can make a choice of only three cans, and it is easy to find one case that cannot be completed. – dan_fulea Feb 14 '19 at 19:58
  • @Bram28 you explain why it is not $(\frac{3}{6})^6$ but you don't provide a solution – Sal.Cognato Feb 14 '19 at 20:00
  • @Bram28 my point is that it would be interesting to see a calculation based on probabilities! – Sal.Cognato Feb 14 '19 at 20:01
  • @Sal.Cognato I know ... but as I explained in an earlier comment, the calculations is going to be very tricky, with lots of branches ... not something I have the time for right now :( I just wanted to make the important point to the OP that one cannot assume independence of these events. In fact, they are highly intertwined, making the calculation a mess. – Bram28 Feb 14 '19 at 20:08
0

The combinatorial problem is (relatively) too complicated, and writing some code is (really) too simple, so here is the code and the count:

S = SymmetricGroup(6)
R = Zmod(6)
cansPermutations = \
    [ s for s in S 
      if not {R(0), R(1), R(-1)}.intersection( 
             {R(s(k)-1) - R(k-1) for k in [1..6]}) ]

(This is "all the code".)

Then we ask for the variables.

sage: len(cansPermutations)
20
sage: cansPermutations
[(1,5,3)(2,6,4),
 (1,4)(2,5)(3,6),
 (1,3,5)(2,4,6),
 (1,5,2,4)(3,6),
 (1,3,6,4)(2,5),
 (1,4,6,3)(2,5),
 (1,5,2,4,6,3),
 (1,3)(2,5)(4,6),
 (1,3,5,2,6,4),
 (1,4)(2,6,3,5),
 (1,4,2,5)(3,6),
 (1,5)(2,4)(3,6),
 (1,3,6,4,2,5),
 (1,3,5)(2,6,4),
 (1,4,2,6,3,5),
 (1,4)(2,5,3,6),
 (1,5,3,6,2,4),
 (1,4,6,2,5,3),
 (1,5,3)(2,4,6),
 (1,4)(2,6)(3,5)]

There are $20$ "good permutations".


The question does not make it clear, if we need to compute the probability, or only to show it is not $(3/6)^6$. Here, i will compute explicitly the set of the "good" permutations of the cans. (I.e. of those that move each can $k\in R=\Bbb Z/6$ to some place which is not among $k$ and $k\pm 1$.)

Note that each permutation can be uniquely written as a product of disjoint cycles. We do this with each of the good permutations. No element is fixed, so the lengths of the cycles that appear are at least $2$. We have only the following possibilities to split the total length $6$ in pieces $\ge 2$: $$ \begin{aligned} 6 &= 2+2+2\\ &=2+4\\ &=3+3\\ &=6\ . \end{aligned} $$ Now we count for each split the number of the possibilities to fill in the places.

  • For the type $2+2+2$ we search for permutations of the shape $(1a)(bc)(de)$. If we map $1\to 3$, i.e. $a=3$, then for $5$ we have only the possibility $2$, and there is only one case, $(13)(25)(46)$. Symmetrically, if we decide to map $1\to 5$, then there is only one possibility for the $3$, we get the only case $(15)(36)(24)$. For $1\to 4$ we have after some chase of possibilities only $(14)(25)(36)$ and $(14)(26)(35)$. We have thus $1+1+2=4$ cases in this shape. This combinatorial problem was simple.

  • For the case $3+3$ we have still an easy count. A good permutation of the shape $(1bc)(def)$ must have odd values for $b,c$, else the $4$ is either $b$ or $c$. But the neighbors of $1,4$ cover all possible remaining values, so there is no "good place" for $c$. So $1,b,c$ are the numbers $1,3,5$ in some order (for $3,5$), the remaining $2,e,f$ are $2,4,6$ in some order (of $4,6$). We have thus $2\times 2=4$ cases in this shape. Again a simple case.

  • The next case is $2+4$. Let $(ab)(cdef)$ be such a good permutation, $a<b$. We are conjugating it cyclically, i.e. permute cyclically the letters till $a$ becomes $1$. In this was it is enough to study the good permutations of the shape $(1B)(CDEF)$, then produce all conjugates of it, taking care to not repeat solutions. Since $B\ne 2$, the $2$ is among $C,D,E,F$, and we can and do assume $C=2$. Also, $5$ is among $D,E,F$. The first observation is that $B=4$. Else we may assume (by changing the orientation of the circle) $B=3$, then $2,D,E,F$ are $2,4,5,6$ in some order. So $5\to 2$, but then which number goes to $5$, we have only neighbors left, contradiction. Our permutation is thus $(14)(2DEF)$, and a quick chase validates only $(14)(2536)$ and its invers $(14)(2635)$. Now back to $(ab)(cdef)$. It is clear that $(ab)$ may be only among $(14)$, and/or $(25)$ and/or $(36)$ and in each case we obtain two solutions. So there are $3\times 2$ solutions of this shape.

  • It remains to get the good permutations of shape $6$, i.e. looking like $(1bcdef)$. Maybe the simplest way to proceed is to fix the possible place of the $4$. It cannot be $c$ (and symmetrically in the cycle $e$) because we have no good option for the letter in between, $b$ (and respctively $f$). We can place thus the $4$ on $b$, getting finally only the cases $(142635)$ and $(146253)$, the reversed cycles in the pattern $(1bcde4)$, and two more solutions for the pattern $(1bc4ef)$, which are $(152463)$ and its inverse $(136425)$. So we have $2+2+2$ more solutions.

Totally, there are $4+4+6+6=20$ solutions.

dan_fulea
  • 32,856
  • @Pradeep Sunny above are 20 solutions. Which one is bad? (At any rate, there are only "a few solutions"...) – dan_fulea Feb 14 '19 at 19:42
  • dan_fulea: Can you please explain what does (1,5,3)(2,6,4) stand for? For example, if the original permutation is 1,2,3,4,5,6 (on a circle)? – Pradeep Suny Feb 14 '19 at 19:47
  • The permutations are written in their representation as a product of disjoint cycles, so $(153)(264)$ stays for the permutation doing the following job $1\to 5\to 3\to 1$ and in the same time $2\to 6\to 4\to 2$. Written in this way, it is easy to see if some numbers go to themselves (no, all representations involve all six numbers), or to cyclic neighbours. Explicitly, the "word" 123456 goes to 561234. – dan_fulea Feb 14 '19 at 19:51
  • For the first can, the probability is clearly $(\frac{3}{6})$. For the second, it is $1-(\frac{1}{6}+\frac{1}{6}+\frac{1}{3}*\frac{1}{6})$ - correct? – Sal.Cognato Feb 14 '19 at 21:00
  • @Sal Cognato: Arguments regarding an exact count for "the first can and the second can" need maybe an exact setting, the first can is - say - 1 and all cans are 1,2,3,4,5,6. Then we can pair the 1 in a good way with 3,4,5. Now the second can is 2, to fix this natural choice, but then its possibilities depend on the choice for 1. For $1\to 3$ we still have three possibilities $2\to 4,5,6$ for the second can, but else we lose one of them. So we can count the cases for the first two cans as a block. But still, we have to see if each such case can be (somehow "homogenously"?) extended to a path. – dan_fulea Feb 14 '19 at 22:12
  • Yes but here we are talking about probabilities. I am trying to calculate the individual probability for each can, so as to multiply them all and get the final result. I agree you are right with your result, but for someone not familiar with code, this solution is not an option. – Sal.Cognato Feb 15 '19 at 06:19
  • @Sal Cognato: It is unclear what means "to calculate the individual probability for each can". The other story. To have a solution to which problem? The OP asks if the probability is "simply $(3/6)^6$". It is not, and the simple solution to this problem is to see it is at most $(3/6)^6$ by the obvious reason, and that this boundary is not reached by an other obvious reason. If you have an other problem (like explicitly computing the probability), please post it. Here, in comments, it is hard to provide "a human solution to the exact value of the probability, but without using code". – dan_fulea Feb 15 '19 at 12:16
  • So we know that the overall probability is 20/720 =0.0277. Since we know that for the first can the probability is 3/6, how can we find the probability for the rest of the cases? – Pradeep Suny Feb 15 '19 at 13:31
  • @dan_fulea Hi! Can you explain a bit further all this about the "product of disjoint cycles"? – Jason Feb 15 '19 at 14:41
  • @Jason This is explained using an example here, https://en.wikipedia.org/wiki/Permutation#Cycle_notation . – dan_fulea Feb 15 '19 at 16:01
  • @Pradeep Suny In the question "...how can we find the probability for the rest of the cases?" we have to fix first the model we are working in. If this is a "tree model", then we have to explain this in detail. Here i cannot draw, so i build sentences. We draw a tree, starting from the root with six possible values for the can 1, namely 1,2,3,4,5,6. Now we put some probability on the leafs, $1/6$ at each place. Next, each of the nodes further ramify, we get totally $6\cdot 5$ nodes after mapping the two cans 1, 2. The nodes are maybe labeled as 12, 13, 14, 15, 16, 21, 23, 24, 25, 26, ... – dan_fulea Feb 15 '19 at 16:29
  • Each node after two steps in the tree has equal probability. We continue with all steps. Get all 6! final nodes, they are equally probable. Now note that marking with red the final "good" states we do not have a "homogenous distribution of probability" on the states that may lead to a final red node after two or three or four step. (Some of them like 12 or 31 already fail to be extendable to a red node. But among the others we do not have the same probability. Explicitly. Let say we are in the state 34 after two steps, so $1\to 3$, $2\to 4$, we count the "many chances" to get a red final node – dan_fulea Feb 15 '19 at 16:34
  • And now let count the red final nodes starting from 35. Why should we get the same number? The shape of the final result already tells us, that something does not fit in a "same scheme". (At least as we get the $3$-states ramification. And $20$ is not divisible by $3$.) Again, a question like "how can we find the probability for the rest of the cases?" makes not full sense without fixing some counting model or convention. (Except there is an obvious one. Not for me... All this should be stated in fact in the original post, where we can comment the statement.) – dan_fulea Feb 15 '19 at 16:38