Questions tagged [probability-distribution]

A probability distribution is a function that defines the probability of occurrences of the different possible values of a variable.

What is it?

A probability distribution is a function that defines the probability of occurrences of the different possible values of a variable.

Typical examples of distributions are the uniform distribution in which each value has the same probability, the normal distribution in which the values around the avergage have a higher probability and the extreme values the lowest probability.

See also

315 questions
-1
votes
1 answer

What is the probability that the first defective item occurs in the the fifth item inspected

Q In a production line, the probability of finding a defective item is 0.3 . What is the probability that the first defective item occurs in the the fifth item inspected. f(x)=(1−p)^(x−1)P How to apply this formula here?
-1
votes
2 answers

How can I unpack non-iterable items?

This is my code: d={(i,j):i+j for i in range(1,7) for j in range(1,7)} from collections import defaultdict dinv = defaultdict(list) for i,j in d.values(): dinv[j].append(i) X={i:len(j)/36. for i,j in dinv.iteritems() } print (X) This is…
-1
votes
1 answer

I need to run a fair dice simulation multiple times

I have a program that simulates a dice roll 100 times. I need to know how to run this program 10^5 times, I think it is something to do with numeric. set.seed(123) x <- sample(1:6, size=100, replace = TRUE) hist(x, main="10^6 fair rolls", …
JaredJoss
  • 19
  • 3
-1
votes
1 answer

I do not know how to plot the probability distribution of outcomes of some code in R

I have created a program that simulates the throwing of dice 100 times. I need help with adding up the results of the individual dice and also how to plot the probability distribution of outcomes. This is the code I have: sample(1:6, size=100,…
-1
votes
1 answer

Simulating beta distribution for 6 traits

How can I generate a matrix of 1 and 0 in R, for 1000 items (rows), where each item can only be 1 for a single trait out of 6 possibilities (columns) traits A, B, C, D, E and F e.g. item A B C D E F 1 1 0 0 0 0 0 2 0 1 0 …
-1
votes
1 answer

What is the equation for beta1 prime, beta2 prime and the normalizing constant in the following beta distribution?

Can someone tell me what the separate equations for beta1 prime (B_1) and beta2 prime (B_2) and the normalizing constant are in this beta distribution? How does one go about computing them? θ ^(k+β_1 -1) (1 − θ)(n−k+β_2 −1)/B(k+β_1, n-k +…
-2
votes
2 answers

The function of sum() in python

I am reading some code with python, which is about probability distribution. But in many cases, instead of using a framework like PyTorch to compute distribution, it uses the following code def sample_energy_0(self, y, M): device =…
Aaron
  • 41
  • 1
  • 1
  • 7
-2
votes
1 answer

How to create matrix in STATA

I want to make a sample of two variables, according to a specific probability distribution. I thought of making a matrix that expresses the probability distribution but my code results in "p is not defined". // p =…
Max
  • 1
  • 2
-2
votes
1 answer

How to fix incorrect chi2pdf results in MATLAB R2019A

I am working with MATLAB R2019A (Slightly out of date, I know) on Linux Mint 19.1. For the task I am trying to perform, I need the chi2pdf function, but when I tried to use it, it gave incorrect results. Just to test it, I tried the following, and…
-2
votes
1 answer

Weka probability distribution in classifier

I am doing a machine learning project using Weka .What is meant by Probability distribution appeared in the classifier output in Weka?
-3
votes
1 answer

Coin flip probability

I'm wondering what I should be doing here (please refer to image). I have already defined two vectors which are k=c(0,1) and v=c(runif(2,0.3,0.7)) where alpha=v[1] and beta=v[2]. Afterwards, I used an if statement, if(Xn==k[1]){...} However this is…
-3
votes
1 answer

Random number with Probabilities in C#

I have converted this Java program into a C# program. using System; using System.Collections.Generic; namespace RandomNumberWith_Distribution__Test { public class DistributedRandomNumberGenerator { private Dictionary
user366312
  • 16,949
  • 65
  • 235
  • 452
-3
votes
1 answer

How to generate numbers that follows normal distribution but w.r.t. time in Matlab

As time moves along x-axis, the output value (may be freq or prob) be shown accordingly i.e. as time moves the values should increase initially till mean and then decrease. I have prespecified mean mu=10 and standard deviation sigma=2.
-4
votes
1 answer

Function defined correctly?

I have a pdf defined as P(r, t). I am trying to define the pdf in python, but am new to the program and am unsure if I correctly defined it. Here is the pdf I am trying to define.1 from scipy.special import gamma as G def A(gamma, d): return…
bazinga
  • 11
  • 1
-5
votes
1 answer

How to find Expectation of a Random Variable √X in probability

How to calculate Expected Value of Random Variable √X
1 2 3
20
21