Skip to content

Bernoulli is a small python program to calculate a bernoulli trial or a bernoulli process.

License

Notifications You must be signed in to change notification settings

ndsvw/bernoulli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Bernoulli

Bernoulli is a small python program to calculate a bernoulli trial or a bernoulli process.

Usage

Just edit the python file and execute it:

python bernoulli.py

A coin is thrown 6 times. How is the probability that the result is exactly 5 times 'head' and 1 time 'tail':

bernoulli_trial(6, 5, 0.5) # 0.09375
#or
bernoulli_trial(6, 1, 0.5) # 0.09375

A default dice is thrown 5 times. How is the probability that the result is less than 2 times a '6'.

bernoulli_process(5, 2, 1.0/6) # 0.96450617284

A coins is thrown 10 times. How is the probability that the result is between 6 and 8 times 'head'?

bernoulli_process_btw(10, 6, 8, 0.5) # 0.3662109375

Inverse:

inverse(0.01) # 100
inverse(0.1) # 10
inverse(0.5) # 2
inverse(0.99) # 1.0101010101
inverse(bernoulli_trial(6, 5, 0.5)) # 10.6666666667

Percent:

percent(0.5) # 50.00%
percent(1.0/6) # 16.67%
percent(bernoulli_trial(6, 5, 0.5)) # 9.38%

About

Bernoulli is a small python program to calculate a bernoulli trial or a bernoulli process.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages