Multinomial Distribution
The multinomial distribution is a generalization of the binomial distribution.
While the binomial distribution deals with scenarios that have only two possible outcomes (like success or failure), the multinomial distribution handles experiments with more than two possible outcomes.
Examples:
- Determining blood types in a population (e.g., A, B, AB, O).
- Rolling a dice (possible outcomes: 1, 2, 3, 4, 5, 6).
Parameters:
- n: The number of trials or experiments.
- pvals: A list of probabilities for each possible outcome.
- Example for a fair dice: [1/6, 1/6, 1/6, 1/6, 1/6, 1/6].
- size: The shape of the output array (optional).
Program:
(Simulating Dice Rolls):
from numpy import random
# Simulate rolling a fair dice 6 times
x = random.multinomial(n=6, pvals=[1/6]*6)
print(x)
Output:
[2 2 0 0 1 1]