Skip to content

atom-sun/countpigs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Counting pigs problem

Problem of counting pigs

Problem description

There are N pigs in a hog log. Select Q of them once. Then put them back. After M times selecting, ask the expectation value of the number (k) of pigs that have ever been selected.

The code

  • simulates the process of selecting pigs.
  • gives recursion formula of the probability of (n, m, q, k) event.
    That is, select from $n$ pigs $m$ times with $q$ each time that results in $k$ pig(s) been selected.

About the author:

About

Problem of counting pigs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published