PDA

View Full Version : python chance calculations



eragon100
November 13th, 2009, 10:54 AM
Hello guys!

I want to write a program in Python to do chance calculations, you know, like binomcdf and bimompdf functions on the TI calculator, and just general chances.

Example: "500 Ubuntuforums.org users get interviewed. 280 of them turn out to be Anime fans. What is the chance that if you select 60 people from the 500, at least 40 of them are anime fans?"

Are there any handy modules/functions in python for calculating chances? Google isnīt giving me any usefull hits :(

A_Fiachra
November 13th, 2009, 04:36 PM
NumPy, StatPy and SciPy have way more than combinitorics and statistics, but they are a place to start.

There is a Python binding to R -- also overkill, but good to know.

eragon100
November 13th, 2009, 05:23 PM
NumPy, StatPy and SciPy have way more than combinitorics and statistics, but they are a place to start.

There is a Python binding to R -- also overkill, but good to know.

Thanx for the info! :popcorn:

A_Fiachra
November 13th, 2009, 06:22 PM
Don't forget to look into weighted distributions (google will give you plenty of leads)

Can+~
November 13th, 2009, 10:44 PM
Hello guys!

I want to write a program in Python to do chance calculations, you know, like binomcdf and bimompdf functions on the TI calculator, and just general chances.

Example: "500 Ubuntuforums.org users get interviewed. 280 of them turn out to be Anime fans. What is the chance that if you select 60 people from the 500, at least 40 of them are anime fans?"

Are there any handy modules/functions in python for calculating chances? Google isnīt giving me any usefull hits :(

I would stick to only R, and learn it properly, although it's not the prettiest language.

Also, two strata, a population and a sample? That looks like a hypergeometric distribution (http://en.wikipedia.org/wiki/Hypergeometric_distribution).

TheStatsMan
November 14th, 2009, 08:04 AM
I would stick to only R, and learn it properly, although it's not the prettiest language.

Also, two strata, a population and a sample? That looks like a hypergeometric distribution (http://en.wikipedia.org/wiki/Hypergeometric_distribution).

I don't see how R is any more suitable than Python (or any other language for that matter) for this kind of problem.