Questions tagged [probability-theory]

Probability theory is the branch of mathematics concerned with distributions, expected values, maximum likelihoods, the description of variation. The simplest examples are coin flips, dice rolls. Other common distributions are uniform, binomial, geometric, poisson, weibull, and a menagerie of others. Applications abound, from simulations, to gaming, to physics, statistics, engineering, economics. Consider: https://mathoverflow.net

probability-theory
Filter by
Sorted by
Tagged with
30 votes
8 answers
26k views

Distributed probability random number generator

I want to generate a number based on a distributed probability. For example, just say there are the following occurrences of each numbers: Number| Count 1 | 150 2 | ...
Mark Conway's user avatar
21 votes
5 answers
25k views

Example for non-iid data

I have read some papers regarding to non-iid data. Based on Wikipedia, I know what iid (independent and identical distributed) data is but am still confused about non-iid. I did some research but ...
Long Thai's user avatar
  • 817
18 votes
3 answers
4k views

Probability of Outcomes Algorithm

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 ...
Kenny's user avatar
  • 183
17 votes
4 answers
5k views

What is the difference between causal models and directed graphical models?

What is the difference between causal models and directed graphical models? What is the difference between causal relationships and directed probabilistic relationships? More concretely, what would ...
Neil G's user avatar
  • 32.6k
14 votes
1 answer
9k views

How does tf.multinomial work?

How does tf.multinomial work? Here is stated that it "Draws samples from a multinomial distribution". What does that mean?
Ahmed Essam El Fakharany's user avatar
8 votes
2 answers
20k views

Expected collisions for perfect 32bit crc

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 ...
Tristan's user avatar
  • 3,865
8 votes
1 answer
17k views

Calculating Probability of a Random Variable in a Distribution in Python

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 ...
Cerin's user avatar
  • 63k
7 votes
4 answers
16k views

How to create a probability by a given percentage?

I'm trying to create a percentage-based probability for a game. E.g. if an item has a 45% chance of a critical hit, that must mean it is 45 of 100 hits would be critical. First, I tried to use a ...
maelstrom's user avatar
7 votes
2 answers
14k views

Probability notation [closed]

I want to ask you about the notation in probability. I know that P(A | B) = the conditional probability that event A occurs given that event B has occurred already But I cannot find what A,B ...
user1328370's user avatar
6 votes
0 answers
2k views

Flip a probability tree in R

Currently taking a course on decision analysis. There is a concept called "flipping a probability tree", illustrated in the following example. May I know: (1) Is there a way to do the above ...
dwstu's user avatar
  • 869
5 votes
1 answer
654 views

multivariate normal random numbers from Matlab to C#

I am converting a code written on Matlab to C#. In Matlab, there is a function called mvnrnd which is amultivariate normal random number generator. This requires two inputs: n x d mean matrix and d-...
user3170073's user avatar
4 votes
2 answers
7k views

Reference for wasserstein distance function in python

We are trying to calculate the distance between two discrete 1-d distributions. Our purpose is to compute a distance function that follows the intuition of optimal transport: Our distributions are ...
PmN's user avatar
  • 43
4 votes
2 answers
116 views

JS inverting probabilities

I'm generating a grid of objects, each of which has one of 3 colors. Assume I'm filling a particular grid cell. I know that around this cell there are, for example, 1 object of color 0, 1 of color 1 ...
Alex Chashin's user avatar
  • 3,395
4 votes
1 answer
387 views

Matlab or Mathematica: Need help in computing the Pdf for sum of unknown named distribution and normal random variable

Is it possible to apply convolution theorem or software like Mathematica to find a closed form expression for the pdf of Z = R + X where f_R(r;k,d) = kdr^(d-1)(1-r^d)^(k-1) and X is zero mean Gaussian ...
Srishti M's user avatar
  • 543
4 votes
0 answers
350 views

How to obtain the probability distribution of a sum of dependent discrete random variables more efficiently

I hope you are well. I was wondering if you could help me with the question provided in the attached link, please. Below the link I attach an R-code that solves the problem recursively for particular ...
Student1981's user avatar
4 votes
0 answers
67 views

How could time series prediction be applied in a real-time setting where it is infeasible to track every single item?

The problem: Find the estimated lifetime of an object (e.g. the time it is written next) or the corresponding PDF. This is known as a renewal process. Constraint: it is infeasible to track metadata ...
DivineTraube's user avatar
3 votes
1 answer
6k views

Understanding PyTorch Bernoulli distribution from the documention

So I was reading the pytorch document trying to learn and understand somethings(because I'm new to the machine learning ), I found the torch.bernoulli() and I understood (I miss understood it) that it ...
Mostafa Osama's user avatar
3 votes
2 answers
2k views

How can I find the source code for scipy.stats.mvn?

I was using the function mvn.mvnun() in the scipy.stats module to calculate the CDF of a given multivariate normal distribution in my paper. The reviewer asked me how I estimated the CDF since the CDF ...
Guoyang Qin's user avatar
3 votes
3 answers
390 views

Batch scripting Issues with random, probability or a bug

Please excuse any mistakes, this is my first post! Recently I was bored and was trying to make a batch script clone of an arcade game I once saw: http://antikrish.com/2013/01/28/whittakers-ascot-gold-...
user2928774's user avatar
3 votes
2 answers
6k views

How to generate a random number with a specific probability density function?

I am trying to model shadowing and fast fading for mobile wireless networks. For fast fading, Rayleigh fading is a reasonable model to use. The envelope of the channel response will be Rayleigh ...
Lauren's user avatar
  • 157
3 votes
1 answer
665 views

How to Make a Uniform Random Integer Generator from a Random Boolean Generator?

I have a hardware-based boolean generator that generates either 1 or 0 uniformly. How to use it to make a uniform 8-bit integer generator? I'm currently using the collected booleans to create the ...
Andika Wasisto's user avatar
3 votes
1 answer
390 views

R and probability

I'm trying to write a code to get the probability of a certain scenario. There are 52 cards broken down into 4 Suit piles. 1 card is randomly drawn from each pile to make a 4 card combination and then ...
user208513's user avatar
3 votes
1 answer
417 views

Should Naive Bayes multiple all the word in the vocabulary

I am using Naive Bayes in text classification. Assume that my vocabulary is ["apple","boy","cup"] and the class label is "spam" or "ham". Each document will be covered to a 3-dimentional 0-1 vector. ...
Rongshen Zhang's user avatar
3 votes
2 answers
1k views

Monte Carlo simulation for tossing a coin to get a certain pattern

Inspired by this article: Statistics of Coin-Toss Patterns, I have conducted a Monte Carlo simulation for determining the expected number of tossing a coin to get a certain pattern by using Excel VBA. ...
Anastasiya-Romanova 秀's user avatar
3 votes
4 answers
1k views

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

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 ...
Abhishek Yadav's user avatar
3 votes
2 answers
563 views

Multiple ngrams in transition matrix, probability not adding to 1

I'm trying to find a way to make a transition matrix using unigrams, bigrams, and trigrams for a given text using python and numpy. Each row's probabilities should equal to one. I did this first with ...
iamjane's user avatar
  • 162
3 votes
1 answer
196 views

How to decompose efficiently dpoibin into its summands in R?

The Poisson-Binomial distribution concerns the probability of the number of successes in a sequence of independent Bernoulli trials with different probabilities of success. This is a generalization of ...
Student1981's user avatar
3 votes
0 answers
954 views

How to find probability from a fitted copula in R?

I need to find probability using a fitted copula. For example, the Student t copula was used. Then the random bivariate variable tsim01 was generated with the rCopula() function on range [0,1]. As ...
Nick's user avatar
  • 1,086
2 votes
3 answers
4k views

how to implement non uniform probability distribution?

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 ...
Reddy's user avatar
  • 1,630
2 votes
2 answers
11k views

Error trying to use the function rbern in [R] [duplicate]

I'm trying to use rbern function in R, but it says the following message rbern (10, 0.1) Error: Could not find the "rbern" I even tried to load the library (Rlab) and will not let me, I'm doing ...
franvergara66's user avatar
2 votes
1 answer
411 views

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

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); ...
Star's user avatar
  • 2,259
2 votes
1 answer
3k views

In a random graph: What is the probability that a node has a link to any node on a list x defined special nodes?

I have this problem for a calculation I'm doing on an observed network. Let's imagine a random graph G(N,p) where N is the number of nodes and p is the probability of an edge being formed between any ...
nJGL's user avatar
  • 844
2 votes
2 answers
1k views

How to get random number with each number has its own probability [duplicate]

For example, I want to get random number from set S = {0, 1, 2, 3}. But instead of each number has same probability to shown (which is 25%), now I have different probability for each number, let say {...
Agung Pratama's user avatar
2 votes
1 answer
128 views

Simulating a dice throw with threadlocalrandom does not converge to the expected value

I was trying to verify the expected value formula in java. I did something very trivial, I simulated the roll of a dice, but I mapped each side to a specific value. So each value has probability of 1/...
Jim's user avatar
  • 4,109
2 votes
2 answers
140 views

Find repeated triads in arrays

I have a collection of arrays that include numbers from 1 to 10. The size of each array is 5. For example [1,2,3,4,5] [3,4,9,8,2] [1,5,7,9,2] [1,2,5,9,7] ........... [3,8,1,6,9] What ...
dev's user avatar
  • 1,377
2 votes
1 answer
827 views

Sample data from combination of two probability distributions

I want to make a mock catalogue. I have access to two sets of real data and I want to use their properties to generate the mock catalogue: The first one contains the information from magnitude and ...
Dalek's user avatar
  • 4,268
2 votes
1 answer
582 views

How to generate a random stochastic matrix or ndarray?

I was looking for a crate that would allow me to easily and randomly generate probability vectors, stochastic matrices or, in general, ndarrays that are stochastic. For people not familiar with these ...
nbro's user avatar
  • 15.8k
2 votes
1 answer
35 views

Is there any relationship between number of nodes in a path/paths taken from a graph and its/their cost?

If we take a path from a graph with X number nodes/hops , and evaluate its cost C according to its edges weights . Can we obtain any relationship between X and C ? Is there anything in probability ...
Paulo's user avatar
  • 409
2 votes
1 answer
409 views

Time complexity (Big-O notation) of Posterior Probability Calculation

I got a basic idea of Big-O notation from Big-O notation's definition. In my problem, a 2-D surface is divided into uniform M grids. Each grid (m) is assigned with a posterior probability based on A ...
santobedi's user avatar
  • 827
2 votes
1 answer
215 views

in the formula of the conditional probability, what would happen if the conditioning event be a null event?

In the formula of the conditional probability, p(a|b)=p(ab)/p(b) what would happen if the conditioning event be a null event, i.e. p(b)=0 in the formula? thanks.
user3739432's user avatar
2 votes
1 answer
431 views

How do Bayes nets simplify things?

I recently came across bayes networks. I read that they help in reducing the dimensionality of the joint probability distribution of n random variables (let them be boolean). In General P(X1,X2,X3,......
ishan3243's user avatar
  • 1,900
2 votes
1 answer
3k views

How to weigh a function with 2 variables with a Gaussian distribution in python?

I've been working with this for the last days and I couldn't see yet where is the problem. I'm trying to weight a function with 2 variables f(q,r) within a Gaussian distribution g(r) with a specific ...
Guason's user avatar
  • 33
2 votes
1 answer
945 views

Birthday paradox in DataBase (calculate collision probability)

According to Birthday paradox: If i apply it to the Database (please correct me if I'm wrong): if we need to store UNIQUE hashed data in Database and we have a hash algorythm that can generate 365 ...
rinchik's user avatar
  • 2,660
2 votes
3 answers
2k views

Computationally simple pseudo-Gaussian distribution with varying mean and standard deviation?

This picture from Wikipedia has a nice example of the sort of functions I'd ideally like to generate: Right now I'm using the Irwin-Hall Distribution, which is more or less a polynomial approximation ...
Justin L.'s user avatar
  • 13.6k
2 votes
0 answers
331 views

How can I include categorical distributions as observed data in PyMC3?

I have a dataset where each observation is basically a series of noisy measurements and one of the measurements contains signal. Raw observed data y: [[ 1.93542253e-01 1.39657327e-04 7....
Chris's user avatar
  • 676
2 votes
0 answers
296 views

Hash Code of a Random Number [closed]

I have a random number sequence (say 6 bytes) I now want to generate a shorter sequence from the original sequence (say 3 bytes) What is the best way of acheiving this so that the randomness of the ...
OneGuyInDc's user avatar
  • 1,557
2 votes
1 answer
115 views

R - Find the chance of each subset in a given universe

Let me start with an easy example of my problem. Assume a universe of 10 people, where 1 person owns product A and 2 persons own product B U=10, A=1, B=2 Now I want to find the chances that: 1) a ...
slo0t's user avatar
  • 63
1 vote
4 answers
8k views

How to obtain a value based on a certain probability

I have some functions which generate double, float, short, long random values. I have another function to which I pass the datatype and which should return a random value. Now I need to choose in that ...
Manas's user avatar
  • 521
1 vote
2 answers
818 views

Calculate current probability in respect to prior probabilities to get uniform distribution

Disclaimer: not sure if title of question is accurate... Let's say I need to wash the dishes within the next 100 minutes. I know I MUST do it after 100 minutes as the latest. I ask myself every 2 ...
Niels Kristian's user avatar
1 vote
1 answer
3k views

How to implement the standard normal cumulative distribution function in C (or other language)

First of all, for those of you who don't know this law, don't be afraid it's actually pretty simple. On this link http://en.wikipedia.org/wiki/Black%E2%80%93Scholes_model you will see this law from a ...
PiggyGenius's user avatar

1
2 3 4 5