probability

coding horror, the baby boy/girl question, probability

Hi, Just showed one of my flatmates this question from coding horror He's just pointed out something obvious, what is the difference between boy/girl, girl/boy. And if there is a difference then surely there is a difference between girl younger girl older combinations etc. Could be missing something but none of the comments seem to dea...

Combining joint probabilities

Hello, I am trying to work out the expression for a probability distribution (related to bioinformatics), and am having trouble combining the information about a random variable from two different sources. Essentially, here is the scenario: There are 3 discrete random variables X, A & B. X depends on A and B. A and B are related only th...

Probability Question

I have x items and y <= x special items. Out of these I pick z <= x items. Given s where 1 <= s <= y, what is the probability that the z items I picked contain s special items? The particular case I want to apply it to: I have 70 items, 14 are special. I pick 5 of them. What's the chance that 1 is special, 2 are special, etc... up to 5...

Correcting a known bias in collected data

Ok, so here is a problem analogous to my problem (I'll elaborate on the real problem below, but I think this analogy will be easier to understand). I have a strange two-sided coin that only comes up heads (randomly) 1 in every 1,001 tosses (the remainder being tails). In other words, for every 1,000 tails I see, there will be 1 heads. ...

Python, SimPy: How to generate a value from a triangular probability distribution?

I want to run a simulation that uses as parameter a value generated from a triangular probability distribution with lower limit A, mode B and and upper limit C. How can I generate this value in Python? Is there something as simple as expovariate(lambda) (from random) for this distribution or do I have to code this thing? ...

How do I test the quality of an encryption algorithm?

I want to test an encryption algorithm for strength. It doesn't have to be strong, it just has to resist accidental cracking and say, a determined hacker with 10-hours to waste. (I wrote the crypto algorithm. Yes, I know that this is generally a bad idea but I think that I have good reason.) What kind of tests should I do? So far I'...

probability and relative frequency

If I use relative frequency to estimate the probability of an event, how good is my estimate based on the number of experiments? Is standard deviation a good measure? A paper/link/online book would be perfect. http://en.wikipedia.org/wiki/Frequentist ...

Splitting Probabilities

I've the following code in PHP which works fine (returns more or less 10 results each time it runs): function GetAboutTenRandomNumbers() { $result = array(); for ($i = 0; $i < 240; $i++) { if (Chance(10, 240) === true) { $result[] = $i; } } echo '<pre>'; print_r($result); echo '</pre>';...

How do I assess the hash collision probability?

I'm developing a back-end application for a search system. The search system copies files to a temporary directory and gives them random names. Then it passes the temporary files' names to my application. My application must process each file within a limited period of time, otherwise it is shut down - that's a watchdog-like security mea...

Choose random array element satisfying certain property

Suppose I have a list, called elements, each of which does or does not satisfy some boolean property p. I want to choose one of the elements that satisfies p by random with uniform distribution. I do not know ahead of time how many items satisfy this property p. Will the following code do this?: pickRandElement(elements, p) rand...

Estimating a probability given other probabilities from a prior

I have a bunch of data coming in (calls to an automated callcenter) about whether or not a person buys a particular product, 1 for buy, 0 for not buy. I want to use this data to create an estimated probability that a person will buy a particular product, but the problem is that I may need to do it with relatively little historical data ...

Probability time series, observed data probabilities (deja vu)

okay folks...thanks for looking at this question. I remember doing the following below in college however I forgotten the exact solution. Any takers to steer in the right direction. I have a time series of data (we'll use three) of N. The data series is sequential in order of time (e.g. obsOne[1] occurred along with obsTwo[1] and obs...

Probability of observing sequence of 7 of the same (heads or tails) in 100 coin flipping trials?

Inspired by a Radiolab postcast: what ways are there to compute the probability of observing 7 heads (or 7 tails) in a row when flipping a coin 100 times? ...

How can I efficiently calculate the binomial cumulative distribution function?

Let's say that I know the probability of a "success" is P. I run the test N times, and I see S successes. The test is akin to tossing an unevenly weighted coin (perhaps heads is a success, tails is a failure). I want to know the approximate probability of seeing either S successes, or a number of successes less likely than S successes...

Efficiently determining the probability of a user clicking a hyperlink

So I have a bunch of hyperlinks on a web page. From past observation I know the probabilities that a user will click on each of these hyperlinks. I can therefore calculate the mean and standard deviation of these probabilities. I now add a new hyperlink to this page. After a short amount of testing I find that of the 20 users that se...

what is the most efficient way to pick a random card from a deck when some cards are unusable?

I have an array which tells whether a card is in use: int used[52]; This is a terrible way to pick a random card if I have many used cards: do { card = rand() % 52; } while (used[card]); since if I have only 3-4 unused cards, it'll take forever to find them. I came up with this: int card; int k = 0; int numUsed = 0; for (k=...

Inverted beta in MySQL

I need to implement an inverted beta function in MySQL (similar to Excel's BETAINV). There is some related material is available on Wolfram MathWorld's Beta Distribution page. Any clues on where to start implementing this functionality in MySQL? ...

How to run statistics Cumulative Distribution Function and Probablity Density Function using SciPy?

Hi Everybody, I am new to Python and new to SciPy libraries. I wanted to take some ques from the experts here on the list before dive into SciPy world. I was wondering if some one could provide a rough guide about how to run two stats functions: Cumulative Distribution Function (CDF) and Probability Distribution Function (PDF). My use...

efficiently predicting the likelihood of a user clicking a hyperlink

Possible Duplicate: Determining the probability of a user clicking a hyperlink So I have a bunch of hyperlinks on a web page. From past observation I know the probabilities that a user will click on each of these hyperlinks. I can therefore calculate the mean and standard deviation of these probabilities. I now add a new hype...

Help with Probability Equation

I'm trying to put together an app for fun that has a scenario where I need to figure out a probability equation for the following scenario: Suppose I have a number of attempts at something and each attempt has a success rate (known ahead of time). What are the odds after doing all those attempts that a success happens? For example ther...