0

Today for some reason I dreamed about this problem, but I dont remember reading it anywhere. I was curious to know if the problem has a name and what the solution is. I'm no mathematician so I hope I don't make many expression blunders.

Given a random permutation of a set of n elements, Where each element has one, and exactly one matching element in the set different from itself. Find an expressión that calculates the probability of the set, for a given n, to not have any matching pairs contiguous to each other, and the probability of having exactly 1 matching pair contiguous. Do this assuming that the pair relations are not necessarily reciprocal, and again assuming that they are.

Thanks in advance.

Edit:

Lets take for example the case in which the relations are never reciprocal. Using the alphabet, lets asume that each letter matches the next one, for a list of size n, and that the last one matches the first one (otherwise the last element wouldn't have a match, even if the previous element has this one as his matching element, because the relations are never reciprocal). This can be understood as some kind of love triangle, A likes B, B likes C and C likes A.

I made a small program to check all combinations and the number of valid permutations by changing the size n, maybe this will make things a bit more clear:

N = 2 | Valid combinations: 0 | Example: None | Combinations: 2 | Probability: 0.0%

N = 3 | Valid combinations: 0 | Example: None | Combinations: 6 | Probability: 0.0%

N = 4 | Valid combinations: 0 | Example: None | Combinations: 24 | Probability: 0.0%

N = 5 | Valid combinations: 10 | Example: ECADB | Combinations: 120 | Probability: 8.3333%

N = 6 | Valid combinations: 60 | Example: FDBECA | Combinations: 720 | Probability: 8.3333%

N = 7 | Valid combinations: 462 | Example: GECFBDA | Combinations: 5040 | Probability: 9.1667%

N = 8 | Valid combinations: 3920 | Example: HFDGCAEB | Combinations: 40320 | Probability: 9.7222%

N = 9 | Valid combinations: 36954 | Example: IGEHFCADB | Combinations: 362880 | Probability: 10.1835%

N = 10 | Valid combinations: 382740 | Example: JHFIGECADB | Combinations: 3628800 | Probability: 10.5473%

N = 11 | Valid combinations: 4327510 | Example: KIGJHFDBECA | Combinations: 39916800 | Probability: 10.8413%

It seems like the probability of a permutation with no contiguous matching non reciprocal pairs increases as the size increases, which makes sense (I wonder what the probability is for the size of 7 billion).

This is not the same as this question Choose K items from N in a circle because in that question the new list has no matching elements in it, but in this one the list does have all, but ordered in such a way that they arent contiguous. The formula is not appliable.

I did a search of the sequence generated by the permutations, and seems to be similar to the Hertzsprung problem, the specific OEIS sequence for this: https://oeis.org/A002493.

gabriel
  • 41
  • You dream about derangements and recontres numbers. – Phicar Oct 07 '20 at 13:04
  • Hi @Phicar I did a quick search and derangements seem a similar topic, but I think it's a bit different, in a derangement there are fixed points matching the original set to a permutation, in that case for example, the permutation for n = 4 that I mentioned ACBD, wouldn't be valid because the A and the D are in the same position, thus not a derangement. But it is a possible combination for the problem that I present so its something else. Nonetheless the problem seems to be a constrained permutation problem (still don't know which) like derangements are. – gabriel Oct 07 '20 at 14:58
  • Yes, look for recontres numbers. The derangements are part of them in the sense that you fix a fixed number of fixed points. – Phicar Oct 07 '20 at 15:05
  • Hi again @Phicar, I did a search on rencontres numbers, but its not the same tipe of problem, in this case there are no fixed points. Besides that, each element except the first and the last of the list is contiguous to 2 other elements, not 1 element, like could be phrased more or less with rencontres numbers. This problem looks more like a variation of the ménage problem or something similar. – gabriel Oct 08 '20 at 14:23

0 Answers0