In a certain exercise of a previous exam, there was a question introduced regarding a safe-deposit box. The "password" or combination of movements that open the box consist on the following: there are $10$ different positions disposed on a circle, and a combination is a list of $5$ movements which consist on spinning the circle so that after those $5$ movements, the final position is the same as the initial one. It has to be taken into account that no movement can consist on doing a full rotation of the circle or wheel, neither consist on not doing anything. I am asked to find how many of these "passwords" are there. Here is my attempt:
Since the positions are distinguishable, one first chooses a position: $10$ options. After that, one can consider the variables $x_1,x_2,x_3,x_4,x_5$, where $x_i$ represents the amount of positions spinned in the $i$-movement. Therefore, since the initial position has to be the same as the final one, the sum of positions spinned has to be $10$, and note that $x_i \geq 1$ since no movement can be "rotating 0 positions". Therefore, and since each movement is distinguishable (the order matters as different order means different "password"), it is the same as counting the number of solutions of $x_1 + x_2 + x_3 + x_4 + x_5 = 10, x_i \geq 1$, which is $9 \choose 4$. Therefore, using the product rule, there are $10 \cdot {9 \choose 4}$ possible "passwords". Is this right?

- 1,275
- 2
- 24
-
2I suggest to check your formula. What happens if we modify a little some numeric values. 10 positions, and only 2 movements, for example, or 10 positions and 20 movements. If you use your formula, and just modify numeric values, is it ok ? – Lourrran Oct 21 '23 at 10:42
-
What should be modified? – Daniel C. Oct 21 '23 at 10:43
-
1If we have 20 movements, and we keep your formula, we obtain $9 \choose 19$, which is $0$ ; so I think your formula is wrong. – Lourrran Oct 21 '23 at 10:45
-
If there were 20 movements, the problem would not make sense since there might be movements that consist on not rotating anything, and in my question I explicitly say that no movement can consist on not rotating anything – Daniel C. Oct 21 '23 at 10:47
-
1Maybee my understanding of the question is not correct (english is not my mother-language), but I think you are wrong. – Lourrran Oct 21 '23 at 10:52
-
1The problem makes perfect sense for 20 movements. – jjagmath Oct 21 '23 at 10:55
-
Therefore it makes sense for 5 movements, which is what I am asked for, right? – Daniel C. Oct 21 '23 at 11:04
-
Can you explain the process, not only copy the original text, but explain the process with your words. Jjjagmaths confirms that even for 20 moves or more, number of possibilities is not 0 (and even more, number of possibilities increases infinitely when the number of moves increase) – Lourrran Oct 21 '23 at 11:13
-
Sorry, I have just noticed that what you said before makes in a part sense, since there could be 20 movements. Well, I have saw that in your answer you used $9 \choose 19$, but that is what you obtain if you consider that there are 20 variables that have to be greater or equal to 1, and there is no solution for that. In the case of 20, aplying my reasoning, it would actually be $k \choose (20-1)$, where $k$ has to be a multiple of 10 and greater or equal to 20 in order that the problem makes sense. If it weren't like that, there would be movements with no rotation, which is contradictory – Daniel C. Oct 21 '23 at 11:20
-
Please read my first 2 answers in detail. What I say is : if your formula is correct, and if we extend the number of moves to 20, YOU will obtain $9 \choose 19$ which is obviously wrong. What I was suggesting in my last message is : describe precisely the process. It doesn't make sense to write mathematic-formulas, as long as the process is not clear. – Lourrran Oct 21 '23 at 11:36
-
$9 \choose 19$ is not my formula, it is an extension of yours. – Lourrran Oct 21 '23 at 11:37
-
After four additional moves, you could rotate around the circle more than once. – N. F. Taussig Oct 21 '23 at 11:44
-
Can you clarify something for me? The way I read the problem, the first four movements are almost arbitrary, with the fifth movement being whatever is needed to take us back to the original spot. "Almost" arbitrary is because if the fourth move takes us already back to the original spot, then the fifth one becomes arbitrary. This doesn't seem to be most people's analysis, however, so could you explain what proviso precludes my analysis? – Brian Tung Oct 21 '23 at 16:48
2 Answers
there are 10 different positions disposed on a circle, and a combination is a list of 5 movements which consist on spinning the circle so that after those 5 movements, the final position is the same as the initial one. It has to be taken into account that no movement can consist on doing a full rotation of the circle or wheel, neither consist on not doing anything.
First of all, I disagree with the posting's analysis that
since the initial position has to be the same as the final one, the sum of positions spinned has to be $10$.
For example, consider the (valid) combination represented by 1-9-2-8-3-1, where the initial position and final position are both $~1.~$
Index the positions by the elements of set $~A = \{1,2,\cdots,10\}.$ You can assume that if $~a,b \in A ~: ~a \neq b,$ and if the $~i$-th position is $~a,~$ and the $~(i+1)$-th position is $~b~$ that (in effect) the corresponding movement was from $~a~$ directly to $~b.~$
Note that in the real world, the previous paragraph would be construed as ambiguous. For example, if the clockwise direction represents that the positions are in increasing order, and if the initial position is $~1,~$ and the position after the first movement is $~2,~$ then going from $~1~$ directly to $~2~$ could be construed as either traveling clockwise along the circle, or counter-clockwise along the circle.
For simplicity, I am going to assume that a combination is completely defined by the the set of successive positions represented by the combination, and that when going from one position to another, it is deemed irrelevant whether you travel in a clockwise or counter-clockwise direction.
Note that if the assumption in the previous paragraph is wrong, the remedy is to simply apply the scalar of $~2^5,~$ since there will always be two possible directions (i.e. clockwise or counter-clockwise) that one can take to make a movement.
So, I am assuming that the problem is asking for an enumeration of how many ordered $~6$-tuples that there are where:
Each of the $~6~$ components of the ordered $~6$-tuple is an element in $~A.$
For $~i \in \{1,2,3,4,5\},~$ component $~i~$ is not equal to component $~i+1.$
Component $~6~$ equals component $~1.$
Normally, I would use Inclusion-Exclusion against a problem like this, as discussed here and here.
The following discussion illustrates a trap in the problem, which makes both Inclusion-Exclusion and a (vanilla) direct approach problematic.
Suppose that the first component of the ordered $~6$-tuple is $~1.$
Then, you can not have any satisfying ordered $~6$-tuple where the fifth component is also $~1.~$ This implies that if the $~4$-th component is $~1,~$ then you have $~9~$ choices for the $~5$-th component. Alternatively, if the $~4$-th component is not $~1,~$ then you have only $~8~$ choices for the $~5$-th component.
To conquer this problem, I am going to re-define the problem, and then use a (somewhat convoluted) form of recursion. First of all, it will be assumed that the first component of the ordered $~k$-tuple is $~1.~$ Then, at the end of the problem, a scalar of $~10~$ will be applied, which represents that there are $~10~$ choices for the first component.
Instead of a combination being represented by a satisfying ordered $~6$-tuple, assume that a combination is represented by a satisfying ordered $~k$-tuple, where $~k \in \{3,4,5,6\},~$ and let $~f(k)~$ denote the number of satisfying ordered $~k$-tuples.
Then, the problem reduces to computing $~f(6).$
Note, that unless otherwise specified, it is assumed that the first component of the ordered $~k$-tuple is $~1.$
To compute $~f(3),~$ note that you have
$~9~$ choices for the second component,
and then $~1~$ choice for the third component.
So,
$$f(3) = 9.$$
To compute $~f(4),~$ note that you have
$~9~$ choices for the second component.
At this point, you are guaranteed that the second component is $~\neq 1.$So, then you have $~8~$ choices for the third component.
That is, the third component must be different from the second component.
Further, the third component must also be $~\neq 1,~$ since [when computing $~f(4)$] the fourth component must be both different from the third component and equal to $~1.$Then, you will have $~1~$ choice for the fourth component.
Therefore,
$$f(4) = 9 \times 8 \times 1 = 72.$$
Now, $~f(6)~$ can be computed.
Either the third component will match the first component, or it won't.
Case 1
The third component matches the first component.
There are $9~$ ways that this can occur. At this point, the third component is $~1,~$ and $~f(4)~$ has been computed to be $~72.$ This means that there are $~72~$ ways of completing the ordered $~6$-tuple so that the third and sixth components are both $~1.$
Therefore, the partial sum for Case 1 is
$9 \times 72 = 648.$Case 2
There are $~9 \times 8 = 72~$ ways that the first and third component can be different. At this point you have to distinguish whether the 4th component is identical to the first component.Case 2.1
There are $~72 \times 1 = 72~$ ways that the fourth component can match the first component, under the assumption that the third component was different from the first component.
When the fourth component matches the first component, then the number of ways of completing the ordered $~6$-tuple corresponds to $~f(3) = 9.$
Therefore, the partial sum for Case 2.1 is
$72 \times 9 = 648.$Case 2.2
There are $~72 \times 8 = 576~$ ways that the fourth component can be different from the first component, under the assumption that the third component was different from the first component.
When the fourth component does not match the first component, then there are only $~8~$ ways of completing the ordered $~6$-tuple, since the fifth component must be different from both the fourth component and the first component.
Therefore, the partial sum for Case 2.2 is
$576 \times 8 = 4608.$
So,
$$f(6) = 648 + 648 + 4608 = 5904.$$
Consequently, since the scalar of $~10~$ must be applied to compensate for there being $~10~$ choices for the first component, the number of satisfying combinations (i.e. ordered $~6$-tuples) is
$$5904 \times 10 =59040.$$

- 35,619
- 3
- 17
- 39
-
Sorry for not having specified it: all movements are on the same way, all are clockwise or the other way around. However, in that case, which I hadn't thought about really, you are right. Thanks – Daniel C. Oct 21 '23 at 21:51
-
I think I don't understand the point of creating $k$-tuples, with $k \leq 3$. Are you applying inclusion-exclusion or likewise? However, I understand your point, I have not taken into account that the sum of positions spinned can be more than $10$, even with my condition. Thanks for your answer btw – Daniel C. Oct 21 '23 at 22:22
-
@DanielC. Creating $~k$-tuples with $~k \in {3,4},~$ facilitated enumerating $~f(6).~$ Initially, I instinctively knew that enumerating $~k~$ for one or more of the elements $~k \in {2,3,4,5},~$ would assist in computing $~f(6);~$ I simply wasn't sure which elements in $~{2,3,4,5}~$ would be useful. Consider computing the partial sum for $~f(6)~$ represented by Case 1. Since the 1st and 3rd component are equal, the number of ways of extending the 3 element combination to 6 elements is exactly equal to $~f(4),~$ since now, the 6th component must equal the 3rd component. – user2661923 Oct 21 '23 at 22:50
-
@DanielC. I am not applying Inclusion Exclusion. Instead, as per my last comment, I am directly computing $~f(6),~$ by examining cases, with a preliminary assist represented by computing $~f(3)~$ and $~f(4).$ – user2661923 Oct 21 '23 at 22:53
-
I have just saw this answer. I have read it again and it now makes sense. Besides, I just realised that there was a solution of this exercise in a website of my college, and the result is exactly the same. Anyway, I liked your approach. Thanks – Daniel C. Oct 22 '23 at 21:44
Cogito
5-number numerical password. 1st number = Last number.
Total number of possible keys = $10^4 = 10000$
However for 1 of these keys, $2^5 = 32$ different movements.
Number of movements = $32 \times 10000 = 320000$

- 951
-
-
@EtackSxchange: Literally, it means "I think." I'm not sure what Agent Smith intends by that here—maybe some doubt in their analysis? – Brian Tung Oct 21 '23 at 16:45
-
@BrianTung Possibly there's doubt in it. The word is written in italic. So they're emphasizing it's their doubtful thought. BTW, is that in Latin? – Oct 21 '23 at 16:48
-
@EtackSxchange: It is, as in Descartes's famous "Cogito ergo sum." Incidentally, I think the italics are because it's a foreign word, so to speak, not from emphasis. – Brian Tung Oct 21 '23 at 16:52
-
@EtackSxchange, on targed, Cogito = I think, and si, from Descartes' Cogito, ergo sum. – Agent Smith Oct 24 '23 at 00:04