probability-theory

Expected collisions for perfect 32bit crc

主宰稳场 提交于 2019-12-04 11:11:48
问题 I'm trying to determine how my crc compares to an " ideal " 32bit crc. So I ran my crc over 1 million completely random samples of data and collected the amount of collisions, I want to compare this number to the number of collisions I could expect from the " ideal " crc. Does anyone know how to calculate the expected collision for an " ideal " 32bit crc? 回答1: Compare your own CRC with 0x1EDC6F41 as your "ideal" reference. Having said that, there is no ideal 32-bit CRC. Different polynomials

Calculating Probability of a Random Variable in a Distribution in Python

那年仲夏 提交于 2019-12-04 04:35:26
Given a mean and standard-deviation defining a normal distribution , how would you calculate the following probabilities in pure-Python (i.e. no Numpy/Scipy or other packages not in the standard library)? The probability of a random variable r where r < x or r <= x. The probability of a random variable r where r > x or r >= x. The probability of a random variable r where x > r > y. I've found some libraries, like Pgnumerics , that provide functions for calculating these, but the underlying math is unclear to me. Edit: To show this isn't homework, posted below is my working code for Python<=2.6

Probability of Outcomes Algorithm

霸气de小男生 提交于 2019-12-03 09:36:01
问题 I have a probability problem, which I need to simulate in a reasonable amount of time. In simplified form, I have 30 unfair coins each with a different known probability. I then want to ask things like "what is the probability that exactly 12 will be heads?", or "what is the probability that AT LEAST 5 will be tails?". I know basic probability theory, so I know I can enumerate all (30 choose x) possibilities, but that's not particularly scalable. The worst case (30 choose 15) has over 150

to generate random permutation of a array in O(n) time and O(1) space

余生长醉 提交于 2019-12-01 09:08:19
问题 We have to generate Array {1,2,3,..,n} in O(1) space. I am able to do it in O(n) space. I did O(n) space solution by first storing the array and then randomizing it in place. But how to do it without storing array in O(1) space. I m just generating random number and instead of storing them I need to print them as storing would require O(n) space but I need to do it in O(1) space and what my doubt is if we go on generating random number and print them there may be some numbers between 1 to n

Distributed probability random number generator

孤街醉人 提交于 2019-11-28 21:16:49
I want to generate a number based on a distributed probability. For example, just say there are the following occurences of each numbers: Number| Count 1 | 150 2 | 40 3 | 15 4 | 3 with a total of (150+40+15+3) = 208 then the probability of a 1 is 150/208= 0.72 and the probability of a 2 is 40/208 = 0.192 How do I make a random number generator that returns be numbers based on this probability distribution? I'm happy for this to be based on a static, hardcoded set for now but I eventually want it to derive the probability distribution from a database query. I've seen similar examples like this

how to implement non uniform probability distribution?

纵饮孤独 提交于 2019-11-28 10:34:57
I am trying to implement non-uniform probability distribution in genetic algorithm. In the implementation of genetic program, I have an experiment which has 3 outcomes, where each outcome has different probabilities. Let say, probablity of one outcome is 0.85, other is 0.01 and last one is 0.14? P.S: i recently came to know that it is called non-uniform distribution of probability. I'm implementing it in Java, can anyone tell the theory behind non-uniform prob. distribution & also any Java packages implementing it. Feel free to ask me know, if u need any more information on the problem! Thanks

Draw random numbers from pre-specified probability mass function in Matlab

天涯浪子 提交于 2019-11-28 10:34:42
问题 I have a support ( supp_epsilon ) and a probability mass function ( pr_mass_epsilon ) in Matlab, constructed as follows. supp_epsilon=[0.005 0.01 0.015 0.02]; suppsize_epsilon=size(supp_epsilon,2); pr_mass_epsilon=zeros(suppsize_epsilon,1); alpha=1; beta=4; for j=1:suppsize_epsilon pr_mass_epsilon(j)=betacdf(supp_epsilon(j),alpha,beta)/sum(betacdf(supp_epsilon,alpha,beta)); end Note that the components of pr_mass_epsilon sum up to 1 . Now, I want to draw n random numbers from pr_mass_epsilon

Distributed probability random number generator

我是研究僧i 提交于 2019-11-27 13:39:35
问题 I want to generate a number based on a distributed probability. For example, just say there are the following occurences of each numbers: Number| Count 1 | 150 2 | 40 3 | 15 4 | 3 with a total of (150+40+15+3) = 208 then the probability of a 1 is 150/208= 0.72 and the probability of a 2 is 40/208 = 0.192 How do I make a random number generator that returns be numbers based on this probability distribution? I'm happy for this to be based on a static, hardcoded set for now but I eventually want

how to implement non uniform probability distribution?

感情迁移 提交于 2019-11-27 03:49:02
问题 I am trying to implement non-uniform probability distribution in genetic algorithm. In the implementation of genetic program, I have an experiment which has 3 outcomes, where each outcome has different probabilities. Let say, probablity of one outcome is 0.85, other is 0.01 and last one is 0.14? P.S: i recently came to know that it is called non-uniform distribution of probability. I'm implementing it in Java, can anyone tell the theory behind non-uniform prob. distribution & also any Java