7 dancers on a circle

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
9
down vote

favorite
3













7 dancers are going to participate in a contest. They are initially placed in their positions basis the initial letter of their surname.
At the second part of the contest, they are given random positions around the circle, which are determined by a draw. What is the probability that none of the dancers are in their initial positions or their neighboring?




It seems very simple to me but obviously isn't. For each dancer, the probability is $frac47$ so for all 7 it is $frac4^77^7$ – very simplistic, no?










share|cite|improve this question























  • Why $4/7$? I would have understood your intention if you had said $6/7$ (which still does not give the right answer, unless the random assignment allows several dancers in the same position)
    – Hagen von Eitzen
    3 hours ago











  • @HagenvonEitzen: I said 4/7 because if they are not allowed their initial position and the two neighboring, then, out of the 7 positions, they are only allowed in the 4, right?
    – Tom Galle
    3 hours ago










  • Are the positions of the circle absolute or are they determined relative to the other dancers? Otherwise, everyone could move at least two spaces away from their position, but the configuration could still be the same afterwards.
    – Paul
    3 hours ago










  • Be careful. If the first dancer moves to position 3, the second dancer has 5 slots from which to pick. So there are more cases than what you're thinking or you may have to think about the problem differently.
    – Joel Pereira
    3 hours ago










  • You can't just multiply the probabilities, because the events are not independent. Suppose that dancers $1,2,$ and $3$ are assigned to positions $4,5,$ and $6$ in the second round. Then the probability that dancer $5$ is assigned to an admissible position is $1.$
    – saulspatz
    3 hours ago














up vote
9
down vote

favorite
3













7 dancers are going to participate in a contest. They are initially placed in their positions basis the initial letter of their surname.
At the second part of the contest, they are given random positions around the circle, which are determined by a draw. What is the probability that none of the dancers are in their initial positions or their neighboring?




It seems very simple to me but obviously isn't. For each dancer, the probability is $frac47$ so for all 7 it is $frac4^77^7$ – very simplistic, no?










share|cite|improve this question























  • Why $4/7$? I would have understood your intention if you had said $6/7$ (which still does not give the right answer, unless the random assignment allows several dancers in the same position)
    – Hagen von Eitzen
    3 hours ago











  • @HagenvonEitzen: I said 4/7 because if they are not allowed their initial position and the two neighboring, then, out of the 7 positions, they are only allowed in the 4, right?
    – Tom Galle
    3 hours ago










  • Are the positions of the circle absolute or are they determined relative to the other dancers? Otherwise, everyone could move at least two spaces away from their position, but the configuration could still be the same afterwards.
    – Paul
    3 hours ago










  • Be careful. If the first dancer moves to position 3, the second dancer has 5 slots from which to pick. So there are more cases than what you're thinking or you may have to think about the problem differently.
    – Joel Pereira
    3 hours ago










  • You can't just multiply the probabilities, because the events are not independent. Suppose that dancers $1,2,$ and $3$ are assigned to positions $4,5,$ and $6$ in the second round. Then the probability that dancer $5$ is assigned to an admissible position is $1.$
    – saulspatz
    3 hours ago












up vote
9
down vote

favorite
3









up vote
9
down vote

favorite
3






3






7 dancers are going to participate in a contest. They are initially placed in their positions basis the initial letter of their surname.
At the second part of the contest, they are given random positions around the circle, which are determined by a draw. What is the probability that none of the dancers are in their initial positions or their neighboring?




It seems very simple to me but obviously isn't. For each dancer, the probability is $frac47$ so for all 7 it is $frac4^77^7$ – very simplistic, no?










share|cite|improve this question
















7 dancers are going to participate in a contest. They are initially placed in their positions basis the initial letter of their surname.
At the second part of the contest, they are given random positions around the circle, which are determined by a draw. What is the probability that none of the dancers are in their initial positions or their neighboring?




It seems very simple to me but obviously isn't. For each dancer, the probability is $frac47$ so for all 7 it is $frac4^77^7$ – very simplistic, no?







probability combinatorics






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited 2 hours ago









Parcly Taxel

36.8k137095




36.8k137095










asked 3 hours ago









Tom Galle

1584




1584











  • Why $4/7$? I would have understood your intention if you had said $6/7$ (which still does not give the right answer, unless the random assignment allows several dancers in the same position)
    – Hagen von Eitzen
    3 hours ago











  • @HagenvonEitzen: I said 4/7 because if they are not allowed their initial position and the two neighboring, then, out of the 7 positions, they are only allowed in the 4, right?
    – Tom Galle
    3 hours ago










  • Are the positions of the circle absolute or are they determined relative to the other dancers? Otherwise, everyone could move at least two spaces away from their position, but the configuration could still be the same afterwards.
    – Paul
    3 hours ago










  • Be careful. If the first dancer moves to position 3, the second dancer has 5 slots from which to pick. So there are more cases than what you're thinking or you may have to think about the problem differently.
    – Joel Pereira
    3 hours ago










  • You can't just multiply the probabilities, because the events are not independent. Suppose that dancers $1,2,$ and $3$ are assigned to positions $4,5,$ and $6$ in the second round. Then the probability that dancer $5$ is assigned to an admissible position is $1.$
    – saulspatz
    3 hours ago
















  • Why $4/7$? I would have understood your intention if you had said $6/7$ (which still does not give the right answer, unless the random assignment allows several dancers in the same position)
    – Hagen von Eitzen
    3 hours ago











  • @HagenvonEitzen: I said 4/7 because if they are not allowed their initial position and the two neighboring, then, out of the 7 positions, they are only allowed in the 4, right?
    – Tom Galle
    3 hours ago










  • Are the positions of the circle absolute or are they determined relative to the other dancers? Otherwise, everyone could move at least two spaces away from their position, but the configuration could still be the same afterwards.
    – Paul
    3 hours ago










  • Be careful. If the first dancer moves to position 3, the second dancer has 5 slots from which to pick. So there are more cases than what you're thinking or you may have to think about the problem differently.
    – Joel Pereira
    3 hours ago










  • You can't just multiply the probabilities, because the events are not independent. Suppose that dancers $1,2,$ and $3$ are assigned to positions $4,5,$ and $6$ in the second round. Then the probability that dancer $5$ is assigned to an admissible position is $1.$
    – saulspatz
    3 hours ago















Why $4/7$? I would have understood your intention if you had said $6/7$ (which still does not give the right answer, unless the random assignment allows several dancers in the same position)
– Hagen von Eitzen
3 hours ago





Why $4/7$? I would have understood your intention if you had said $6/7$ (which still does not give the right answer, unless the random assignment allows several dancers in the same position)
– Hagen von Eitzen
3 hours ago













@HagenvonEitzen: I said 4/7 because if they are not allowed their initial position and the two neighboring, then, out of the 7 positions, they are only allowed in the 4, right?
– Tom Galle
3 hours ago




@HagenvonEitzen: I said 4/7 because if they are not allowed their initial position and the two neighboring, then, out of the 7 positions, they are only allowed in the 4, right?
– Tom Galle
3 hours ago












Are the positions of the circle absolute or are they determined relative to the other dancers? Otherwise, everyone could move at least two spaces away from their position, but the configuration could still be the same afterwards.
– Paul
3 hours ago




Are the positions of the circle absolute or are they determined relative to the other dancers? Otherwise, everyone could move at least two spaces away from their position, but the configuration could still be the same afterwards.
– Paul
3 hours ago












Be careful. If the first dancer moves to position 3, the second dancer has 5 slots from which to pick. So there are more cases than what you're thinking or you may have to think about the problem differently.
– Joel Pereira
3 hours ago




Be careful. If the first dancer moves to position 3, the second dancer has 5 slots from which to pick. So there are more cases than what you're thinking or you may have to think about the problem differently.
– Joel Pereira
3 hours ago












You can't just multiply the probabilities, because the events are not independent. Suppose that dancers $1,2,$ and $3$ are assigned to positions $4,5,$ and $6$ in the second round. Then the probability that dancer $5$ is assigned to an admissible position is $1.$
– saulspatz
3 hours ago




You can't just multiply the probabilities, because the events are not independent. Suppose that dancers $1,2,$ and $3$ are assigned to positions $4,5,$ and $6$ in the second round. Then the probability that dancer $5$ is assigned to an admissible position is $1.$
– saulspatz
3 hours ago










2 Answers
2






active

oldest

votes

















up vote
1
down vote













I get $144.$ I did this by computing the permanent of an appropriate matrix. (See my answer here(Combinatorial Analysis - Specific problem) for an explanation of this method.



The matrix in question is a $7times7$ matrix with a $1$ in position $(i,j)$ is dancer $i$ is allowed to occupy position $j$ and zeros elsewhere.



I append the script, though I would not recommend using a python script to compute the permanent of a large matrix.



#perm01.py
'''
Compute the permanent of a 0-1 matrix
'''

import numpy as np
from math import factorial

def minor(M, i, j):
return np.delete(np.delete(M,i,axis=0), j, axis=1)

def perm(M):
size = M.shape[0]
colsums = sum(M)
rowsums = sum(M.transpose())
c = np.argmin(colsums)
r = np.argmin(rowsums)
answer = 0
if colsums[c] <= rowsums[r]:
if colsums[c] == size:
return factorial(size)
for k in range(size):
if M[k, c] == 1:
answer += perm(minor(M,k,c))
else:
for k in range(size):
if M[r, k] == 1:
answer += perm(minor(M,r,k))
return answer

if __name__=='__main__':
M = np.zeros((7,7), dtype=np.int)
for k in range(7):
M[k,k]=M[k,(k+1)%7]=M[k,(k-1)%7]=1
M = np.ones((7,7), dtype=int)-M
print(perm(M))





share|cite|improve this answer



























    up vote
    1
    down vote













    The problem is asking for the number of permutations of $0,dots,6$ such that the difference between each element and its image is more than 1 (modulo 7), as a proportion of the total number of permutations. The permutations must have no fixed points, which means they can only have four types of cycle structures – $7, 5,2,4,3,2,2,3$ – and these give rise to eleven patterns for permuting the dancers around:





    Except for the two starry 7-cycles, each pattern can be in any of 7 orientations. They can also have $2^n$ cycle directions, where $n$ is the number of cycles that are not transpositions, written in the top-left corner of each permutation in the picture. Thus we have $7(8cdot2+4)+2+2=144$ admissible permutations, and this is out of $7!=5040$, so the desired probability is $frac1445040=frac135$.




    Permutations of this sort, where elements move more than one place around a circle, are termed discordant and enumerated (with links to a general enumeration system) under OEIS A000183.






    share|cite|improve this answer






















    • @Parcly Taxel: Thank you very much for your solution. Could you possibly be a little more analytic? I don't quite understand the part with the patterns, modulo 7 etc.
      – Tom Galle
      2 hours ago










    Your Answer




    StackExchange.ifUsing("editor", function ()
    return StackExchange.using("mathjaxEditing", function ()
    StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
    StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
    );
    );
    , "mathjax-editing");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "69"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    noCode: true, onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2963575%2f7-dancers-on-a-circle%23new-answer', 'question_page');

    );

    Post as a guest






























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote













    I get $144.$ I did this by computing the permanent of an appropriate matrix. (See my answer here(Combinatorial Analysis - Specific problem) for an explanation of this method.



    The matrix in question is a $7times7$ matrix with a $1$ in position $(i,j)$ is dancer $i$ is allowed to occupy position $j$ and zeros elsewhere.



    I append the script, though I would not recommend using a python script to compute the permanent of a large matrix.



    #perm01.py
    '''
    Compute the permanent of a 0-1 matrix
    '''

    import numpy as np
    from math import factorial

    def minor(M, i, j):
    return np.delete(np.delete(M,i,axis=0), j, axis=1)

    def perm(M):
    size = M.shape[0]
    colsums = sum(M)
    rowsums = sum(M.transpose())
    c = np.argmin(colsums)
    r = np.argmin(rowsums)
    answer = 0
    if colsums[c] <= rowsums[r]:
    if colsums[c] == size:
    return factorial(size)
    for k in range(size):
    if M[k, c] == 1:
    answer += perm(minor(M,k,c))
    else:
    for k in range(size):
    if M[r, k] == 1:
    answer += perm(minor(M,r,k))
    return answer

    if __name__=='__main__':
    M = np.zeros((7,7), dtype=np.int)
    for k in range(7):
    M[k,k]=M[k,(k+1)%7]=M[k,(k-1)%7]=1
    M = np.ones((7,7), dtype=int)-M
    print(perm(M))





    share|cite|improve this answer
























      up vote
      1
      down vote













      I get $144.$ I did this by computing the permanent of an appropriate matrix. (See my answer here(Combinatorial Analysis - Specific problem) for an explanation of this method.



      The matrix in question is a $7times7$ matrix with a $1$ in position $(i,j)$ is dancer $i$ is allowed to occupy position $j$ and zeros elsewhere.



      I append the script, though I would not recommend using a python script to compute the permanent of a large matrix.



      #perm01.py
      '''
      Compute the permanent of a 0-1 matrix
      '''

      import numpy as np
      from math import factorial

      def minor(M, i, j):
      return np.delete(np.delete(M,i,axis=0), j, axis=1)

      def perm(M):
      size = M.shape[0]
      colsums = sum(M)
      rowsums = sum(M.transpose())
      c = np.argmin(colsums)
      r = np.argmin(rowsums)
      answer = 0
      if colsums[c] <= rowsums[r]:
      if colsums[c] == size:
      return factorial(size)
      for k in range(size):
      if M[k, c] == 1:
      answer += perm(minor(M,k,c))
      else:
      for k in range(size):
      if M[r, k] == 1:
      answer += perm(minor(M,r,k))
      return answer

      if __name__=='__main__':
      M = np.zeros((7,7), dtype=np.int)
      for k in range(7):
      M[k,k]=M[k,(k+1)%7]=M[k,(k-1)%7]=1
      M = np.ones((7,7), dtype=int)-M
      print(perm(M))





      share|cite|improve this answer






















        up vote
        1
        down vote










        up vote
        1
        down vote









        I get $144.$ I did this by computing the permanent of an appropriate matrix. (See my answer here(Combinatorial Analysis - Specific problem) for an explanation of this method.



        The matrix in question is a $7times7$ matrix with a $1$ in position $(i,j)$ is dancer $i$ is allowed to occupy position $j$ and zeros elsewhere.



        I append the script, though I would not recommend using a python script to compute the permanent of a large matrix.



        #perm01.py
        '''
        Compute the permanent of a 0-1 matrix
        '''

        import numpy as np
        from math import factorial

        def minor(M, i, j):
        return np.delete(np.delete(M,i,axis=0), j, axis=1)

        def perm(M):
        size = M.shape[0]
        colsums = sum(M)
        rowsums = sum(M.transpose())
        c = np.argmin(colsums)
        r = np.argmin(rowsums)
        answer = 0
        if colsums[c] <= rowsums[r]:
        if colsums[c] == size:
        return factorial(size)
        for k in range(size):
        if M[k, c] == 1:
        answer += perm(minor(M,k,c))
        else:
        for k in range(size):
        if M[r, k] == 1:
        answer += perm(minor(M,r,k))
        return answer

        if __name__=='__main__':
        M = np.zeros((7,7), dtype=np.int)
        for k in range(7):
        M[k,k]=M[k,(k+1)%7]=M[k,(k-1)%7]=1
        M = np.ones((7,7), dtype=int)-M
        print(perm(M))





        share|cite|improve this answer












        I get $144.$ I did this by computing the permanent of an appropriate matrix. (See my answer here(Combinatorial Analysis - Specific problem) for an explanation of this method.



        The matrix in question is a $7times7$ matrix with a $1$ in position $(i,j)$ is dancer $i$ is allowed to occupy position $j$ and zeros elsewhere.



        I append the script, though I would not recommend using a python script to compute the permanent of a large matrix.



        #perm01.py
        '''
        Compute the permanent of a 0-1 matrix
        '''

        import numpy as np
        from math import factorial

        def minor(M, i, j):
        return np.delete(np.delete(M,i,axis=0), j, axis=1)

        def perm(M):
        size = M.shape[0]
        colsums = sum(M)
        rowsums = sum(M.transpose())
        c = np.argmin(colsums)
        r = np.argmin(rowsums)
        answer = 0
        if colsums[c] <= rowsums[r]:
        if colsums[c] == size:
        return factorial(size)
        for k in range(size):
        if M[k, c] == 1:
        answer += perm(minor(M,k,c))
        else:
        for k in range(size):
        if M[r, k] == 1:
        answer += perm(minor(M,r,k))
        return answer

        if __name__=='__main__':
        M = np.zeros((7,7), dtype=np.int)
        for k in range(7):
        M[k,k]=M[k,(k+1)%7]=M[k,(k-1)%7]=1
        M = np.ones((7,7), dtype=int)-M
        print(perm(M))






        share|cite|improve this answer












        share|cite|improve this answer



        share|cite|improve this answer










        answered 1 hour ago









        saulspatz

        12.2k21326




        12.2k21326




















            up vote
            1
            down vote













            The problem is asking for the number of permutations of $0,dots,6$ such that the difference between each element and its image is more than 1 (modulo 7), as a proportion of the total number of permutations. The permutations must have no fixed points, which means they can only have four types of cycle structures – $7, 5,2,4,3,2,2,3$ – and these give rise to eleven patterns for permuting the dancers around:





            Except for the two starry 7-cycles, each pattern can be in any of 7 orientations. They can also have $2^n$ cycle directions, where $n$ is the number of cycles that are not transpositions, written in the top-left corner of each permutation in the picture. Thus we have $7(8cdot2+4)+2+2=144$ admissible permutations, and this is out of $7!=5040$, so the desired probability is $frac1445040=frac135$.




            Permutations of this sort, where elements move more than one place around a circle, are termed discordant and enumerated (with links to a general enumeration system) under OEIS A000183.






            share|cite|improve this answer






















            • @Parcly Taxel: Thank you very much for your solution. Could you possibly be a little more analytic? I don't quite understand the part with the patterns, modulo 7 etc.
              – Tom Galle
              2 hours ago














            up vote
            1
            down vote













            The problem is asking for the number of permutations of $0,dots,6$ such that the difference between each element and its image is more than 1 (modulo 7), as a proportion of the total number of permutations. The permutations must have no fixed points, which means they can only have four types of cycle structures – $7, 5,2,4,3,2,2,3$ – and these give rise to eleven patterns for permuting the dancers around:





            Except for the two starry 7-cycles, each pattern can be in any of 7 orientations. They can also have $2^n$ cycle directions, where $n$ is the number of cycles that are not transpositions, written in the top-left corner of each permutation in the picture. Thus we have $7(8cdot2+4)+2+2=144$ admissible permutations, and this is out of $7!=5040$, so the desired probability is $frac1445040=frac135$.




            Permutations of this sort, where elements move more than one place around a circle, are termed discordant and enumerated (with links to a general enumeration system) under OEIS A000183.






            share|cite|improve this answer






















            • @Parcly Taxel: Thank you very much for your solution. Could you possibly be a little more analytic? I don't quite understand the part with the patterns, modulo 7 etc.
              – Tom Galle
              2 hours ago












            up vote
            1
            down vote










            up vote
            1
            down vote









            The problem is asking for the number of permutations of $0,dots,6$ such that the difference between each element and its image is more than 1 (modulo 7), as a proportion of the total number of permutations. The permutations must have no fixed points, which means they can only have four types of cycle structures – $7, 5,2,4,3,2,2,3$ – and these give rise to eleven patterns for permuting the dancers around:





            Except for the two starry 7-cycles, each pattern can be in any of 7 orientations. They can also have $2^n$ cycle directions, where $n$ is the number of cycles that are not transpositions, written in the top-left corner of each permutation in the picture. Thus we have $7(8cdot2+4)+2+2=144$ admissible permutations, and this is out of $7!=5040$, so the desired probability is $frac1445040=frac135$.




            Permutations of this sort, where elements move more than one place around a circle, are termed discordant and enumerated (with links to a general enumeration system) under OEIS A000183.






            share|cite|improve this answer














            The problem is asking for the number of permutations of $0,dots,6$ such that the difference between each element and its image is more than 1 (modulo 7), as a proportion of the total number of permutations. The permutations must have no fixed points, which means they can only have four types of cycle structures – $7, 5,2,4,3,2,2,3$ – and these give rise to eleven patterns for permuting the dancers around:





            Except for the two starry 7-cycles, each pattern can be in any of 7 orientations. They can also have $2^n$ cycle directions, where $n$ is the number of cycles that are not transpositions, written in the top-left corner of each permutation in the picture. Thus we have $7(8cdot2+4)+2+2=144$ admissible permutations, and this is out of $7!=5040$, so the desired probability is $frac1445040=frac135$.




            Permutations of this sort, where elements move more than one place around a circle, are termed discordant and enumerated (with links to a general enumeration system) under OEIS A000183.







            share|cite|improve this answer














            share|cite|improve this answer



            share|cite|improve this answer








            edited 43 mins ago

























            answered 3 hours ago









            Parcly Taxel

            36.8k137095




            36.8k137095











            • @Parcly Taxel: Thank you very much for your solution. Could you possibly be a little more analytic? I don't quite understand the part with the patterns, modulo 7 etc.
              – Tom Galle
              2 hours ago
















            • @Parcly Taxel: Thank you very much for your solution. Could you possibly be a little more analytic? I don't quite understand the part with the patterns, modulo 7 etc.
              – Tom Galle
              2 hours ago















            @Parcly Taxel: Thank you very much for your solution. Could you possibly be a little more analytic? I don't quite understand the part with the patterns, modulo 7 etc.
            – Tom Galle
            2 hours ago




            @Parcly Taxel: Thank you very much for your solution. Could you possibly be a little more analytic? I don't quite understand the part with the patterns, modulo 7 etc.
            – Tom Galle
            2 hours ago

















             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2963575%2f7-dancers-on-a-circle%23new-answer', 'question_page');

            );

            Post as a guest













































































            Comments

            Popular posts from this blog

            Long meetings (6-7 hours a day): Being “babysat” by supervisor

            What does second last employer means? [closed]

            One-line joke