

# Permutations and their properties

- Definition of permutations
- Basic properties of permutations
- Notation and terminology
- Permutations on finite sets
- Permutations on infinite sets

Consider the string "ABC". The permutations of this string are:

- ABC
- ACB
- BAC
- BCA
- CAB
- CBA

## Exercise
Determine the number of permutations of the string "ABCD".

To solve this exercise, we can use the formula for the number of permutations of a string of length $n$:

$$P(n) = n!$$

where $n!$ is the factorial of $n$. In this case, $n = 4$ (since "ABCD" has 4 characters), so the number of permutations is:

$$P(4) = 4! = 4 \times 3 \times 2 \times 1 = 24$$

Therefore, there are 24 permutations of the string "ABCD".

# Combinations and their properties

- Definition of combinations
- Basic properties of combinations
- Notation and terminology
- Combinations on finite sets
- Combinations on infinite sets

Consider a set of 5 elements: {A, B, C, D, E}. The combinations of 3 elements from this set are:

- ABC
- ABD
- ABE
- ACD
- ACE
- BCD
- BCE
- BDE
- CDE

## Exercise
Determine the number of combinations of 3 elements from a set of 7 elements.

To solve this exercise, we can use the formula for the number of combinations:

$$C(n, k) = \frac{n!}{k!(n-k)!}$$

where $n$ is the size of the set and $k$ is the number of elements to be selected. In this case, $n = 7$ and $k = 3$, so the number of combinations is:

$$C(7, 3) = \frac{7!}{3!(7-3)!} = \frac{7!}{3!4!} = \frac{7 \times 6 \times 5 \times 4 \times 3 \times 2 \times 1}{3 \times 2 \times 1 \times 4 \times 3 \times 2 \times 1} = 35$$

Therefore, there are 35 combinations of 3 elements from a set of 7 elements.

# Expected value and its applications

- Definition of expected value
- Properties of expected value
- Linearity of expected value
- Applications of expected value

Consider a fair six-sided die. The expected value of the result is 3.5, since each number from 1 to 6 has an equal probability of occurring.

## Exercise
Instructions:

Calculate the expected value of a random variable X, where P(X = 1) = 0.3, P(X = 2) = 0.4, P(X = 3) = 0.3.

### Solution
The expected value of a random variable X is given by:

$$E(X) = \sum_{i \in \text{support}(X)} i \cdot P(X = i)$$

where support(X) is the set of all possible values of X. In this case, support(X) = {1, 2, 3}. So:

$$E(X) = (1 \cdot 0.3) + (2 \cdot 0.4) + (3 \cdot 0.3) = 0.3 + 0.8 + 0.9 = 2.0$$

Therefore, the expected value of the random variable X is 2.0.

The expected value of a random variable can be used to make predictions and make decisions based on the outcomes of random events. It is a fundamental concept in probability and statistics and is used in various applications, such as in gambling, finance, and engineering.

# Probability: definition and axioms

- Definition of probability
- Axioms of probability
- Conditioning on events

Consider a fair six-sided die. The probability of rolling a 1 is 1/6, since there is only one way to roll a 1 out of the six possible outcomes.

## Exercise
Instructions:

Calculate the probability of rolling a 3 or 4 on a fair six-sided die.

### Solution
The probability of rolling a 3 or 4 on a fair six-sided die is given by:

$$P(\text{rolling a 3 or 4}) = P(\text{rolling a 3}) + P(\text{rolling a 4})$$

Since the die is fair, each side has a probability of 1/6. So:

$$P(\text{rolling a 3 or 4}) = (1/6) + (1/6) = 2/6 = 1/3$$

Therefore, the probability of rolling a 3 or 4 on a fair six-sided die is 1/3.

Probability is a measure of the likelihood of an event occurring. It is a fundamental concept in combinatorics and statistics and is used to make predictions and make decisions based on the outcomes of random events. The axioms of probability are a set of rules that govern the behavior of probability.

# Probability distributions: uniform, binomial, Poisson, normal

- Uniform distribution
- Binomial distribution
- Poisson distribution
- Normal distribution

Consider a fair six-sided die. The probability distribution of the result is uniform, since each number from 1 to 6 has an equal probability of occurring.

## Exercise
Instructions:

Calculate the probability of rolling a 3 on a fair six-sided die using a binomial distribution.

### Solution
The probability of rolling a 3 on a fair six-sided die using a binomial distribution is given by:

$$P(\text{rolling a 3}) = \binom{6}{1} \cdot p^1 \cdot (1-p)^{6-1}$$

where p is the probability of success (rolling a 3), which is 1/6. So:

$$P(\text{rolling a 3}) = \binom{6}{1} \cdot (1/6)^1 \cdot (5/6)^{6-1} = 6 \cdot (1/6) \cdot (5/6)^5 = 5/6$$

Therefore, the probability of rolling a 3 on a fair six-sided die using a binomial distribution is 5/6.

Probability distributions describe the possible outcomes of a random variable and their probabilities. They are used to make predictions and make decisions based on the outcomes of random events.

# Variance and standard deviation

- Definition of variance and standard deviation
- Properties of variance and standard deviation
- Relationship between variance and expected value
- Applications of variance and standard deviation

Consider a fair six-sided die. The variance and standard deviation of the result are both 3.162, since each number from 1 to 6 has an equal probability of occurring.

## Exercise
Instructions:

Calculate the variance and standard deviation of a random variable X, where P(X = 1) = 0.3, P(X = 2) = 0.4, P(X = 3) = 0.3.

### Solution
The variance of a random variable X is given by:

$$\text{Var}(X) = E[(X - E(X))^2]$$

where E(X) is the expected value of X. So:

$$\text{Var}(X) = E[(X - E(X))^2] = (0.3 \cdot (1 - 2)^2) + (0.4 \cdot (2 - 2)^2) + (0.3 \cdot (3 - 2)^2) = 1.36$$

The standard deviation of a random variable X is given by:

$$\sigma(X) = \sqrt{\text{Var}(X)}$$

So:

$$\sigma(X) = \sqrt{1.36} \approx 1.18$$

Therefore, the variance of the random variable X is 1.36, and its standard deviation is approximately 1.18.

Variance and standard deviation are measures of dispersion in a data set. They are used to describe the spread of the data and make predictions and make decisions based on the outcomes of random events.

# Conditional probability and Bayes' theorem

- Definition of conditional probability
- Bayes' theorem
- Applications of conditional probability and Bayes' theorem

Consider a fair six-sided die. The probability of rolling a 1 given that the result is even is 1/3, since there is only one way to roll a 1 out of the three possible even outcomes.

## Exercise
Instructions:

Calculate the probability of rolling a 3 given that the result is even using conditional probability.

### Solution
The probability of rolling a 3 given that the result is even is given by:

$$P(\text{rolling a 3} | \text{rolling an even number}) = \frac{P(\text{rolling a 3})}{P(\text{rolling an even number})}$$

Since the die is fair, each side has a probability of 1/6. So:

$$P(\text{rolling a 3}) = 1/6$$
$$P(\text{rolling an even number}) = 3/6 = 1/2$$

So:

$$P(\text{rolling a 3} | \text{rolling an even number}) = \frac{1/6}{1/2} = 1/3$$

Therefore, the probability of rolling a 3 given that the result is even is 1/3.

Conditional probability and Bayes' theorem describe the probability of an event given that another event has occurred. They are used to make predictions and make decisions based on the outcomes of random events.

# Random variables and their properties

- Definition of a random variable
- Types of random variables
- Properties of random variables
- Applications of random variables

Consider a fair six-sided die. The result of rolling the die is a random variable X, where X = 1, 2, 3, 4, 5, or 6.

## Exercise
Instructions:

Calculate the expected value of a random variable X, where P(X = 1) = 0.3, P(X = 2) = 0.4, P(X = 3) = 0.3.

### Solution
The expected value of a random variable X is given by:

$$E(X) = \sum_{i \in \text{support}(X)} i \cdot P(X = i)$$

where support(X) is the set of all possible values of X. In this case, support(X) = {1, 2, 3}. So:

$$E(X) = (1 \cdot 0.3) + (2 \cdot 0.4) + (3 \cdot 0.3) = 0.3 + 0.8 + 0.9 = 2.0$$

Therefore, the expected value of the random variable X is 2.0.

Random variables are mathematical objects that represent random events. They are used to make predictions and make decisions based on the outcomes of random events.

# Independence and dependence of events

- Definition of independence and dependence
- Properties of independent and dependent events
- Applications of independence and dependence

Consider a fair six-sided die. The events "rolling a 1" and "rolling an even number" are independent, since the probability of rolling a 1 is 1/6, and the probability of rolling an even number is 1/2.

## Exercise
Instructions:

Determine whether the events "rolling a 1" and "rolling an even number" are independent or dependent.

### Solution
The events "rolling a 1" and "rolling an even number" are independent, since the probability of rolling a 1 is 1/6, and the probability of rolling an even number is 1/2.

Therefore, the events "rolling a 1" and "rolling an even number" are independent.

Independence and dependence describe the relationship between two or more events. They are used to make predictions and make decisions based on the outcomes of random events.

# Applications of combinatorics and probability

- Applications in gambling
- Applications in finance
- Applications in engineering
- Applications in social sciences

Consider a fair six-sided die. The probability of rolling a 1 is 1/6, which can be used to make predictions in gambling.

## Exercise
Instructions:

Calculate the probability of rolling a 3 or 4 on a fair six-sided die and use this result to make a decision in a gambling game.

### Solution
The probability of rolling a 3 or 4 on a fair six-sided die is 1/3. In a gambling game, you can use this probability to decide whether to bet on rolling a 3 or 4.

Therefore, the probability of rolling a 3 or 4 on a fair six-sided die is 1/3, which can be used to make a decision in a gambling game.

Combinatorics and probability have numerous applications in various fields, including gambling, finance, engineering, and social sciences. They are used to make predictions and make decisions based on the outcomes of random events.