Upgrade to Pro — share decks privately, control downloads, hide ads and more …

[PyConKR2017] 온라인 게임에서의 이항 분포

Jangsea Park
August 13, 2017
930

[PyConKR2017] 온라인 게임에서의 이항 분포

Jangsea Park

August 13, 2017
Tweet

Transcript

  1. ৡۄੋ ѱ੐ীࢲ੄ ੉೦࠙ನ
    ই੉మ ъച ഛܫ ࠙ࢳ
    -[|]- Box and Whisker
    ߅੢द

    View full-size slide

  2. Ѿҗܳ ঌ ࣻ হח प೷

    View full-size slide

  3. ಴ࠄ ҕр
    ز੹ ؍૑ӝ
    H T
    Prob: 0.5 Prob: 0.5

    View full-size slide

  4. ಴ࠄ ҕр
    ই੉మ ъച
    S F
    Prob: 0.1 Prob: 0.9

    View full-size slide

  5. ഛܫ ߸ࣻ X
    S F
    Prob: 0.1 Prob: 0.9
    0 1 2 3 4 5
    X

    View full-size slide

  6. ഛܫ ߸ࣻ X = x
    X = x {s ∈ S : X(s) = x}
    X = 1 {success}
    X = 0 {fail}
    S F
    Prob: 0.1 Prob: 0.9
    0 1 2 3 4 5
    X

    View full-size slide

  7. ഛܫ ೣࣻ P(X=x) = f(x)
    P(X = x) = f(x)
    P(X = 1) = f(1) = 0.1
    P(X = 0) = f(0) = 0.9
    S F
    Prob: 0.1 Prob: 0.9
    0 1 2 3 4 5
    X f
    0 1
    0.1
    0.9
    x
    p

    View full-size slide

  8. ߬ܰ־੉ द೯
    https://en.wikipedia.org/wiki/Bernoulli_trial
    S F
    Prob: 0.1 Prob: 0.9
    0 1 2 3 4 5
    X f
    0 1
    0.1
    0.9
    x
    p

    View full-size slide

  9. ੉೦ ࠙ನ
    https://en.wikipedia.org/wiki/Binomial_distribution

    View full-size slide

  10. ੉೦ ࠙ನ
    https://en.wikipedia.org/wiki/Binomial_distribution
    0
    0 1 2 3 4 5
    X f
    1 2 3
    4 5 6 7
    8 9 10
    6 7 8 9 10

    View full-size slide

  11. ੉೦ ࢎѤ੄ ࣻ
    1 2 3 4 5

    View full-size slide

  12. ੉೦ ࠙ನ vs ਺੉೦ ࠙ನ
    ੉೦࠙ನ
    fixed
    n: ୨ द೯ ࣻ
    p: ࢿҕ ഛܫ
    variable
    k: ࢿҕ പࣻ
    k <= n
    count
    ੿೧૓ द೯ പࣻ ೞীࢲ
    ࢿҕೞח പࣻ
    ਺੉೦࠙ನ
    fixed
    n: ୨ ࢿҕ പࣻ
    p: ࢿҕ ഛܫ
    variable
    k: पಁ പࣻ
    0 <= k < inf
    count
    ੿೧૓ ࢿҕ പࣻܳ ׳ࢿೡ ٸө૑
    पಁೞח പࣻ

    View full-size slide

  13. ਺੉೦ ࠙ನ
    https://en.wikipedia.org/wiki/Negative_binomial_distribution

    View full-size slide

  14. ਺੉೦ ࠙ನ
    https://en.wikipedia.org/wiki/Negative_binomial_distribution
    0
    0 1 2 3 4 5
    X f
    1 2 3
    4 5 6 7
    8 9 inf
    6 7 8 inf

    View full-size slide

  15. ਺੉೦ ࢎѤ੄ ࣻ
    1 2 3 4 p

    View full-size slide

  16. ਺੉೦ ࠙ನ੄ ׮ܲ ಴ӝߨ
    k: पಁ, n: ࢿҕ
    k: ࢿҕ, r: पಁ
    nCr = nCn-r
    5 choose 3 = 5 choose 2
    x: ୨ दب, r: पಁ
    x = k + r

    View full-size slide

  17. P(X<=90) = ?

    View full-size slide

  18. P(X<=?) = 0.5

    View full-size slide

  19. P(X<=?) = 0.99

    View full-size slide

  20. P(X<=?) = 1.0

    View full-size slide

  21. ؊ ࠂ੟ೠ ޙઁ: ݽ੄प೷

    View full-size slide

  22. +6ъ 100,000 ݺ

    View full-size slide

  23. +7ъ 100,000ݺ

    View full-size slide

  24. +10ъ 100,000ݺ

    View full-size slide