English
Source / code snippets

Binomialverteilung

 

p.specht

The Binomialverteilung BinVtlg() is a "diskrete" distribution - a which on Einzelereignisse relating. tappt im dunkeln answers The question, How probably its, that with n Münzwürfen (Einzelwahrscheinlichkeit p = 50% for head) or with die-Würfen (´6´ is 1 of 6 Opportunities, Einzelwahrscheinlichkeit therefore p = 1/6 = 16.6667 %) - or with of/ one beliebigen others known Grundsituation - with n-maligem throwing (= with n try) very k time "Erfolg" (a for Fragestellung günstige situation) entering.

through Aufsummieren vieler try can naturally too herausbekommen, How probably its, that k or more Erfolge enter.

Summiert one any these k-Wahrscheinlichkeiten the each n try, must naturally 100% get out.

Window Title upper$("Binomialverteilungsdichte: P(n try, k time success,"+\
" with Einzelerfolgs-probability p)")
'(CL) CopyLeft 2018-04 by P.woodpecker, Wien. OHNE GEWÄHR!
Window Style 24:Window %maxx/4,10 - %maxx/2,%maxy-60

Proc Binom_nCr :parameters N&,k&

    case k&=0:return 1.0:case N&<=0:return 0.0:case (2*k&)>N&:k&=N&-k&
    var P!=1:whileloop k&:P!=P!*(N&-k&+&Loop)/&Loop:endwhile:return P!

endproc

Proc Fac :parameters N&:casenot N&:return 1.0

    if N&>100000:Print " *** FAC() TOO BIG! *** ";:beep:return 0.0:endif

        if N&<171:var p!=1:whileloop N&:p!=p!*&Loop:endwhile:return p!

            else :var s!=0:whileloop N&:s!=s!-lg(&Loop):endwhile:set("decimals",17)
            return st$( round(10^(int(s!)-s!),13))+"e+"+st$(int(-s!) ):endif

        ENDPROC

        Proc BinVtlg :parameters N&,k&,p!

            case (n&<=0) or (k&>n&) or (p!<=0) (p!>=1):return (k&=0)
            case (p!>=1):return (k&>0)
            return Binom_nCr(N&,k&)*p!^k&*(1-p!)^(n&-k&)

        endproc

        Declare p!,n&,k&,su!
        Nochmal:
        CLS:font 2
        print "\n Nötige Vorinformation:"
        print "\n           Erfolgswahrscheinlickeit one Einzelversuchs:":font 0
        print "\n     (z.B. coin p = 50 %; ´6´= 1 Würfelseite of 6 possible: p = 16.6667 %)"
        font 2:print "\n p_Einzel [%] ?: ";
        input p!:case (p!<0) or (p!>100):goto "Nochmal"

        REPEAT

            Print "\n    Gesamtzahl try [0=Restart]?: ";:input n&:case n&=0:BREAK
            print   "      casually amount on Erfolgen ?: ";:input k&
            print   " probability for very these amount: "; 100*BinVtlg(N&,k&,p!/100);" [%]"

            if (N&>1) and (N&<1000):print   "             ... for these Number and More: ";:su!=0

                Whileloop k&,N&:su!=su!+100*BinVtlg(N&,&Loop,p!/100):endwhile:case su!>100:su!=100

                    print su!,"[%]"

                endif

            UNTIL 0

            goto "Nochmal"
 
XProfan 11
Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'...
05/27/21  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

1.288 Views

Untitledvor 0 min.
p.specht11/21/21
R.Schneider11/20/21
Uwe Lang11/20/21
Manfred Barei11/19/21
More...

Themeninformationen

this Topic has 1 subscriber:

p.specht (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie