Skip to main content

Introduction to Probability


Introduction to Probability


Probabilities are associated with experiments where the outcome is not known in advance or cannot be predicted. For example, if you toss a coin, will you obtain a head or tail? If you roll a die will obtain 1, 2, 3, 4, 5 or 6? Probability measures and quantifies "how likely" an event, related to these types of experiment, will happen. The value of a probability is a number between 0 and 1 inclusive. An event that cannot occur has a probability (of happening) equal to 0 and the probability of an event that is certain to occur has a probability equal to 1.(see probability scale below).




In order to quantify probabilities, we need to define the sample space of an experiment and the events that may be associated with that experiment.

Sample Space and Events


The sample space is the set of all possible outcomes in an experiment.

Example 1: If a die is rolled, the sample space S is given by

S = {1,2,3,4,5,6}

Example 2: If two coins are tossed, the sample space S is given by

S = {HH,HT,TH,TT} , where H = head and T = tail.

Example 3: If two dice are rolled, the sample space S is given by

S = { (1,1),(1,2),(1,3),(1,4),(1,5),(1,6)
         (2,1),(2,2),(2,3),(2,4),(2,5),(2,6)
         (3,1),(3,2),(3,3),(3,4),(3,5),(3,6)
         (4,1),(4,2),(4,3),(4,4),(4,5),(4,6)
         (5,1),(5,2),(5,3),(5,4),(5,5),(5,6)
         (6,1),(6,2),(6,3),(6,4),(6,5),(6,6) }
We define an event as some specific outcome of an experiment. An event is a subset of the sample space.

Example 4: A die is rolled (see example 1 above for the sample space). Let us define event E as the set of possible outcomes where the number on the face of the die is even. Event E is given by

E = {2,4,6}

Example 5: Two coins are tossed (see example 2 above for the sample space). Let us define event E as the set of possible outcomes where the number of head obtained is equal to two. Event E is given by

E = {(HT),(TH)}

Example 6: Two dice are rolled (see example 3 above for the sample space). Let us define event E as the set of possible outcomes where the sum of the numbers on the faces of the two dice is equal to four. Event E is given by

E = {(1,3),(2,2),(3,1)}

How to Calculate Probabilities?

1 - Classical Probability Formula: It is based on the fact that all outcomes are equally likely.

Total number of outcomes in E
P(E)= ________________________________________________
Total number of outcomes in the sample space


Example 7: A die is rolled, find the probability of getting a 3.

The event of interest is "getting a 3". so E = {3}.

The sample space S is given by S = {1,2,3,4,5,6}.

The number of possible outcomes in E is 1 and the number of possible outcomes in S is 6. Hence the probability of getting a 3 is P("3") = 1 / 6.

Example 8: A die is rolled, find the probability of getting an even number.

The event of interest is "getting an even number". so E = {2,4,6}, the even numbers on a die.

The sample space S is given by S = {1,2,3,4,5,6}.

The number of possible outcomes in E is 3 and the number of possible outcomes in S is 6. Hence the probability of getting a 3 is P("3") = 3 / 6 = 1 / 2.
2 - Empirical Probability Formula: It uses real data on present situations to determine how likely outcomes will occur in the future. Let us clarify this using an example

30 people were asked about the colors they like and here are the results:

Colorfrequency
red10
blue15
green5


If a person is selected at random from the above group of 30, what is the probability that this person likes the red color?

Let event E be "likes the red color". Hence

Frequency for red color
P(E)= ________________________________________________
Total frequencies in the above table


= 10 / 30 = 1 / 3


Example 8: The table below shows students distribution per grade in a school.

Gradefrequency
150
230
340
442
538
650


If a student is selected at random from this school, what is the probability that this student is in grade 3?

Let event E be "student from grade 3". Hence

Frequency for grade 3
P(E)=_______________________________________
Total frequencies


= 40 / 250 = 0.16 




Mutually Exclusive Events - Examples With Solutions

Tutorial on finding out whether two given events are mutually exclusive.


A quick review of sample space of an experiment and the events related to a sample space may be necessary.

Two events are mutually exclusive if they cannot occur at the same time.

Using Venn diagram, two events that are mutually exclusive may be represented as follows:


The two events are such that

E1 ∩ E2 = Φ


The two sets E1 and E2 have no elements in common and their intersection is an empty set since they cannot occur at the same time.

Using Venn diagram, two events that are not mutually exclusive may be represented as follows:


E1 ∩ E2 = {c} , the intersection of the two events E1 and E2 is not an empty set

Example 1:

A die is rolled. Let us define event E1 as the set of possible outcomes where the number on the face of the die is even and event E2 as the set of possible outcomes where the number on the face of the die is odd. Are event1 E1 and E2 mutually exclusive?
Solution to Example 1:

  • We first list the elements of E1 and E2.

    E1 = {2,4,6}

    E2 = {1,3,5}
  • E1 and E2 have no elements in common and therefore are mutually exclusive.
  • Another way to answer the above question is to note is that if you roll a die, it shows a number that is either even or odd but no number will be even and odd at the same time. Hence E1 and E2 cannot occur at the same time and are therfore mutually exclusive.

Example 2:

A die is rolled. Event E1 is the set of possible outcomes where the number on the face of the die is even and event E2 as the set of possible outcomes where the number on the face of the die is greater than 3. Are event E1 and E2 mutually exclusive?
Solution to Example 2:

  • The subsets E1 and E2 are given by.

    E1 = {2,4,6}

    E2 = {4,5,6}
  • Subsets E1 and E2 have 2 elements in common. If the die shows 4 or 6, both events E1 and E2 will have occured at the same time and therefore E1 and E2 are not mutually exclusive.

Example 3:

A card is drawn from a deck of cards. Events E1, E2, E3, E4 and E5 are defined as follows:
E1: Getting an 8
E2: Getting a king
E3: Getting a face card
E4: Getting an ace
E5: Getting a heart

a) Are events E1 and E2 mutually exclusive?

b) Are events E2 and E3 mutually exclusive?

c) Are events E3 and E4 mutually exclusive?

d) Are events E4 and E5 mutually exclusive?

e) Are events E5 and E1 mutually exclusive?
Solution to Example 3:

  • The sample space of the experiment "card is drawn from a deck of cards" is shown below.



  • a) E1 and E2 are mutually exclusive because there are no cards with an 8 and a king together.
  • b) E2 and E3 are not mutually exclusive because a king is a face card.
  • c) E3 and E4 are mutually exclusive because an ace is not a face card.
  • d) E4 and E5 are not mutually exclusive because there is one card that has an ace and a heart.
  • d) E5 and E1 are not mutually exclusive because there is one card that is an 8 of heart.

Example 4: Two dice are rolled. We define events E1, E2, E3 and E4 as follows
E1: Getting a sum equal to 10
E2: Getting a double
E3: Getting a sum less than 4
E4: Getting a sum less to 7

a) Are events E1 and E2 mutually exclusive?

b) Are events E2 and E3 mutually exclusive?

c) Are events E3 and E4 mutually exclusive?

d) Are events E4 and E1 mutually exclusive?
Solution to Example 4:

  • The sample space of the experiment "2 dice" is shown below.


  • a) E1 and E2 are not mutually exclusive because outcome (5,5) is a double and also gives a sum of 10. The two events may occur at the same time.
  • b) E2 and E3 are not mutually exclusive because outcome (1,1) is a double and gives a sum of 2 and is less than 4. The two events E2 and E3 may occur at the same time.
  • c) E3 and E4 are not mutually exclusive a sum can be less than 7 and less than 4 a the same time. Example outcome (1,2).
  • d) E4 and E1 are mutually exclusive because a sum less than 7 cannot be equal to 10 at the same time. The two events cannot occur at the same time. 


Comments

Popular posts from this blog

FAQ's Salesforce Lightning Platform Query Optimizer

This article comprises the FAQs related to salesforce internal platform Query Optimizer.and provides valuable information that will help understand how to improve the performance of SOQL queries. For more information, you may also check this Dreamforce Session . 1. Query Optimizer Q: Does Salesforce have its own SQL optimization logic instead of Oracle's built-in? A: Force.com is a multi-tenant platform. To consider multitenant statistics, the platform has its own SOQL query optimizer that determines optimal SQL to satisfy a specific tenant's request. Q: How frequently generated are the statistics used by the query optimizer? A: Statistics are gathered weekly. Where statistics are not calculated, the optimizer also performs dynamic pre-queries, whose results are cached for 1 hour Q: Is there any way to flush the cache when doing your performance testing so your results are not cached biased? A: Unfortunately not. Queries with selective filters will perform mor...

Javascript global variables

Question :  is there any difference between declaring a variable var a = 0 ; //1 and this way a = 0 ; //2 or window . a = 0 ; //3 in global scope? Soloution:      Yes, there are two differences, though in practical terms they're not usually big ones.  three statements explained var a = 0 ; ...creates a variable on the  variable object  for the global execution context, which is the global object, which on browsers is aliased as  window  (and is a DOM window object rather than just a generic object as it would be on non-browser implementations). The symbol  window  is, itself, actually a property of the global (window) object that it uses to point to itself. The upshot of all that is: It creates a property on  window  that you cannot delete. It's also defined before the first line of code runs (see "When  var  happens" below). Note that on IE8 and earlier, the property created on  ...

NoSQL Database (20 Best Free Open Source NoSQL Databses

  NoSQL databases are becoming popular day by day. I have come up with the list of best, free and open source NoSQL databases. MongoDB tops the list of Open Source NoSQL databases. This list of free and open source databases comprises of   MongoDB, Cassandra, CouchDB, Hypertable, Redis, Riak, Neo4j, HBASE, Couchbase, MemcacheDB, RevenDB and Voldemort.   These free and open source NoSQL databases are really highly scale-able, flexible and good for big data storage and processing. These open source NoSQL databases are far ahead in terms of performance as compared to traditional relational databases. However, these may not be always the best choice for you. Most of common applications can still be developed using traditional relational databases. NoSQL databases are still not the best option for a mission critical transaction needs. I have listed down a small description of all these best free and oper source NoSQL databases. Lets have a look.. 1. MongoDB MongoDB ...