Questions tagged [probability]

Consider if your question would be better at stats.stackexchange.com. Probability touches upon uncertainty, random phenomena, random numbers, random variables, probability distributions, sampling, combinatorics.

See also https://statistics.stackexchange.com

Probability theory is a branch of mathematics that studies uncertainty and random phenomena. It operates by introducing a sample space (a set), and associating probabilities (numbers between 0 and 1, inclusive) to certain subsets of this set, in a manner that satisfies some sensible axioms. If the sample space can be thought of as the real line, we obtain random variables; if it is a Euclidean space, we obtain random vectors. Random variables and random vectors have associated probability distributions, which can be characterized by probability density functions, cumulative density functions, moments, characteristic or moment generating functions.

Typically, questions with this tag will deal with computing (exactly or approximately) probabilities of certain events (from winning a lottery to server outages), drawing random samples, approximating distributions, etc. There might be an overlap with statistics and/or statistical packages (R, SAS, Stata).

Synonym: probability-theory

4021 questions
1
vote
0 answers

Poker odds calculation of winning hand type

There are a lot of libraries that calculate the winning probability of texas holdem poker player and the probability of each player having some combinations(pair, straight...). Does anyone know where I can find a library which calculates the…
1
vote
1 answer

probability for winning combination in poker game

We are trying to calculate probabilities(and odds) for "bet on poker" game on which we are working now. To calculate probabilities and odds for each hand we used https://github.com/cookpete/poker-odds library. Now, having probabilities of "Royal…
einsh10
  • 314
  • 1
  • 8
1
vote
1 answer

Difference between probability and likelihood

I had to think through what it meant when I read that likelihood is not probability, but the following case occurred to me. What is the likelihood that a coin is fair, given that we see four heads in a row? We can't really say anything about…
1
vote
3 answers

Probability of a disjunction on N dependent events in Prolog

Does anybody know where to find a Prolog algorithm for computing the probability of a disjunction for N dependent events? For N = 2 i know that P(E1 OR E2) = P(E1) + P(E2) - P(E1) * P(E2), so one could do: prob_disjunct(E1, E2, P):- P is E1 + E2 -…
user3170496
1
vote
1 answer

How to correctly use tensorflow_probability to sampling from random variables' function?

I`m interested in the features of bijectors in tensorflow_probability, so I tried to sampling from a random variable function which is constructed by tfp.bijectors. I just provide my test code blow, and here I privide some detials: the case I used…
1
vote
1 answer

Probability distribution from Clayton Copula in R

I have a Clayton Copula with variables X and Y and I want to get the joint and conditional probabilities P(X≤x, Y≤y) and P(X≤x|Y≤y). For example the probability that X is below its 1st percentile conditional on Y being below its first percentile:…
Sabotar
  • 77
  • 1
  • 6
1
vote
2 answers

C++ computing a probability for an event

I'm trying to simulate a Wild Pokemon encounter. As stated in the formula: The rate of Pokémon encounter is determined from a simple mathematical formula: 1 in (187.5 / ( x )) per step. Let x equal the a value which determines how rare the Pokémon…
Dale Julian
  • 1,560
  • 18
  • 35
1
vote
0 answers

How to find probability of subsequences obtained from sequences in the given dataset?

I have a dataset(CSV file) of sequence of links with their order placed status for each sequence. I have got the subsequences with their count with the help of prefixSpan algorithm(as described here). But I also want to find probability of each…
1
vote
2 answers

Sample from one of two distributions

I want to repeatedly sample values based on a certain condition. For example I want to create a sample of 100 values. With probability of 0.7 it will be sampled from one distribution, and from another probability, otherwise. Here is a way to do…
YefR
  • 369
  • 3
  • 12
1
vote
0 answers

How to populate array with numbers based on odds?

I recently saw a roulette wheel of sorts which contained the following possible numbers. 1, 2, 9, 16, 24, 49j and 49f. Each number has odds of itself over 1. So the odds of rolling a 2 are 2/1 and a 9 is 9/1. I thought it would be a fun (and simple)…
Maelstrom
  • 85
  • 6
1
vote
1 answer

How to distribute agents' attributes randomly according to specific probabilities in Netlogo?

I am relatively new to Netlogo, having completed only a handful of models. Currently working on one for my dissertation where I need to distribute agents' attributes randomly according to specific probabilities, some at the onset of the simulation,…
1
vote
0 answers

How to calculate probablities in a Bayesian network correctly?

I want to solve this exercise and don't know how to calculate the probabilities below. (a) I need to calculate the probability of Y if A and B are = 0 , am I correct? I can write down the network as follows: P(X,A,Y,B) = P(X) P(A|X) P(Y|X)…
1
vote
3 answers

is there an more efficient way to enumerate probability for each of possible outcome of a discrete random variable in python or R?

I am computing the pmf theoretically in Python. here is the code. >>> a_coin = np.array([0,1]) >>> three_coins = np.array(np.meshgrid(a_coin,a_coin,a_coin)).T.reshape(-1,3) >>> heads = np.sum(three_coins, axis = 1) >>> df = pd.DataFrame({'heads':…
user11170845
1
vote
1 answer

How can we find E(X^n) for a discrete random variable X in R?

Suppose values of a discrete random variable X, randomNumbers, and its distribution prob is given. I can find E(X) using the following code: weighted.mean(randomNumbers, prob) How can we find E(X^n) in R? Would this code…
user366312
  • 16,949
  • 65
  • 235
  • 452
1
vote
0 answers

How to decide which Probability distribution to use on a specific problem?

Which probability distribution i can use to understand the number of orders one person can handle in a company? It's like each person has orders which takes minimum of 50 days to complete and no limit is there on how many one can handle.So, i was…