Probability problem; adding elements to a list then picking from that list












1












$begingroup$


It seems like a very simple problem but I couldn't figure out the solution myself (not homework)



Simplified it's the following:

10% chance to add 1 to a list
20% chance to add 2 to a list
30% chance to add 3 to a list
40% chance to add 4 to a list



and from that list I pick 1 number.



How much chance is there to get a specific number?
Running a simulation in matlab gave me:
29.3% to get 4;
20.9% to get 3;
13.5% to get 2;
6.2% to get 1;

30.1% to get 0 numbers in a list so no number could be picked.










share|cite|improve this question









$endgroup$












  • $begingroup$
    The % to get 0 numbers is (1-0.1) * (1-0.2) * (1-0.3) * (1-0.4) = 30.24%
    $endgroup$
    – Gerben Banaan
    Dec 23 '18 at 18:00
















1












$begingroup$


It seems like a very simple problem but I couldn't figure out the solution myself (not homework)



Simplified it's the following:

10% chance to add 1 to a list
20% chance to add 2 to a list
30% chance to add 3 to a list
40% chance to add 4 to a list



and from that list I pick 1 number.



How much chance is there to get a specific number?
Running a simulation in matlab gave me:
29.3% to get 4;
20.9% to get 3;
13.5% to get 2;
6.2% to get 1;

30.1% to get 0 numbers in a list so no number could be picked.










share|cite|improve this question









$endgroup$












  • $begingroup$
    The % to get 0 numbers is (1-0.1) * (1-0.2) * (1-0.3) * (1-0.4) = 30.24%
    $endgroup$
    – Gerben Banaan
    Dec 23 '18 at 18:00














1












1








1





$begingroup$


It seems like a very simple problem but I couldn't figure out the solution myself (not homework)



Simplified it's the following:

10% chance to add 1 to a list
20% chance to add 2 to a list
30% chance to add 3 to a list
40% chance to add 4 to a list



and from that list I pick 1 number.



How much chance is there to get a specific number?
Running a simulation in matlab gave me:
29.3% to get 4;
20.9% to get 3;
13.5% to get 2;
6.2% to get 1;

30.1% to get 0 numbers in a list so no number could be picked.










share|cite|improve this question









$endgroup$




It seems like a very simple problem but I couldn't figure out the solution myself (not homework)



Simplified it's the following:

10% chance to add 1 to a list
20% chance to add 2 to a list
30% chance to add 3 to a list
40% chance to add 4 to a list



and from that list I pick 1 number.



How much chance is there to get a specific number?
Running a simulation in matlab gave me:
29.3% to get 4;
20.9% to get 3;
13.5% to get 2;
6.2% to get 1;

30.1% to get 0 numbers in a list so no number could be picked.







probability random






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked Dec 23 '18 at 17:50









Gerben BanaanGerben Banaan

61




61












  • $begingroup$
    The % to get 0 numbers is (1-0.1) * (1-0.2) * (1-0.3) * (1-0.4) = 30.24%
    $endgroup$
    – Gerben Banaan
    Dec 23 '18 at 18:00


















  • $begingroup$
    The % to get 0 numbers is (1-0.1) * (1-0.2) * (1-0.3) * (1-0.4) = 30.24%
    $endgroup$
    – Gerben Banaan
    Dec 23 '18 at 18:00
















$begingroup$
The % to get 0 numbers is (1-0.1) * (1-0.2) * (1-0.3) * (1-0.4) = 30.24%
$endgroup$
– Gerben Banaan
Dec 23 '18 at 18:00




$begingroup$
The % to get 0 numbers is (1-0.1) * (1-0.2) * (1-0.3) * (1-0.4) = 30.24%
$endgroup$
– Gerben Banaan
Dec 23 '18 at 18:00










2 Answers
2






active

oldest

votes


















0












$begingroup$

I don't think there is an easy way. The chance you get $4$ is
$0.4$ (that you added $4$ at all) times $Big[(1-0.1)(1-0.2)(1-0.3)$ (that it is the only number on the list) plus $frac 12big(0.1(1-0.2)(1-0.3)+(1-0.1)0.2(1-0.3)+(1-0.1)(1-0.2)0.3big)$ (because one other number was added) plus $ldotsBig]$ and the dots have the cases where two or three other numbers were added.






share|cite|improve this answer









$endgroup$













  • $begingroup$
    Yeah I got as far but that is not an efficient solution; especially not when working with 20 cases; 0.4*0.7*0.8*0.9 + 0.5*0.4*0.3*0.8*0.9 + 0.5*0.4*0.7*0.2*0.9 + 0.5*0.4*0.7*0.8*0.1 + 0.3333*0.4*0.3*0.2*0.9 + 0.3333 * 0.4* 0.7 * 0.2 * 0.1 + 0.3333 * 0.4 * 0.3 * 0.8 * 0.1 + 0.25 * 0.4 * 0.3 * 0.2 * 0.1 (Case where you only can pick 4) + (Cases where you can pick 4 + 1 other number) (Cases where you can pick 4 + 2 other numbers) (Cases where you can pick 4 + 3 other numbers) I was thinking that I must be missing something
    $endgroup$
    – Gerben Banaan
    Dec 23 '18 at 18:24










  • $begingroup$
    I don’t think you were missing anything. Solving problems like this with a neat formula depends on the problem having symmetry. If the chance of adding each number were the same you could just find the chance you don’t get any number, subtract from $1$, and divide by $4$ because of the symmetry. Here you don’t have that, so you have to go through the cases.
    $endgroup$
    – Ross Millikan
    Dec 23 '18 at 19:20



















0












$begingroup$

Let $p(n) (nin{1,2,3,4})$ be the probability that number $n$ is added to the list (e.g., your $0.1, 0.2, 0.3, 0.4$). Then a formula for the probability that the outcome is the specific number $x$ is
$$1(Abcd)+{1over 2}(ABcd+AbCd+AbcD)+{1over 3}(ABCd+ABcD+AbCD)+{1over 4}(ABCD)
$$

where
$$begin{align}A&=p(x)\
B&=p(1+(xbmod 4))\
C&=p(1+((x+1)bmod 4))\
D&=p(1+((x+2)bmod 4))\
end{align}$$

and $a=1-A, b=1-B, c=1-C, d=1-D.$



Note that $B,C,D$ are simply the add-to-the-list probabilities for the three other numbers besides $x$, and they may be taken in any order. (The above formula just uses $bmod 4$ to express the choice of taking them in cyclic order.)



In Sage:



def p(x): return [1/10, 2/10, 3/10, 4/10][x-1]
def Pout(x):
A = p(x)
B = p(1 + (x%4))
C = p(1 + ((x+1)%4))
D = p(1 + ((x+2)%4))
a = 1 - A
b = 1 - B
c = 1 - C
d = 1 - D
return (A*b*c*d)+(A*B*c*d+A*b*C*d+A*b*c*D)/2+(A*B*C*d+A*B*c*D+A*b*C*D)/3+(A*B*C*D)/4

print [Pout(x) for x in [1..4]], 1-sum([Pout(x) for x in [1..4]])
print [Pout(x).n() for x in [1..4]], 1-sum([Pout(x).n() for x in [1..4]])

[473/7500, 1981/15000, 521/2500, 4411/15000] 189/625
[0.0630666666666667, 0.132066666666667, 0.208400000000000, 0.294066666666667] 0.302400000000000





share|cite|improve this answer









$endgroup$














    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',
    autoActivateHeartbeat: false,
    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%2f3050554%2fprobability-problem-adding-elements-to-a-list-then-picking-from-that-list%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0












    $begingroup$

    I don't think there is an easy way. The chance you get $4$ is
    $0.4$ (that you added $4$ at all) times $Big[(1-0.1)(1-0.2)(1-0.3)$ (that it is the only number on the list) plus $frac 12big(0.1(1-0.2)(1-0.3)+(1-0.1)0.2(1-0.3)+(1-0.1)(1-0.2)0.3big)$ (because one other number was added) plus $ldotsBig]$ and the dots have the cases where two or three other numbers were added.






    share|cite|improve this answer









    $endgroup$













    • $begingroup$
      Yeah I got as far but that is not an efficient solution; especially not when working with 20 cases; 0.4*0.7*0.8*0.9 + 0.5*0.4*0.3*0.8*0.9 + 0.5*0.4*0.7*0.2*0.9 + 0.5*0.4*0.7*0.8*0.1 + 0.3333*0.4*0.3*0.2*0.9 + 0.3333 * 0.4* 0.7 * 0.2 * 0.1 + 0.3333 * 0.4 * 0.3 * 0.8 * 0.1 + 0.25 * 0.4 * 0.3 * 0.2 * 0.1 (Case where you only can pick 4) + (Cases where you can pick 4 + 1 other number) (Cases where you can pick 4 + 2 other numbers) (Cases where you can pick 4 + 3 other numbers) I was thinking that I must be missing something
      $endgroup$
      – Gerben Banaan
      Dec 23 '18 at 18:24










    • $begingroup$
      I don’t think you were missing anything. Solving problems like this with a neat formula depends on the problem having symmetry. If the chance of adding each number were the same you could just find the chance you don’t get any number, subtract from $1$, and divide by $4$ because of the symmetry. Here you don’t have that, so you have to go through the cases.
      $endgroup$
      – Ross Millikan
      Dec 23 '18 at 19:20
















    0












    $begingroup$

    I don't think there is an easy way. The chance you get $4$ is
    $0.4$ (that you added $4$ at all) times $Big[(1-0.1)(1-0.2)(1-0.3)$ (that it is the only number on the list) plus $frac 12big(0.1(1-0.2)(1-0.3)+(1-0.1)0.2(1-0.3)+(1-0.1)(1-0.2)0.3big)$ (because one other number was added) plus $ldotsBig]$ and the dots have the cases where two or three other numbers were added.






    share|cite|improve this answer









    $endgroup$













    • $begingroup$
      Yeah I got as far but that is not an efficient solution; especially not when working with 20 cases; 0.4*0.7*0.8*0.9 + 0.5*0.4*0.3*0.8*0.9 + 0.5*0.4*0.7*0.2*0.9 + 0.5*0.4*0.7*0.8*0.1 + 0.3333*0.4*0.3*0.2*0.9 + 0.3333 * 0.4* 0.7 * 0.2 * 0.1 + 0.3333 * 0.4 * 0.3 * 0.8 * 0.1 + 0.25 * 0.4 * 0.3 * 0.2 * 0.1 (Case where you only can pick 4) + (Cases where you can pick 4 + 1 other number) (Cases where you can pick 4 + 2 other numbers) (Cases where you can pick 4 + 3 other numbers) I was thinking that I must be missing something
      $endgroup$
      – Gerben Banaan
      Dec 23 '18 at 18:24










    • $begingroup$
      I don’t think you were missing anything. Solving problems like this with a neat formula depends on the problem having symmetry. If the chance of adding each number were the same you could just find the chance you don’t get any number, subtract from $1$, and divide by $4$ because of the symmetry. Here you don’t have that, so you have to go through the cases.
      $endgroup$
      – Ross Millikan
      Dec 23 '18 at 19:20














    0












    0








    0





    $begingroup$

    I don't think there is an easy way. The chance you get $4$ is
    $0.4$ (that you added $4$ at all) times $Big[(1-0.1)(1-0.2)(1-0.3)$ (that it is the only number on the list) plus $frac 12big(0.1(1-0.2)(1-0.3)+(1-0.1)0.2(1-0.3)+(1-0.1)(1-0.2)0.3big)$ (because one other number was added) plus $ldotsBig]$ and the dots have the cases where two or three other numbers were added.






    share|cite|improve this answer









    $endgroup$



    I don't think there is an easy way. The chance you get $4$ is
    $0.4$ (that you added $4$ at all) times $Big[(1-0.1)(1-0.2)(1-0.3)$ (that it is the only number on the list) plus $frac 12big(0.1(1-0.2)(1-0.3)+(1-0.1)0.2(1-0.3)+(1-0.1)(1-0.2)0.3big)$ (because one other number was added) plus $ldotsBig]$ and the dots have the cases where two or three other numbers were added.







    share|cite|improve this answer












    share|cite|improve this answer



    share|cite|improve this answer










    answered Dec 23 '18 at 18:19









    Ross MillikanRoss Millikan

    301k24200375




    301k24200375












    • $begingroup$
      Yeah I got as far but that is not an efficient solution; especially not when working with 20 cases; 0.4*0.7*0.8*0.9 + 0.5*0.4*0.3*0.8*0.9 + 0.5*0.4*0.7*0.2*0.9 + 0.5*0.4*0.7*0.8*0.1 + 0.3333*0.4*0.3*0.2*0.9 + 0.3333 * 0.4* 0.7 * 0.2 * 0.1 + 0.3333 * 0.4 * 0.3 * 0.8 * 0.1 + 0.25 * 0.4 * 0.3 * 0.2 * 0.1 (Case where you only can pick 4) + (Cases where you can pick 4 + 1 other number) (Cases where you can pick 4 + 2 other numbers) (Cases where you can pick 4 + 3 other numbers) I was thinking that I must be missing something
      $endgroup$
      – Gerben Banaan
      Dec 23 '18 at 18:24










    • $begingroup$
      I don’t think you were missing anything. Solving problems like this with a neat formula depends on the problem having symmetry. If the chance of adding each number were the same you could just find the chance you don’t get any number, subtract from $1$, and divide by $4$ because of the symmetry. Here you don’t have that, so you have to go through the cases.
      $endgroup$
      – Ross Millikan
      Dec 23 '18 at 19:20


















    • $begingroup$
      Yeah I got as far but that is not an efficient solution; especially not when working with 20 cases; 0.4*0.7*0.8*0.9 + 0.5*0.4*0.3*0.8*0.9 + 0.5*0.4*0.7*0.2*0.9 + 0.5*0.4*0.7*0.8*0.1 + 0.3333*0.4*0.3*0.2*0.9 + 0.3333 * 0.4* 0.7 * 0.2 * 0.1 + 0.3333 * 0.4 * 0.3 * 0.8 * 0.1 + 0.25 * 0.4 * 0.3 * 0.2 * 0.1 (Case where you only can pick 4) + (Cases where you can pick 4 + 1 other number) (Cases where you can pick 4 + 2 other numbers) (Cases where you can pick 4 + 3 other numbers) I was thinking that I must be missing something
      $endgroup$
      – Gerben Banaan
      Dec 23 '18 at 18:24










    • $begingroup$
      I don’t think you were missing anything. Solving problems like this with a neat formula depends on the problem having symmetry. If the chance of adding each number were the same you could just find the chance you don’t get any number, subtract from $1$, and divide by $4$ because of the symmetry. Here you don’t have that, so you have to go through the cases.
      $endgroup$
      – Ross Millikan
      Dec 23 '18 at 19:20
















    $begingroup$
    Yeah I got as far but that is not an efficient solution; especially not when working with 20 cases; 0.4*0.7*0.8*0.9 + 0.5*0.4*0.3*0.8*0.9 + 0.5*0.4*0.7*0.2*0.9 + 0.5*0.4*0.7*0.8*0.1 + 0.3333*0.4*0.3*0.2*0.9 + 0.3333 * 0.4* 0.7 * 0.2 * 0.1 + 0.3333 * 0.4 * 0.3 * 0.8 * 0.1 + 0.25 * 0.4 * 0.3 * 0.2 * 0.1 (Case where you only can pick 4) + (Cases where you can pick 4 + 1 other number) (Cases where you can pick 4 + 2 other numbers) (Cases where you can pick 4 + 3 other numbers) I was thinking that I must be missing something
    $endgroup$
    – Gerben Banaan
    Dec 23 '18 at 18:24




    $begingroup$
    Yeah I got as far but that is not an efficient solution; especially not when working with 20 cases; 0.4*0.7*0.8*0.9 + 0.5*0.4*0.3*0.8*0.9 + 0.5*0.4*0.7*0.2*0.9 + 0.5*0.4*0.7*0.8*0.1 + 0.3333*0.4*0.3*0.2*0.9 + 0.3333 * 0.4* 0.7 * 0.2 * 0.1 + 0.3333 * 0.4 * 0.3 * 0.8 * 0.1 + 0.25 * 0.4 * 0.3 * 0.2 * 0.1 (Case where you only can pick 4) + (Cases where you can pick 4 + 1 other number) (Cases where you can pick 4 + 2 other numbers) (Cases where you can pick 4 + 3 other numbers) I was thinking that I must be missing something
    $endgroup$
    – Gerben Banaan
    Dec 23 '18 at 18:24












    $begingroup$
    I don’t think you were missing anything. Solving problems like this with a neat formula depends on the problem having symmetry. If the chance of adding each number were the same you could just find the chance you don’t get any number, subtract from $1$, and divide by $4$ because of the symmetry. Here you don’t have that, so you have to go through the cases.
    $endgroup$
    – Ross Millikan
    Dec 23 '18 at 19:20




    $begingroup$
    I don’t think you were missing anything. Solving problems like this with a neat formula depends on the problem having symmetry. If the chance of adding each number were the same you could just find the chance you don’t get any number, subtract from $1$, and divide by $4$ because of the symmetry. Here you don’t have that, so you have to go through the cases.
    $endgroup$
    – Ross Millikan
    Dec 23 '18 at 19:20











    0












    $begingroup$

    Let $p(n) (nin{1,2,3,4})$ be the probability that number $n$ is added to the list (e.g., your $0.1, 0.2, 0.3, 0.4$). Then a formula for the probability that the outcome is the specific number $x$ is
    $$1(Abcd)+{1over 2}(ABcd+AbCd+AbcD)+{1over 3}(ABCd+ABcD+AbCD)+{1over 4}(ABCD)
    $$

    where
    $$begin{align}A&=p(x)\
    B&=p(1+(xbmod 4))\
    C&=p(1+((x+1)bmod 4))\
    D&=p(1+((x+2)bmod 4))\
    end{align}$$

    and $a=1-A, b=1-B, c=1-C, d=1-D.$



    Note that $B,C,D$ are simply the add-to-the-list probabilities for the three other numbers besides $x$, and they may be taken in any order. (The above formula just uses $bmod 4$ to express the choice of taking them in cyclic order.)



    In Sage:



    def p(x): return [1/10, 2/10, 3/10, 4/10][x-1]
    def Pout(x):
    A = p(x)
    B = p(1 + (x%4))
    C = p(1 + ((x+1)%4))
    D = p(1 + ((x+2)%4))
    a = 1 - A
    b = 1 - B
    c = 1 - C
    d = 1 - D
    return (A*b*c*d)+(A*B*c*d+A*b*C*d+A*b*c*D)/2+(A*B*C*d+A*B*c*D+A*b*C*D)/3+(A*B*C*D)/4

    print [Pout(x) for x in [1..4]], 1-sum([Pout(x) for x in [1..4]])
    print [Pout(x).n() for x in [1..4]], 1-sum([Pout(x).n() for x in [1..4]])

    [473/7500, 1981/15000, 521/2500, 4411/15000] 189/625
    [0.0630666666666667, 0.132066666666667, 0.208400000000000, 0.294066666666667] 0.302400000000000





    share|cite|improve this answer









    $endgroup$


















      0












      $begingroup$

      Let $p(n) (nin{1,2,3,4})$ be the probability that number $n$ is added to the list (e.g., your $0.1, 0.2, 0.3, 0.4$). Then a formula for the probability that the outcome is the specific number $x$ is
      $$1(Abcd)+{1over 2}(ABcd+AbCd+AbcD)+{1over 3}(ABCd+ABcD+AbCD)+{1over 4}(ABCD)
      $$

      where
      $$begin{align}A&=p(x)\
      B&=p(1+(xbmod 4))\
      C&=p(1+((x+1)bmod 4))\
      D&=p(1+((x+2)bmod 4))\
      end{align}$$

      and $a=1-A, b=1-B, c=1-C, d=1-D.$



      Note that $B,C,D$ are simply the add-to-the-list probabilities for the three other numbers besides $x$, and they may be taken in any order. (The above formula just uses $bmod 4$ to express the choice of taking them in cyclic order.)



      In Sage:



      def p(x): return [1/10, 2/10, 3/10, 4/10][x-1]
      def Pout(x):
      A = p(x)
      B = p(1 + (x%4))
      C = p(1 + ((x+1)%4))
      D = p(1 + ((x+2)%4))
      a = 1 - A
      b = 1 - B
      c = 1 - C
      d = 1 - D
      return (A*b*c*d)+(A*B*c*d+A*b*C*d+A*b*c*D)/2+(A*B*C*d+A*B*c*D+A*b*C*D)/3+(A*B*C*D)/4

      print [Pout(x) for x in [1..4]], 1-sum([Pout(x) for x in [1..4]])
      print [Pout(x).n() for x in [1..4]], 1-sum([Pout(x).n() for x in [1..4]])

      [473/7500, 1981/15000, 521/2500, 4411/15000] 189/625
      [0.0630666666666667, 0.132066666666667, 0.208400000000000, 0.294066666666667] 0.302400000000000





      share|cite|improve this answer









      $endgroup$
















        0












        0








        0





        $begingroup$

        Let $p(n) (nin{1,2,3,4})$ be the probability that number $n$ is added to the list (e.g., your $0.1, 0.2, 0.3, 0.4$). Then a formula for the probability that the outcome is the specific number $x$ is
        $$1(Abcd)+{1over 2}(ABcd+AbCd+AbcD)+{1over 3}(ABCd+ABcD+AbCD)+{1over 4}(ABCD)
        $$

        where
        $$begin{align}A&=p(x)\
        B&=p(1+(xbmod 4))\
        C&=p(1+((x+1)bmod 4))\
        D&=p(1+((x+2)bmod 4))\
        end{align}$$

        and $a=1-A, b=1-B, c=1-C, d=1-D.$



        Note that $B,C,D$ are simply the add-to-the-list probabilities for the three other numbers besides $x$, and they may be taken in any order. (The above formula just uses $bmod 4$ to express the choice of taking them in cyclic order.)



        In Sage:



        def p(x): return [1/10, 2/10, 3/10, 4/10][x-1]
        def Pout(x):
        A = p(x)
        B = p(1 + (x%4))
        C = p(1 + ((x+1)%4))
        D = p(1 + ((x+2)%4))
        a = 1 - A
        b = 1 - B
        c = 1 - C
        d = 1 - D
        return (A*b*c*d)+(A*B*c*d+A*b*C*d+A*b*c*D)/2+(A*B*C*d+A*B*c*D+A*b*C*D)/3+(A*B*C*D)/4

        print [Pout(x) for x in [1..4]], 1-sum([Pout(x) for x in [1..4]])
        print [Pout(x).n() for x in [1..4]], 1-sum([Pout(x).n() for x in [1..4]])

        [473/7500, 1981/15000, 521/2500, 4411/15000] 189/625
        [0.0630666666666667, 0.132066666666667, 0.208400000000000, 0.294066666666667] 0.302400000000000





        share|cite|improve this answer









        $endgroup$



        Let $p(n) (nin{1,2,3,4})$ be the probability that number $n$ is added to the list (e.g., your $0.1, 0.2, 0.3, 0.4$). Then a formula for the probability that the outcome is the specific number $x$ is
        $$1(Abcd)+{1over 2}(ABcd+AbCd+AbcD)+{1over 3}(ABCd+ABcD+AbCD)+{1over 4}(ABCD)
        $$

        where
        $$begin{align}A&=p(x)\
        B&=p(1+(xbmod 4))\
        C&=p(1+((x+1)bmod 4))\
        D&=p(1+((x+2)bmod 4))\
        end{align}$$

        and $a=1-A, b=1-B, c=1-C, d=1-D.$



        Note that $B,C,D$ are simply the add-to-the-list probabilities for the three other numbers besides $x$, and they may be taken in any order. (The above formula just uses $bmod 4$ to express the choice of taking them in cyclic order.)



        In Sage:



        def p(x): return [1/10, 2/10, 3/10, 4/10][x-1]
        def Pout(x):
        A = p(x)
        B = p(1 + (x%4))
        C = p(1 + ((x+1)%4))
        D = p(1 + ((x+2)%4))
        a = 1 - A
        b = 1 - B
        c = 1 - C
        d = 1 - D
        return (A*b*c*d)+(A*B*c*d+A*b*C*d+A*b*c*D)/2+(A*B*C*d+A*B*c*D+A*b*C*D)/3+(A*B*C*D)/4

        print [Pout(x) for x in [1..4]], 1-sum([Pout(x) for x in [1..4]])
        print [Pout(x).n() for x in [1..4]], 1-sum([Pout(x).n() for x in [1..4]])

        [473/7500, 1981/15000, 521/2500, 4411/15000] 189/625
        [0.0630666666666667, 0.132066666666667, 0.208400000000000, 0.294066666666667] 0.302400000000000






        share|cite|improve this answer












        share|cite|improve this answer



        share|cite|improve this answer










        answered Dec 26 '18 at 15:19









        r.e.s.r.e.s.

        7,66311953




        7,66311953






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Mathematics Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            Use MathJax to format equations. MathJax reference.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3050554%2fprobability-problem-adding-elements-to-a-list-then-picking-from-that-list%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Le Mesnil-Réaume

            Bundesstraße 106

            Ida-Boy-Ed-Garten