Back to homeMathematics · High School Year 3 · Physics-Math · Change subject
Start for free
Prep 3 Tech · Mathematics
Randomness and probability · Probability

Combinatorics and Probability: Counting, Bayes, Binomial, and Normal

Before you start, make sure you know: Classical (Laplace) probability (Secondary Year 2)

A cybersecurity team at a company in Monterrey requires 8-character passwords. A program tries millions of combinations per second. How many are there in total? How likely is it that it guesses one by chance? To answer, you first have to count correctly. Then we will use that count in probability, in Bayes' theorem, and in the binomial and normal distributions, which are what exams like the EXANI-II and the UNAM and IPN admission exams ask for.

Review: Counting Techniques

Diagram for choosing the counting technique depending on whether order matters and whether there is repetition. does order matter? yes → permutations does order matter? no → combinations with repetition: nʳ · without repetition: n!/(n−r)! arrange all without repetition: n!
Practice★☆☆Not started
A 2nd-year Bachillerato student wants to set up a $4$-digit access code with different digits for their gym locker. They decide to use only the odd digits…

A 2nd-year Bachillerato student wants to set up a $4$-digit access code with different digits for their gym locker. They decide to use only the odd digits $\{1, 3, 5, 7, 9\}$ and cannot repeat any digit.

  1. a) How many different codes can they create?
  1. b) If the student forgets the code but remembers that the first digit was a $7$, how many different codes would they have to try at most?
Solve

Position Restrictions

Practice★☆☆Not started
In a robotics championship, a team must select $3$ representatives from a group of $8$ students to present the project to the panel of judges. a) In how many different…

In a robotics championship, a team must select $3$ representatives from a group of $8$ students to present the project to the panel of judges.

  1. a) In how many different ways can the group of representatives be chosen if the selection order does not matter?
  1. b) If among the $8$ students there are $2$ who specialise in programming and it is decided that at least one of them must be in the group, how many different selections are possible?
Solve
Practice★★☆Not started
A streaming platform is designing a new custom interface. For the user profile, an avatar can be chosen by combining the following elements: 4 different face shapes, 5…

A streaming platform is designing a new custom interface. For the user profile, an avatar can be chosen by combining the following elements: 4 different face shapes, 5 types of hairstyle and 3 styles of glasses. In addition, the username must be a 5-character string consisting of 3 lower-case letters (from a 26-letter alphabet) followed by 2 digits.

  1. a) How many different avatars can be created?
  2. b) How many distinct usernames can be generated if neither letters nor digits can be repeated?
  3. c) If a user decides to choose their avatar and username at random (under the conditions of part b), what is the probability that their name starts with the letter "z" and ends with the digit "9"?
5 Hairstyles 4 Faces 3 Glasses USER ID z a b 3 Letters (26) 1 9 2 Digits (10)
Solve

Several Groups and Classical Probability

With classical (Laplace) probability, $P(A)=\dfrac{\text{favorable outcomes}}{\text{possible outcomes}}$, and both are counted using combinatorics.

Product of combinations: 20 ways to choose three biologists times 6 ways to choose two chemists give 120 committees. C(6,3) = 20 biologists × C(4,2) = 6 chemists 20 × 6 = 120 ways
Practice★★☆Not started
A laboratory has 8 precision temperature sensors and 6 humidity sensors. For an environmental control experiment, 4 sensors must be selected at random. a) In how many…

A laboratory has 8 precision temperature sensors and 6 humidity sensors. For an environmental control experiment, 4 sensors must be selected at random.

  1. a) In how many different ways can the selection of 4 sensors be made if order does not matter?
  2. b) What is the probability that exactly 2 temperature sensors and 2 humidity sensors are selected?
  3. c) What is the probability that all selected sensors are of the same type?
8 Temperature T T T T T T T T 6 Humidity H H H H H H n=14 Choose 4 (unordered) Sample ? ? ? ? k=4
Solve
Practice★★★Not started
A competitive examination consists of $80$ topics. The candidate studies $55$ topics chosen at random. The examination board draws $3$ topics by lottery and the…

A competitive examination consists of $80$ topics. The candidate studies $55$ topics chosen at random. The examination board draws $3$ topics by lottery and the candidate must choose one to write on.

  1. a) What is the probability that the candidate does not know any of the three drawn topics?
  2. b) What is the probability that they know exactly two of the topics?
  3. c) If the candidate passed the examination (which implies they knew at least one of the topics), what is the probability that they knew all three drawn topics?
TOTAL: 80 TOPICS 55 Studied 25 Not studied 3 drawn T₁ ? T₂ ? T₃ ? The candidate chooses 1 to answer
Solve

Repeated Elements and Blocks

Practice★★★Not started
A cybersecurity team is analysing the vulnerability of an access system that uses passwords of $8$ characters. The allowed characters are the $26$ letters of the…

A cybersecurity team is analysing the vulnerability of an access system that uses passwords of $8$ characters. The allowed characters are the $26$ letters of the alphabet (case-insensitive) and the digits from $0$ to $9$. A password is considered "strong" if it meets the following conditions:

  1. It contains exactly $2$ distinct numbers and $6$ letters.

  2. The letters cannot be repeated.

  3. The two numbers must be in consecutive positions.

Calculate:

  1. a) The total number of strong passwords that can be generated.
  2. b) If brute-force software generates a random password following only the structure of $8$ characters (letters or numbers), what is the probability that it guesses a specific strong password on the first attempt?
Alphabet: 26 letters (6 distinct chosen) Digits: 10 numbers (2 distinct chosen) L₁ L₂ L₃ N₁ N₂ L₄ L₅ L₆ Block of 2 consecutive digits 7 possible positions in the string
Solve

The Binomial Theorem

Combinatorial numbers also appear when expanding powers of a binomial. When multiplying $(a+b)^n$, each term comes from choosing $b$ in $k$ of the $n$ factors, and that can be done in $\binom{n}{k}$ ways.

Pascal's triangle up to row 4, where each number is the sum of the two above it. 1 11 121 1331 14641
Practice★☆☆Not started
Use the properties of binomial coefficients and the Binomial Theorem to solve: a) Fully expand the expression $(x + 2)^4$. b) Without expanding the whole binomial,…

Use the properties of binomial coefficients and the Binomial Theorem to solve:

  1. a) Fully expand the expression $(x + 2)^4$.
  1. b) Without expanding the whole binomial, calculate the value of the coefficient of the term containing $x^3$ in the expansion of $(x + 3)^5$.

The figure shows the rows of Pascal's triangle up to $n = 5$. Its numbers are the binomial coefficients $\binom{n}{k}$: remember that the coefficient of a term of the binomial, besides that number, also includes the powers of the second term.

Pascal's triangle from row n = 0 to row n = 5, with row 4 associated with (x+2)⁴ and row 5 associated with (x+3)⁵n = 0n = 1n = 2n = 3n = 4n = 511112113311464115101051→ (x+2)⁴→ (x+3)⁵
Solve
Practice★★★Not started
In the expansion of a new binomial, an engineering student needs to determine certain coefficients. Consider the binomial expansion of…

In the expansion of a new binomial, an engineering student needs to determine certain coefficients. Consider the binomial expansion of $Q(x) = \left( \dfrac{x^2}{2} - \dfrac{k}{x} \right)^{12}$, where $k$ is a positive real number.

  1. a) Determine the value of $k$ knowing that the term independent of $x$ in the expansion of $Q(x)$ is equal to $7920$.
  2. b) Having found $k$, calculate the coefficient of the term containing $x^9$.
Solve

Properties of Probability and Contingency Tables

Practice★☆☆Not started
Let $A$ and $B$ be two events associated with a random experiment such that $P(A) = 0.6$, $P(B) = 0.4$ and $P(A \cap B) = 0.2$. Calculate the following probabilities: a)…

Let $A$ and $B$ be two events associated with a random experiment such that $P(A) = 0.6$, $P(B) = 0.4$ and $P(A \cap B) = 0.2$. Calculate the following probabilities:

  1. a) $P(A \cup B)$
  1. b) $P(\bar{A} \cap \bar{B})$ (probability that neither $A$ nor $B$ occurs).
  1. c) $P(A - B)$ (probability that $A$ occurs but $B$ does not occur).

The Venn diagram shows the events $A$ and $B$ within the sample space $E$, with the probability of the intersection.

Venn diagram with two overlapping events A and B inside the sample space E; the intersection shows 0,2EAB0.2
Solve
Practice★☆☆Not started
In a study on the use of mobile devices in a class of $30$ students, the following contingency table was obtained, classifying students by their preferred operating…

In a study on the use of mobile devices in a class of $30$ students, the following contingency table was obtained, classifying students by their preferred operating system and whether they regularly shop online:

Online Purchases ($S$) No Purchases ($N$) TOTAL
Android ($A$) $12$ $6$ $18$
iOS ($I$) $8$ $4$ $12$
TOTAL $20$ $10$ $30$

If a student is chosen at random, calculate:

  1. a) The probability that they use iOS.
  1. b) The probability that they make online purchases given that they use Android.
  1. c) Are the events "Using Android" and "Making online purchases" independent? Justify your answer.
Solve
Practice★★☆Not started
In a robotics competition, teams must pass two independent tests. It is known that the probability of a robot passing the speed test is $P(V) = 0.75$ and the probability…

In a robotics competition, teams must pass two independent tests. It is known that the probability of a robot passing the speed test is $P(V) = 0.75$ and the probability of passing the accuracy test is $P(P) = 0.60$. Calculate the probability that a randomly chosen team:

  1. a) Passes at least one of the two tests.
  2. b) Passes the speed test but not the accuracy test.
  3. c) Given that it has passed at least one test, what is the probability that it has passed both?
Solve

Total Probability and Bayes' Theorem

Let's start with a simple simulation in your notebook, without formulas. A workshop has two lines: L1 produces 60% of the parts and 2% of them come out defective; L2 produces 40% and 5% of them come out defective. Imagine 1,000 parts produced.

  • From L1 come 600, and 12 are defective ($600\times0.02$).

  • From L2 come 400, and 20 are defective ($400\times0.05$).

In total there are 32 defective parts. If you pick a defective one, which line is it more likely to come from? From L1 come 12 of 32 and from L2 come 20 of 32: $12/32=0.375$. That idea, written with probabilities, is Bayes' theorem.

With a tree diagram, each branch multiplies and each final path is added.

Probability tree: two production lines, with the probability of a defective or good part on each. 0.60.4 L1L2 0.020.98 0.050.95 defectivegood defectivegood
Practice★☆☆Not started
A video game server has two connection nodes: Node 1, which serves $70\%$ of the users, and Node 2, which serves the rest. It is known that $5\%$ of the connections on…

A video game server has two connection nodes: Node 1, which serves $70\%$ of the users, and Node 2, which serves the rest. It is known that $5\%$ of the connections on Node 1 suffer lag, while on Node 2 this problem occurs in $10\%$ of the connections.

  1. a) Represent the situation using a probability tree diagram.
  1. b) If a player joins the server at random, what is the probability that their connection suffers lag?
Solve
Practice★☆☆Not started
Three phone operators, $M_1$, $M_2$ and $M_3$, handle $40\%$, $35\%$ and $25\%$ of customer service call center calls, respectively. The percentage of calls that drop…

Three phone operators, $M_1$, $M_2$ and $M_3$, handle $40\%$, $35\%$ and $25\%$ of customer service call center calls, respectively. The percentage of calls that drop unexpectedly for each operator is $2\%$, $3\%$ and $4\%$, respectively.

A call is chosen at random and turns out to have dropped. Calculate the probability that it was handled by operator $M_1$.

Solve
Practice★★★Not started
A streaming platform uses a recommendation algorithm to predict whether a user will like a new series. The algorithm sometimes fails: $10\%$ of the series that a user…

A streaming platform uses a recommendation algorithm to predict whether a user will like a new series. The algorithm sometimes fails: $10\%$ of the series that a user would love are not recommended ($FN$: false negative), and $20\%$ of the series that a user would dislike are mistakenly recommended ($FP$: false positive).

If $60\%$ of all series in the catalog are potentially to the taste of a specific user, calculate:

  1. a) The probability that the algorithm recommends a randomly chosen series.
  2. b) If the algorithm has just recommended a series to this user, what is the probability that it is indeed a series they like?
Solve

Multi-Stage Tests

When an event is checked only if the previous stage failed (like an email that goes to the second filter only if the first one didn't catch it), the tree is built with that dependence: the probabilities of the second stage are conditional on what happened before.

Practice★★☆Not started
A cybersecurity system uses two filters to detect phishing emails. Filter A detects $92\%$ of these emails, whilst Filter B detects $88\%$. Due to the structure of the…

A cybersecurity system uses two filters to detect phishing emails. Filter A detects $92\%$ of these emails, whilst Filter B detects $88\%$. Due to the structure of the system, an email is analysed by Filter B only if it has not been detected by Filter A. If an email is not detected by either filter, it reaches the user's inbox. It is estimated that $3\%$ of the emails received in the company are phishing attempts.

  1. a) What is the probability that a phishing email reaches the inbox?
  2. b) If an email has reached the inbox, what is the probability that it is actually a phishing email?
Email Incoming Phishing Legitimate FILTER A Detects 92% Blocked FILTER B Detects 88% Blocked Inbox (False Negative) Inbox (Safe Email) 0.03 0.97 0.92 0.08 0.88 0.12 Passes undetected (100%)
Solve
Practice★★☆Not started
A survey of 250 students at a technology center was carried out regarding their use of operating systems. The results are shown in the following contingency table: | |…

A survey of 250 students at a technology center was carried out regarding their use of operating systems. The results are shown in the following contingency table:

Intermediate Vocational Higher Vocational Total
Mainly uses Windows 85 65 150
Mainly uses Linux 40 60 100
Total 125 125 250

If a student is chosen at random, calculate:

  1. a) The probability that they are a Higher Vocational student and mainly use Linux.
  2. b) Given that the student mainly uses Windows, what is the probability that they are an Intermediate Vocational student?
  3. c) Are the events "being a Higher Vocational student" and "mainly using Linux" independent? Justify your answer.
Solve
Practice★★★Not started
An electronic components factory has three production lines: $L_1$, $L_2$ and $L_3$. Line $L_1$ produces twice as much as $L_2$, and $L_3$ produces the same amount as…

An electronic components factory has three production lines: $L_1$, $L_2$ and $L_3$. Line $L_1$ produces twice as much as $L_2$, and $L_3$ produces the same amount as $L_1$ and $L_2$ combined. The percentage of defective components is $1\%$ in $L_1$, $3\%$ in $L_2$ and $2\%$ in $L_3$.

  1. a) Calculate the probability that a component chosen at random from the total production is defective.
  2. b) If we select a component and it turns out to be defective, what is the probability that it comes from line $L_3$?
  3. c) If $10$ components from line $L_1$ are analysed independently, what is the probability that at least one of them is defective?
Solve

The Binomial Distribution

Practice★☆☆Not started
In an electronics factory, the probability that a microchip is defective is $0.02$. If the microchips are packed in boxes of $10$ units and the presence of defects in…

In an electronics factory, the probability that a microchip is defective is $0.02$. If the microchips are packed in boxes of $10$ units and the presence of defects in one is independent of the others:

  1. a) What is the probability that there are no defective microchips in a box?
  1. b) What is the probability that there is exactly one defective microchip in the box? (Express the result using binomial coefficients).
Solve
Practice★★☆Not started
A 3D printing electronics manufacturing company has observed that the probability of a part having a finishing defect is $5\%$. If a batch of 12 parts is printed: a)…

A 3D printing electronics manufacturing company has observed that the probability of a part having a finishing defect is $5\%$. If a batch of 12 parts is printed:

  1. a) What is the probability that exactly 2 parts are defective?
  2. b) What is the probability that there is more than one defective part?
  3. c) Calculate the mean and standard deviation of the number of defective parts in the batch.
Solve
Practice★★★Not started
In a genetics laboratory, the resistance of a plant to a pest is studied. It is known that the probability of a plant being resistant is $p$. $8$ plants are chosen at…

In a genetics laboratory, the resistance of a plant to a pest is studied. It is known that the probability of a plant being resistant is $p$. $8$ plants are chosen at random and it is observed that the probability that exactly $2$ are resistant is equal to the probability that exactly $3$ are resistant.

  1. a) Calculate the value of the probability $p$.
  2. b) With the value of $p$ found, calculate the probability that at least one plant is resistant.
  3. c) Determine the expectation and standard deviation of the number of resistant plants in a sample of $100$ plants.
Solve

Measures of Central Tendency and Dispersion

Before the normal distribution you need to describe a data set with just a few numbers: where its center is and how spread out it is.

The Normal Distribution

The normal distribution $N(\mu,\sigma)$ (with $\sigma$ the standard deviation) has a bell shape that is symmetric about $\mu$. To calculate probabilities you standardize:

$$Z=\frac{X-\mu}{\sigma}\sim N(0,1)$$

and use the cumulative table $P(Z\le z)$ or a calculator or GeoGebra.

Normal bell curve with the area to the right of a value shaded. μ x
Practice★★☆Not started
The range of a new fleet of electric scooters for urban use follows a normal distribution with mean $35$ km and standard deviation $4$ km. a) Calculate the probability…

The range of a new fleet of electric scooters for urban use follows a normal distribution with mean $35$ km and standard deviation $4$ km.

  1. a) Calculate the probability that an e-scooter chosen at random has a range greater than $40$ km.
  2. b) What percentage of e-scooters will have a range between $30$ and $38$ km?
  3. c) If the company wants to ensure that $90\%$ of its e-scooters exceed a certain minimum range $d$, what must be the value of $d$?
d 30 μ=35 38 40 km σ=4 Area = 90% P(30 < X < 38) P(X > 40)
Solve
Practice★★★Not started
The weight of coffee packets produced by a factory follows a normal distribution $N(\mu, \sigma)$. It has been observed that $15.87\%$ of the packets weigh more than…

The weight of coffee packets produced by a factory follows a normal distribution $N(\mu, \sigma)$. It has been observed that $15.87\%$ of the packets weigh more than $510$ grams, and that $2.28\%$ of the packets weigh less than $480$ grams.

  1. a) Calculate the mean $\mu$ and standard deviation $\sigma$ of the distribution. (Recall that for a $Z \sim N(0,1)$, $P(Z < 1) \approx 0.8413$ and $P(Z < 2) \approx 0.9772$).
  2. b) If the net weight indicated on the label is $500$ grams, what percentage of the packets is below the legal weight?
Solve

Approximating the Binomial with the Normal

Practice★★☆Not started
It is known that $15\%$ of users visiting a computer components retail website end up making a purchase. If on a given day the website receives 400 independent visits:…

It is known that $15\%$ of users visiting a computer components retail website end up making a purchase. If on a given day the website receives 400 independent visits:

  1. a) State which probability distribution the variable "number of purchases made" follows and justify whether it can be approximated by a normal distribution.
  2. b) Using the appropriate approximation, calculate the probability that between 50 and 70 purchases are made (inclusive).
Solve
Practice★★★Not started
A courier company uses drones to deliver packages in a city. The probability of a drone suffering a technical breakdown during a delivery flight is $0.02$. The company…

A courier company uses drones to deliver packages in a city. The probability of a drone suffering a technical breakdown during a delivery flight is $0.02$. The company makes $250$ daily deliveries independently.

  1. a) Justify whether the variable "number of daily breakdowns" can be approximated by a normal distribution. If so, state its parameters.
  2. b) Using the appropriate approximation, calculate the probability that on a given day exactly $5$ breakdowns occur.
  3. c) Calculate the probability that between $3$ and $8$ breakdowns occur (inclusive).
0 1 2 3 4 5 6 7 8 9 10 No. of breakdowns (X) Probability Correction: P(2.5 ≤ X' ≤ 8.5) 4.5 to 5.5 X ~ B(250, 0.02) a) X' ~ N(?, ?) b) P(X = 5) = ? c) P(3 ≤ X ≤ 8) = ? p = 0.02
Solve

Back to the beginning: an 8-character password with 6 distinct letters and 2 digits together has ${}_{26}P_6\times{}_{10}P_2\times7=104{,}432{,}328{,}000$ possibilities, more than a hundred billion. Guessing it blindly has a tiny probability: 1 in that number.

Summary

See all the exercises in this section