Maximizing Minimizing Probability

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











up vote
-1
down vote

favorite












I have to create an Array A, and for the sake of making things clear, I will create A = [a,b,c,d] with length n, 4 in this case. Then I feed A to the following algorithm;



For i in 1...n: do
generate a random number j
Swap(A[i], A[j])


Now how do I come up with this array, call it A (array contents decided by me), so the probability that the new array generated by this algorithm after giving it A as input, is closest to A. So I have to create an Array, A, feed it to the algorithm and the result should be as close as possible to the original Array, A.










share|cite|improve this question























  • So lost. I don't get this
    – Rushabh Mehta
    Sep 11 at 2:31










  • Shouldn't your array be of length $n$? Call the array you are given $A$ and your array $B$. It sounds like you do $n$ times swapping a random element of $A$ with the element that is $B(i)$. In your example, if the starting $A$ is $[a,b,c,d]$ and the first random is $3$ you would swap the third element $c$ with $a$ and get $[c,b,a,d]$. Then if the next random is $2$ you would swap $b$ with $c$ and get $[b,c,a,d]$. OK so far? But then you say we do the loop $4$ times, so what do we swap with for the last two?
    – Ross Millikan
    Sep 11 at 2:32











  • Are we allowed to duplicate elements in $B$? If not, $B$ must be a permutation of $A$. I suspect that you can then prove it doesn't matter what the permutation is.
    – Ross Millikan
    Sep 11 at 2:36










  • So sorry, not the best at explaining. I edited the Post.
    – Carlson Bimbuh
    Sep 11 at 2:54










  • What does "closest to A" mean? How do you determine which of two permutations is closer to the original one?
    – saulspatz
    Sep 11 at 3:06














up vote
-1
down vote

favorite












I have to create an Array A, and for the sake of making things clear, I will create A = [a,b,c,d] with length n, 4 in this case. Then I feed A to the following algorithm;



For i in 1...n: do
generate a random number j
Swap(A[i], A[j])


Now how do I come up with this array, call it A (array contents decided by me), so the probability that the new array generated by this algorithm after giving it A as input, is closest to A. So I have to create an Array, A, feed it to the algorithm and the result should be as close as possible to the original Array, A.










share|cite|improve this question























  • So lost. I don't get this
    – Rushabh Mehta
    Sep 11 at 2:31










  • Shouldn't your array be of length $n$? Call the array you are given $A$ and your array $B$. It sounds like you do $n$ times swapping a random element of $A$ with the element that is $B(i)$. In your example, if the starting $A$ is $[a,b,c,d]$ and the first random is $3$ you would swap the third element $c$ with $a$ and get $[c,b,a,d]$. Then if the next random is $2$ you would swap $b$ with $c$ and get $[b,c,a,d]$. OK so far? But then you say we do the loop $4$ times, so what do we swap with for the last two?
    – Ross Millikan
    Sep 11 at 2:32











  • Are we allowed to duplicate elements in $B$? If not, $B$ must be a permutation of $A$. I suspect that you can then prove it doesn't matter what the permutation is.
    – Ross Millikan
    Sep 11 at 2:36










  • So sorry, not the best at explaining. I edited the Post.
    – Carlson Bimbuh
    Sep 11 at 2:54










  • What does "closest to A" mean? How do you determine which of two permutations is closer to the original one?
    – saulspatz
    Sep 11 at 3:06












up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











I have to create an Array A, and for the sake of making things clear, I will create A = [a,b,c,d] with length n, 4 in this case. Then I feed A to the following algorithm;



For i in 1...n: do
generate a random number j
Swap(A[i], A[j])


Now how do I come up with this array, call it A (array contents decided by me), so the probability that the new array generated by this algorithm after giving it A as input, is closest to A. So I have to create an Array, A, feed it to the algorithm and the result should be as close as possible to the original Array, A.










share|cite|improve this question















I have to create an Array A, and for the sake of making things clear, I will create A = [a,b,c,d] with length n, 4 in this case. Then I feed A to the following algorithm;



For i in 1...n: do
generate a random number j
Swap(A[i], A[j])


Now how do I come up with this array, call it A (array contents decided by me), so the probability that the new array generated by this algorithm after giving it A as input, is closest to A. So I have to create an Array, A, feed it to the algorithm and the result should be as close as possible to the original Array, A.







probability






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Sep 11 at 2:50

























asked Sep 11 at 2:24









Carlson Bimbuh

11




11











  • So lost. I don't get this
    – Rushabh Mehta
    Sep 11 at 2:31










  • Shouldn't your array be of length $n$? Call the array you are given $A$ and your array $B$. It sounds like you do $n$ times swapping a random element of $A$ with the element that is $B(i)$. In your example, if the starting $A$ is $[a,b,c,d]$ and the first random is $3$ you would swap the third element $c$ with $a$ and get $[c,b,a,d]$. Then if the next random is $2$ you would swap $b$ with $c$ and get $[b,c,a,d]$. OK so far? But then you say we do the loop $4$ times, so what do we swap with for the last two?
    – Ross Millikan
    Sep 11 at 2:32











  • Are we allowed to duplicate elements in $B$? If not, $B$ must be a permutation of $A$. I suspect that you can then prove it doesn't matter what the permutation is.
    – Ross Millikan
    Sep 11 at 2:36










  • So sorry, not the best at explaining. I edited the Post.
    – Carlson Bimbuh
    Sep 11 at 2:54










  • What does "closest to A" mean? How do you determine which of two permutations is closer to the original one?
    – saulspatz
    Sep 11 at 3:06
















  • So lost. I don't get this
    – Rushabh Mehta
    Sep 11 at 2:31










  • Shouldn't your array be of length $n$? Call the array you are given $A$ and your array $B$. It sounds like you do $n$ times swapping a random element of $A$ with the element that is $B(i)$. In your example, if the starting $A$ is $[a,b,c,d]$ and the first random is $3$ you would swap the third element $c$ with $a$ and get $[c,b,a,d]$. Then if the next random is $2$ you would swap $b$ with $c$ and get $[b,c,a,d]$. OK so far? But then you say we do the loop $4$ times, so what do we swap with for the last two?
    – Ross Millikan
    Sep 11 at 2:32











  • Are we allowed to duplicate elements in $B$? If not, $B$ must be a permutation of $A$. I suspect that you can then prove it doesn't matter what the permutation is.
    – Ross Millikan
    Sep 11 at 2:36










  • So sorry, not the best at explaining. I edited the Post.
    – Carlson Bimbuh
    Sep 11 at 2:54










  • What does "closest to A" mean? How do you determine which of two permutations is closer to the original one?
    – saulspatz
    Sep 11 at 3:06















So lost. I don't get this
– Rushabh Mehta
Sep 11 at 2:31




So lost. I don't get this
– Rushabh Mehta
Sep 11 at 2:31












Shouldn't your array be of length $n$? Call the array you are given $A$ and your array $B$. It sounds like you do $n$ times swapping a random element of $A$ with the element that is $B(i)$. In your example, if the starting $A$ is $[a,b,c,d]$ and the first random is $3$ you would swap the third element $c$ with $a$ and get $[c,b,a,d]$. Then if the next random is $2$ you would swap $b$ with $c$ and get $[b,c,a,d]$. OK so far? But then you say we do the loop $4$ times, so what do we swap with for the last two?
– Ross Millikan
Sep 11 at 2:32





Shouldn't your array be of length $n$? Call the array you are given $A$ and your array $B$. It sounds like you do $n$ times swapping a random element of $A$ with the element that is $B(i)$. In your example, if the starting $A$ is $[a,b,c,d]$ and the first random is $3$ you would swap the third element $c$ with $a$ and get $[c,b,a,d]$. Then if the next random is $2$ you would swap $b$ with $c$ and get $[b,c,a,d]$. OK so far? But then you say we do the loop $4$ times, so what do we swap with for the last two?
– Ross Millikan
Sep 11 at 2:32













Are we allowed to duplicate elements in $B$? If not, $B$ must be a permutation of $A$. I suspect that you can then prove it doesn't matter what the permutation is.
– Ross Millikan
Sep 11 at 2:36




Are we allowed to duplicate elements in $B$? If not, $B$ must be a permutation of $A$. I suspect that you can then prove it doesn't matter what the permutation is.
– Ross Millikan
Sep 11 at 2:36












So sorry, not the best at explaining. I edited the Post.
– Carlson Bimbuh
Sep 11 at 2:54




So sorry, not the best at explaining. I edited the Post.
– Carlson Bimbuh
Sep 11 at 2:54












What does "closest to A" mean? How do you determine which of two permutations is closer to the original one?
– saulspatz
Sep 11 at 3:06




What does "closest to A" mean? How do you determine which of two permutations is closer to the original one?
– saulspatz
Sep 11 at 3:06










2 Answers
2






active

oldest

votes

















up vote
0
down vote













I assume that duplicates are not allowed. That is, the initial arrangement must be a permutation of the number $1,2,3,4.$ According to my calculations, it doesn't matter what the initial arrangement is, as indeed seems true intuitively.



Here's a python script to test this:



from itertools import permutations, product

for p in permutations(range(4)):
a = list(p)
count = 0
for d in product(range(4), repeat=4):
for i in range(4):
a[i], a[d[i]], = a[d[i]], a[i]
if a == list(p): count += 1
print(p, count)


This produces the output



(0, 1, 2, 3) 10
(0, 1, 3, 2) 10
(0, 2, 1, 3) 10
(0, 2, 3, 1) 10
(0, 3, 1, 2) 10
(0, 3, 2, 1) 10
(1, 0, 2, 3) 10
(1, 0, 3, 2) 10
(1, 2, 0, 3) 10
(1, 2, 3, 0) 10
(1, 3, 0, 2) 10
(1, 3, 2, 0) 10
(2, 0, 1, 3) 10
(2, 0, 3, 1) 10
(2, 1, 0, 3) 10
(2, 1, 3, 0) 10
(2, 3, 0, 1) 10
(2, 3, 1, 0) 10
(3, 0, 1, 2) 10
(3, 0, 2, 1) 10
(3, 1, 0, 2) 10
(3, 1, 2, 0) 10
(3, 2, 0, 1) 10
(3, 2, 1, 0) 10


so in all cases the probability is the same: $10over4^4=0.0390625$



I'm sure that it can be proved that this is true for any $n:$ the initial permutation doesn't matter, although the technique escapes me. As a way to discover the proof, I suggest modifying the above script to print out the random numbers (d in the script) that leave the permutations fixed for two specific permutations, and trying to see how one sequence maps to the other. This will probably give you the pattern you need to prove.






share|cite|improve this answer




















  • I think your solution is right, just that having to generate the permutations consumes time. But I have fixed that. But I will like to implore your help one more time. What about minimum probability? How will I get a permutation farthest away from the original array?
    – Carlson Bimbuh
    Sep 12 at 12:55











  • @CarlsonBimbuh I don't understand what you mean by "farthest away."
    – saulspatz
    Sep 12 at 13:01










  • I mean how will I generate a permutation such that, the probability for the algorithm to get it is minimal possible.
    – Carlson Bimbuh
    Sep 12 at 13:17

















up vote
0
down vote













For the new formulation, if all the elements of $A$ are distinct, all that matters is the number of elements in $A$. Shorter is better because there are less permutations to choose from. Before you run your algorithm you can permute the elements into any order you want. Now imagine the permuted one is $[1,2,3,ldots n]$. You have some probability to end with $[1,2,3,ldots n]$. That will be the same for any given length of $A$.






share|cite|improve this answer




















    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: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    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%2f2912661%2fmaximizing-minimizing-probability%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
    0
    down vote













    I assume that duplicates are not allowed. That is, the initial arrangement must be a permutation of the number $1,2,3,4.$ According to my calculations, it doesn't matter what the initial arrangement is, as indeed seems true intuitively.



    Here's a python script to test this:



    from itertools import permutations, product

    for p in permutations(range(4)):
    a = list(p)
    count = 0
    for d in product(range(4), repeat=4):
    for i in range(4):
    a[i], a[d[i]], = a[d[i]], a[i]
    if a == list(p): count += 1
    print(p, count)


    This produces the output



    (0, 1, 2, 3) 10
    (0, 1, 3, 2) 10
    (0, 2, 1, 3) 10
    (0, 2, 3, 1) 10
    (0, 3, 1, 2) 10
    (0, 3, 2, 1) 10
    (1, 0, 2, 3) 10
    (1, 0, 3, 2) 10
    (1, 2, 0, 3) 10
    (1, 2, 3, 0) 10
    (1, 3, 0, 2) 10
    (1, 3, 2, 0) 10
    (2, 0, 1, 3) 10
    (2, 0, 3, 1) 10
    (2, 1, 0, 3) 10
    (2, 1, 3, 0) 10
    (2, 3, 0, 1) 10
    (2, 3, 1, 0) 10
    (3, 0, 1, 2) 10
    (3, 0, 2, 1) 10
    (3, 1, 0, 2) 10
    (3, 1, 2, 0) 10
    (3, 2, 0, 1) 10
    (3, 2, 1, 0) 10


    so in all cases the probability is the same: $10over4^4=0.0390625$



    I'm sure that it can be proved that this is true for any $n:$ the initial permutation doesn't matter, although the technique escapes me. As a way to discover the proof, I suggest modifying the above script to print out the random numbers (d in the script) that leave the permutations fixed for two specific permutations, and trying to see how one sequence maps to the other. This will probably give you the pattern you need to prove.






    share|cite|improve this answer




















    • I think your solution is right, just that having to generate the permutations consumes time. But I have fixed that. But I will like to implore your help one more time. What about minimum probability? How will I get a permutation farthest away from the original array?
      – Carlson Bimbuh
      Sep 12 at 12:55











    • @CarlsonBimbuh I don't understand what you mean by "farthest away."
      – saulspatz
      Sep 12 at 13:01










    • I mean how will I generate a permutation such that, the probability for the algorithm to get it is minimal possible.
      – Carlson Bimbuh
      Sep 12 at 13:17














    up vote
    0
    down vote













    I assume that duplicates are not allowed. That is, the initial arrangement must be a permutation of the number $1,2,3,4.$ According to my calculations, it doesn't matter what the initial arrangement is, as indeed seems true intuitively.



    Here's a python script to test this:



    from itertools import permutations, product

    for p in permutations(range(4)):
    a = list(p)
    count = 0
    for d in product(range(4), repeat=4):
    for i in range(4):
    a[i], a[d[i]], = a[d[i]], a[i]
    if a == list(p): count += 1
    print(p, count)


    This produces the output



    (0, 1, 2, 3) 10
    (0, 1, 3, 2) 10
    (0, 2, 1, 3) 10
    (0, 2, 3, 1) 10
    (0, 3, 1, 2) 10
    (0, 3, 2, 1) 10
    (1, 0, 2, 3) 10
    (1, 0, 3, 2) 10
    (1, 2, 0, 3) 10
    (1, 2, 3, 0) 10
    (1, 3, 0, 2) 10
    (1, 3, 2, 0) 10
    (2, 0, 1, 3) 10
    (2, 0, 3, 1) 10
    (2, 1, 0, 3) 10
    (2, 1, 3, 0) 10
    (2, 3, 0, 1) 10
    (2, 3, 1, 0) 10
    (3, 0, 1, 2) 10
    (3, 0, 2, 1) 10
    (3, 1, 0, 2) 10
    (3, 1, 2, 0) 10
    (3, 2, 0, 1) 10
    (3, 2, 1, 0) 10


    so in all cases the probability is the same: $10over4^4=0.0390625$



    I'm sure that it can be proved that this is true for any $n:$ the initial permutation doesn't matter, although the technique escapes me. As a way to discover the proof, I suggest modifying the above script to print out the random numbers (d in the script) that leave the permutations fixed for two specific permutations, and trying to see how one sequence maps to the other. This will probably give you the pattern you need to prove.






    share|cite|improve this answer




















    • I think your solution is right, just that having to generate the permutations consumes time. But I have fixed that. But I will like to implore your help one more time. What about minimum probability? How will I get a permutation farthest away from the original array?
      – Carlson Bimbuh
      Sep 12 at 12:55











    • @CarlsonBimbuh I don't understand what you mean by "farthest away."
      – saulspatz
      Sep 12 at 13:01










    • I mean how will I generate a permutation such that, the probability for the algorithm to get it is minimal possible.
      – Carlson Bimbuh
      Sep 12 at 13:17












    up vote
    0
    down vote










    up vote
    0
    down vote









    I assume that duplicates are not allowed. That is, the initial arrangement must be a permutation of the number $1,2,3,4.$ According to my calculations, it doesn't matter what the initial arrangement is, as indeed seems true intuitively.



    Here's a python script to test this:



    from itertools import permutations, product

    for p in permutations(range(4)):
    a = list(p)
    count = 0
    for d in product(range(4), repeat=4):
    for i in range(4):
    a[i], a[d[i]], = a[d[i]], a[i]
    if a == list(p): count += 1
    print(p, count)


    This produces the output



    (0, 1, 2, 3) 10
    (0, 1, 3, 2) 10
    (0, 2, 1, 3) 10
    (0, 2, 3, 1) 10
    (0, 3, 1, 2) 10
    (0, 3, 2, 1) 10
    (1, 0, 2, 3) 10
    (1, 0, 3, 2) 10
    (1, 2, 0, 3) 10
    (1, 2, 3, 0) 10
    (1, 3, 0, 2) 10
    (1, 3, 2, 0) 10
    (2, 0, 1, 3) 10
    (2, 0, 3, 1) 10
    (2, 1, 0, 3) 10
    (2, 1, 3, 0) 10
    (2, 3, 0, 1) 10
    (2, 3, 1, 0) 10
    (3, 0, 1, 2) 10
    (3, 0, 2, 1) 10
    (3, 1, 0, 2) 10
    (3, 1, 2, 0) 10
    (3, 2, 0, 1) 10
    (3, 2, 1, 0) 10


    so in all cases the probability is the same: $10over4^4=0.0390625$



    I'm sure that it can be proved that this is true for any $n:$ the initial permutation doesn't matter, although the technique escapes me. As a way to discover the proof, I suggest modifying the above script to print out the random numbers (d in the script) that leave the permutations fixed for two specific permutations, and trying to see how one sequence maps to the other. This will probably give you the pattern you need to prove.






    share|cite|improve this answer












    I assume that duplicates are not allowed. That is, the initial arrangement must be a permutation of the number $1,2,3,4.$ According to my calculations, it doesn't matter what the initial arrangement is, as indeed seems true intuitively.



    Here's a python script to test this:



    from itertools import permutations, product

    for p in permutations(range(4)):
    a = list(p)
    count = 0
    for d in product(range(4), repeat=4):
    for i in range(4):
    a[i], a[d[i]], = a[d[i]], a[i]
    if a == list(p): count += 1
    print(p, count)


    This produces the output



    (0, 1, 2, 3) 10
    (0, 1, 3, 2) 10
    (0, 2, 1, 3) 10
    (0, 2, 3, 1) 10
    (0, 3, 1, 2) 10
    (0, 3, 2, 1) 10
    (1, 0, 2, 3) 10
    (1, 0, 3, 2) 10
    (1, 2, 0, 3) 10
    (1, 2, 3, 0) 10
    (1, 3, 0, 2) 10
    (1, 3, 2, 0) 10
    (2, 0, 1, 3) 10
    (2, 0, 3, 1) 10
    (2, 1, 0, 3) 10
    (2, 1, 3, 0) 10
    (2, 3, 0, 1) 10
    (2, 3, 1, 0) 10
    (3, 0, 1, 2) 10
    (3, 0, 2, 1) 10
    (3, 1, 0, 2) 10
    (3, 1, 2, 0) 10
    (3, 2, 0, 1) 10
    (3, 2, 1, 0) 10


    so in all cases the probability is the same: $10over4^4=0.0390625$



    I'm sure that it can be proved that this is true for any $n:$ the initial permutation doesn't matter, although the technique escapes me. As a way to discover the proof, I suggest modifying the above script to print out the random numbers (d in the script) that leave the permutations fixed for two specific permutations, and trying to see how one sequence maps to the other. This will probably give you the pattern you need to prove.







    share|cite|improve this answer












    share|cite|improve this answer



    share|cite|improve this answer










    answered Sep 11 at 14:20









    saulspatz

    12.7k21327




    12.7k21327











    • I think your solution is right, just that having to generate the permutations consumes time. But I have fixed that. But I will like to implore your help one more time. What about minimum probability? How will I get a permutation farthest away from the original array?
      – Carlson Bimbuh
      Sep 12 at 12:55











    • @CarlsonBimbuh I don't understand what you mean by "farthest away."
      – saulspatz
      Sep 12 at 13:01










    • I mean how will I generate a permutation such that, the probability for the algorithm to get it is minimal possible.
      – Carlson Bimbuh
      Sep 12 at 13:17
















    • I think your solution is right, just that having to generate the permutations consumes time. But I have fixed that. But I will like to implore your help one more time. What about minimum probability? How will I get a permutation farthest away from the original array?
      – Carlson Bimbuh
      Sep 12 at 12:55











    • @CarlsonBimbuh I don't understand what you mean by "farthest away."
      – saulspatz
      Sep 12 at 13:01










    • I mean how will I generate a permutation such that, the probability for the algorithm to get it is minimal possible.
      – Carlson Bimbuh
      Sep 12 at 13:17















    I think your solution is right, just that having to generate the permutations consumes time. But I have fixed that. But I will like to implore your help one more time. What about minimum probability? How will I get a permutation farthest away from the original array?
    – Carlson Bimbuh
    Sep 12 at 12:55





    I think your solution is right, just that having to generate the permutations consumes time. But I have fixed that. But I will like to implore your help one more time. What about minimum probability? How will I get a permutation farthest away from the original array?
    – Carlson Bimbuh
    Sep 12 at 12:55













    @CarlsonBimbuh I don't understand what you mean by "farthest away."
    – saulspatz
    Sep 12 at 13:01




    @CarlsonBimbuh I don't understand what you mean by "farthest away."
    – saulspatz
    Sep 12 at 13:01












    I mean how will I generate a permutation such that, the probability for the algorithm to get it is minimal possible.
    – Carlson Bimbuh
    Sep 12 at 13:17




    I mean how will I generate a permutation such that, the probability for the algorithm to get it is minimal possible.
    – Carlson Bimbuh
    Sep 12 at 13:17










    up vote
    0
    down vote













    For the new formulation, if all the elements of $A$ are distinct, all that matters is the number of elements in $A$. Shorter is better because there are less permutations to choose from. Before you run your algorithm you can permute the elements into any order you want. Now imagine the permuted one is $[1,2,3,ldots n]$. You have some probability to end with $[1,2,3,ldots n]$. That will be the same for any given length of $A$.






    share|cite|improve this answer
























      up vote
      0
      down vote













      For the new formulation, if all the elements of $A$ are distinct, all that matters is the number of elements in $A$. Shorter is better because there are less permutations to choose from. Before you run your algorithm you can permute the elements into any order you want. Now imagine the permuted one is $[1,2,3,ldots n]$. You have some probability to end with $[1,2,3,ldots n]$. That will be the same for any given length of $A$.






      share|cite|improve this answer






















        up vote
        0
        down vote










        up vote
        0
        down vote









        For the new formulation, if all the elements of $A$ are distinct, all that matters is the number of elements in $A$. Shorter is better because there are less permutations to choose from. Before you run your algorithm you can permute the elements into any order you want. Now imagine the permuted one is $[1,2,3,ldots n]$. You have some probability to end with $[1,2,3,ldots n]$. That will be the same for any given length of $A$.






        share|cite|improve this answer












        For the new formulation, if all the elements of $A$ are distinct, all that matters is the number of elements in $A$. Shorter is better because there are less permutations to choose from. Before you run your algorithm you can permute the elements into any order you want. Now imagine the permuted one is $[1,2,3,ldots n]$. You have some probability to end with $[1,2,3,ldots n]$. That will be the same for any given length of $A$.







        share|cite|improve this answer












        share|cite|improve this answer



        share|cite|improve this answer










        answered Sep 11 at 14:33









        Ross Millikan

        286k23195363




        286k23195363



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2912661%2fmaximizing-minimizing-probability%23new-answer', 'question_page');

            );

            Post as a guest













































































            這個網誌中的熱門文章

            How to combine Bézier curves to a surface?

            Mutual Information Always Non-negative

            Why am i infinitely getting the same tweet with the Twitter Search API?