14 questions linked to/from How to sample from a discrete distribution?
35k views

### How to generate numbers based on an arbitrary discrete distribution?

How do I generate numbers based on an arbitrary discrete distribution? For example, I have a set of numbers that I want to generate. Say they are labelled from 1-3 as follows. 1: 4%, 2: 50%, 3: 46% ...
• 521
772 views

### Inverse sampling for discrete data [duplicate]

I have to pick a ball from a set of balls. Each ball has a size, so I have a distribution for ball sizes (I assume a number between 0-1). I want to pick a new ball at each step with the probability ...
• 33
299 views

• 1,697
2k views

• 931
1 vote
674 views

### How to sample from "biased" binomial distribution (ideally in python/numpy)

I need to sample a variable from a distribution that's like a binomial distribution except with a "bias", I'm not sure what it may be called: $p(X=k)$ is proportional to $k.B(n,p)(k)$ where $B(n,p)$ ...
• 83
118 views

### How to sample a set of numbers, given the discrete probability distribution for the nth largest number

I recently saw a problem stated like this.. Generate a random set of 3 numbers, each distinct, such that The smallest number has the following pdf: {1: 25%, 2: 30%, 3: 15%, 4: 30%} The 2nd ...
• 1,712
1 vote