'Coding has over 700 languages', '67% of programming jobs aren’t in the technology industry', 'Coding is behind almost everything that is powered by electricity'
Last Updated: Jun 30, 2023


Author Alisha Chhabra
Aptitude preparation
Free guided path
9 chapters
99+ problems
Earn badges and level up


The meaning of probability in a dictionary is “how likely something is to happen “or “something likely to happen .” In more general terms, probability is the study of things that might happen. We use it all the time, typically without even thinking about it. We do not solve genuine probability issues in our daily lives but rather utilise subjective probability to choose the course of action or any conclusion. Everything from weather predictions to the possibility of dying in an accident is a probable event.

In real life also probability is utilised to predict some situations like the example given below:

Weather Forecasting:- We always check the weather forecast before going on a trip or having a picnic. Assume the forecast indicates an 80% likelihood of rain. Do you ever wonder where the other 80% comes from? Meteorologists forecast the weather using a particular instrument and approach. They examine the previous days’ historical databases, which have a comparable temperature, humidity, pressure characteristics, etc. And figure out that it rained 80 times out of 100 on similar days in the past.

Source:- Siyavula

In mathematics, it is the capacity to comprehend and evaluate the possibility of any given set of occurrences. The probability is a number between 0 and 1 that represents how likely something is going to happen.

The number of possible outcomes in the sample space divided by the number of possible outcomes defines the probability of an occurrence. The collection of all potential outcomes of an event is referred to as the sample space of that event.

P(E) = n(E)/n(S)

If P(E) represents the probability of an event E, then:

  • P(E) = 0 if and only if E is an impossible event.
  • P(E) = 1 if and only if E is a certain (or sure) event.
  • 0 ≤ P(E) ≤ 1.

For examples:

  • You made a coin toss. It's either head or tail for your sample space.

           The probability of arriving HEAD is:

           P(H) = 1/2 = 0.5, i.e., ( 0 <= 0.5 <= 1)

  • You roll the dice. 1,2,3,4,5,6 is your sample space.

The probability of arriving 6 is:

           P(6) = 1/6 = 0.16666667, i.e., ( 0 <= 0.166666 <= 1)


  1. Impossible event- The event that cannot occur at any chance is known as the Impossible event. An impossible event has a probability of 0 since it cannot happen in any circumstance. 
    For example:
    Getting a 7 on a dice is an improbable occurrence with a 0% chance of occurring. (Because dice contains numbers from 1 to 6)
  2. Sure event:- A sure occurrence is predetermined to occur. 
    For example:
    Tossing a coin once and getting a head or tail is a foregone conclusion since the outcome will always be head or tail. As a result, the chance of a certain thing happening is one.


Now that you have a basic understanding of what exactly probability is, let's solve some examples to grasp the concept in a better way

Questions based on coins

Source: Tenor


Example 1: A coin is tossed two times. What are the chances of getting at least one head?


For any question, the strategy should be to locate the sample spaces first. The coin is tossed twice in this game, with the first time having a chance of landing on either HEAD or TAIL (2). The same is true for the second turn, which is Head or Tail (2).

As a result, the total sample spaces are 2+2 = 4 (HH, HT, TH, TT).

The formula is P(E) = n(E)/n(S), where n(S) = 4.

Using the above sample spaces, n(E) can be computed. We must calculate the chance of receiving at least one head, which implies one or more HEAD.

Now, n(E) = 3 and n(S) = 4 

P(E) = n(E)/n(S)

        = ¾

      = 0.75

Practice Question: A coin is thrown 3 times. What is the probability that at least one head is obtained? ( Ans = 0.875)


Example 2: A coin is tossed three times. What is the probability of getting 2 Heads and 1 Tail if the probability of a head is 0.4 and the tail is 0.6?


List of the possible outcomes = {HHH,HHT,HTH,THH,TTH,THT,HTT,TTT}

Now, count the number of times the event is matching with our expectations:

Count = 3

As we are given the probability in the question itself hence, we will go accordingly. Such types of problems are known as Biased problems

HxHxT + HxTxH + TxHxH = (0.4 x 0.4 x 0.6) + (0.4 x 0.6 x 0.4) + (0.6 x 0.4 x 0.4) 

                                          = 0.288 

Practice Question: Assume we have a biased coin with a 2/3 chance of coming up heads. This coin will be flipped three times. What is the chance that it lands on heads twice in a row? (Ans = 4/9 )

Get the tech career you deserve, faster!
Connect with our expert counsellors to understand how to hack your way to success
User rating 4.7/5
1:1 doubt support
95% placement record
Akash Pal
Senior Software Engineer
326% Hike After Job Bootcamp
Himanshu Gusain
Programmer Analyst
32 LPA After Job Bootcamp
After Job

Questions based on balls from boxes

Source:- 123RF

Drawing one ball at random from the box

Example 1: A box contains 50 red, 10 blue, and 15 black. All the balls are identical, and 1 ball is drawn at random. What is the probability that :

1. The ball is red.

2. The ball is blue.

3. The ball is black


Total number of balls = 50+10+15=75. i.e. n(S) = 75.

1. Ball is red:

n(E) = number of ways of drawing red balls = 50.

Therefore the probability of drawing red balls.

p(E) = n(E)/n(S) = 50/75.

2. Ball is blue:

n(E) = number of ways of drawing blue balls = 10.

Therefore the probability of drawing blue balls.

p(E) = n(E)/n(S) = 10/75.

3. Ball is black:

n(E) = number of ways of drawing black balls = 15.

Therefore the probability of drawing black balls.

p(E) = n(E)/n(S) = 15/75.

Drawing more than one ball at random from the box

Ball drawn with replacement: 

Probability with Replacement is applied to questions in which the results are returned to the sample space. This implies that it is returned to the sample space after picking an item, leaving the number of items unaltered.

For example, assume there are 3 red and 2 white balls in a bag. One ball is chosen at random and then again placed within the box. When we did the second draw, there were still 3 red and 2 white balls in the box. The first draw had no bearing on the second and vice versa.

Example 2: There are 4 red, 3 green, 2 blue, and 1 black ball in a box. A ball is chosen at random. The balls will be returned to the box after each pick.

What is the probability that if a ball or balls are chosen at random, we will select:

1) a red ball?

2) a black ball?

3) not a blue ball?

4) a blue and green ball?

5) a red ball and two green balls?

Source:- mathtec.weebly


Total number of balls :- 4+3+2+1 = 10 

n(S) = 10

1) a red ball

Since there are 4 red balls in the box, the probability of selecting a red ball is:

P(E) = n(E)/n(S)

P(E) = 4/10

2) a black ball

Since there is only 1 black ball in the box, the chances of choosing a black ball are:

P(E) = n(E)/n(S)

P(E) = 1/10

3) not a blue ball

8 balls are not blue; thus the chance of selecting a non-blue ball is:

P(E) = n(E)/n(S)

P(E) = 8/10

4) a blue and green ball

The probability of selecting a blue ball is 2/10.

The probability of selecting a green ball is 3/10.

So the probability of picking both will be:

 2/10 x  3/10 = 6/100=0.06

5) a red ball and two green balls

The probability of selecting a red ball is 4/10.

The probability of selecting a green ball is 3/10.

The second green ball is likewise 3/10 since the ball is returned to the box. As a result, the probability is: 4/10 x 3/10 x 3/10 = 36/1000=0.036

Ball drawn without replacement 

Probability without replacement refers to the fact that after drawing an item, we do not return it to the sample space before drawing another. To put it another way, an item can only be drawn once.

For instance, suppose we pick a candy from a box of nine sweets and then draw a second candy without replacing the first. Of course, the sample space for the second event would no longer be 9 because we had not replaced the first candy. As a result, the sample space for the second event would be 8. In other words, the sample space for the second event has been altered.

Example 3: There are 5 white balls and 9 red balls in each bag. Three balls are taken from the bag without replacement. What is the probability that all three balls will be white?


Total number of balls: 5+9 = 14

Probability of drawing a white ball = 5 / 14

1st draw:

= (5/14)

None are replaced (put back in the bag), so there are 4 white balls in a bag of 13 total balls.


2nd draw:

= (4/13)

Again, no balls are replaced, so there are 3 white balls in a bag of 12 total.


3rd draw:

= (3/12)

Multiply the probabilities together to find the chance of drawing white 3 times in a row.

= (5/14)x(4/13)x(3/12)

= 0.027

Let us have a look at some questions on Cards as well:-

Questions based on a deck of cards


Source:- Pinterest

Before moving on to the questions, let's recall some basic facts about the cards. 

Here are the fundamental facts required to determine card probabilities.

The standard deck of cards consists of 52 cards. 

All cards are divided into four suits. 

There are two black suits  ---- spades and clubs and two red suits --- hearts and diamonds. 

In each suite, there are 13 cards, including a 2, 3, 4, 5, 6, 7, 8, 9, 10, a jack, a queen, a king, and an ace. 

A jack, a queen, a king are known as picture cards.

Source:- mathcs

When asked about the probability of selecting a particular card from a deck of cards, you presume that the deck has been well-shuffled and that each card in the deck is visible, however, face down, so you do not know what the suit or value of the card is.

Now let us solve some questions regarding the same:-

Example 1:- What's the chance of getting a king out of a deck of cards?


The event E is drawing a king from a deck of cards in this scenario.

A deck of cards has 52 cards.

As a result, the total number of outcomes is 52.

The number of favorable occurrences is equal to 4 (as there are 4 kings in a deck)

Hence, the probability of occurring the event is: 

P(E) = 4/52 = 1/13

Example 2:- What is the probability of picking a black card from a deck of cards?


Here, event E is drawing a black card from a deck of cards.

The total number of outcomes = 52

The number of favorable outcomes = 26

Thus, the probability of an event occurring is:-

P(E) = 26/52 = 1/2

Example 3:- Ninja has selected a card from a well-shuffled deck. Help him in evaluating the probability of the card being red or a King.


Ninja is aware that event E is the card drawn, which is either red or a King.

The total number of outcomes is 52.

As we know, there are 26 red cards and 4 Kings.

However, two of the red cards are Kings.

If we add 26 and 4, we will be counting these two cards twice.

As a result, the number of events that are favorable to E is:

26 + 4 - 2 = 28.

As a result, the chance of an event occurring is:

P(E) = 28/52 = 7/13.


Example 4:- Help him (Ninja) once again in determining the probability of the following:

  1. Drawing a Red Queen
  2. Drawing a King of Spades
  3. Drawing a Red Number Card


Ninja is aware that the occurrences E1, E2, and E3 are Drawing a Red Queen, Drawing a Spade King, and Drawing a Red Number Card, respectively.

In each scenario, the total number of outcomes is 52.

Drawing a Red Queen:-

There are 26 red cards, including two Queens.

As a result, the probability of event E1 occurring is

P(E1) = 2/52 = 1/26 


Drawing a Spade King:-

Each suit has 13 cards, one of which is the King.

As a result, the probability of event E2 occurring is

P(E1) = 1/52


Drawing a Red Number card:-

There are 9 number cards in each suit, and there are two red suits.

There are a total of 18 red number cards.

As a result, the probability of event E3 occurring is

P(E3) = 18/52 = 9/26

Check out this problem - 8 Queens Problem

Let us now look at some frequently asked questions:

Frequently asked questions

Q1. Why is it not possible for the probability of an occurrence to be a negative number?

Since the number of trials in which the occurrence is possible cannot be negative and the total number of trials is always positive.

All probabilities are between 0 and 1. 

0 = probability that something will not happen.

1 = probability that something absolutely will happen.

Q2. Is it possible for a probability to be greater than one and less than zero?

Probabilities are calculated across intervals rather than single points. This indicates that the probability function's height can be larger than one. The statement that the integral must equal one is identical to the property that the total of all probabilities must equal one for discrete distributions.


Q3. What is the probability of selecting a vowel from the alphabet?

If just A, E, I, O, and U are included as vowels, the chance of picking one from the English alphabet is 5/26 (19.2%).

Key takeaways

To recap the session, we addressed probability in both real life and mathematics. Predicting something or making a decision based on probability is significant since it shows the proper outcome. The discussion isn't finished yet; there's still a lot to learn about probability. Continue to practice the mentioned questions and attempt some additional diverse examples to have a better understanding.

Recommended Readings:

Don't stop there, Ninja; have a look at the free guided path, pass the aptitude exam, and land a job at your ideal company.

Happy learning, Ninja.

Previous article
Simple and Compound Interest
Next article
Guided path
Aptitude preparation
9 chapters
190+ Problems
Earn badges and level up
Live masterclass