**Law of Total Probability:**

If B1,B2,B3,⋯ is a partition of the sample space S, then for any event A we have,

So, let’s get started …

It is a way of finding a probability when we know certain other different probabilities. Basically calculates the probability of an event, based on the prior knowledge of conditions that might be related to the event.

where A and B are events and P(B) ≠ 0.

**P(A|B)**is a conditional probability, the likelihood of an event A occurring given that B is true.is a conditional probability, the likelihood of an event B occurring given that A is true.**P(B|A)****P(A)**and**P(B)**are the probabilities of A and B respectively.

**Example 1** : How search engines provides us the result ?

If we search for “Mobile Phones Under 10K”. Does the search engine know the mobiles under 10K ? No, but it knows from a lot of other searches what people are probably looking for and it calculates this on the basis of Bayes Theorem and shows us the relevant content.

**Example 2 :** Thanks to mathisfun for this example.

Let us say P(Fire) means how often there is fire, and P(smoke) means how often we see smoke, then:

P(Fire | Smoke) means how often there is fire when we can see smoke.

P(Smoke|Fire) means how often we can see smoke when there is fire.

So the formula kind of tells us “forwards” P(Fire|Smoke) when we know “backwards” P(Smoke|Fire).

Example:

- dangerous fires are rare (1%)
- but smoke is fairly common (10%) due to barbecues,
- and 90% of dangerous fires make smoke

We can then discover the **probability of dangerous Fire when there is Smoke**:

P(Fire|Smoke) = (P(Fire)P(Smoke|Fire))/P(Smoke) = (1% * 90%)/10% = 9%

So it is still worth checking out any smoke to be sure.

**Example 3: Picnic Day**

You are planning a picnic today, but the morning is cloudy

- Oh no! 50% of all rainy days start off cloudy!
- But cloudy mornings are common (about 40% of days start cloudy)
- And this is usually a dry month (only 3 of 30 days tend to be rainy, or 10%)

**What is the chance of rain during the day?**

We will use Rain to mean rain during the day, and Cloud to mean cloudy morning.

The chance of Rain given Cloud is written P(Rain|Cloud)

So let’s put that in the formula:

P(Rain|Cloud) =( *P(Rain) P(Cloud|Rain)) /*** **P(Cloud)

- P(Rain) is Probability of Rain = 10%
- P(Cloud|Rain) is Probability of Cloud, given that Rain happens = 50%
- P(Cloud) is Probability of Cloud = 40%

P(Rain|Cloud) =( *0.1 x 0.5***)****/** 0.4 = .125

Or a 12.5% chance of rain. Not too bad, let’s have a picnic!

Till then, Stay Connected

Connect with me on :

Linkedin: https://www.linkedin.com/in/patidarparas13/

Twitter: https://twitter.com/patidarparas13

MLAIT On Twitter: https://twitter.com/mlait1908

MLAIT On Linkedin: https://www.linkedin.com/company/mlait1908

MLAIT On Telegram: https://t.me/mlait

MLAIT On WhatsApp: https://chat.whatsapp.com/IDTD8ONgeZw2InepJEKrM7

]]>**Multiplicative Law **

The probability of intersection of two events A and B is

P(A∩B) = P(B)P(A|B) = P(A)P(B|A),if values swapped

If these events are independent, then P(A∩B) = P(A)P(B)

**Additive Law**

Probability of a union of events, P(A U B) = P(A) + P(B) – P(A∩B)

If A and B are mutually exclusive,P(A∩B) = 0 and

P(A U B) = P(A) + P(B)

So, let’s get started …

Let’s start with an example, if you have bought three pens, prices are P1 = Rs. 10,P2 = Rs. 20, P3 = Rs. 15, from the stationary and you, want to calculate the total money spent on the pens then what you will do,

Total = P1+P2+P3 = 10+20+15 = Rs. 45.

This is the idea behind the law of total probability where each cost of the pen is replaced by the probability of an event A. We basically do the partitions in the sample space S, to calculate the single probabilities and add then at the end.

We can state a more general version of this formula which applies to a general partition of the sample space S.

Law of Total Probability:

If B1,B2,B3,⋯ is a partition of the sample space S, then for any event A we have,

I have three bags that each contain 100 marbles:

- Bag 1 has 75 red and 25 blue marbles;
- Bag 2 has 60 red and 40 blue marbles;
- Bag 3 has 45 red and 55 blue marbles.

I choose one of the bags at random and then pick a marble from the chosen bag, also at random. What is the probability that the chosen marble is red?

**Solution**

Let R be the event that the chosen marble is red. Let Bi be the event that I choose Bag i. We already know that

P(R|B1) = 0.75, P(R|B2) = 0.60, P(R|B3) = 0.45

We choose our partition as B1, B2, B3. Note that this is a valid partition because, firstly, the Bi’s are disjoint (only one of them can happen), and secondly, because their union is the entire sample space as one the bags will be chosen for sure, i.e., P(B1∪B2∪B3)=1. Using the law of total probability, we can write,

P(R) = P(R|B1)P(B1) + P(R|B2)P(B2) + P(R|B3)P(B3)

P(R) = 0.75*1/3+0.60*1/3+0.45*1/3

P(R) = 0.60

Till then, Stay Connected

Connect with me on :

Linkedin: https://www.linkedin.com/in/patidarparas13/

Twitter: https://twitter.com/patidarparas13

MLAIT On Twitter: https://twitter.com/mlait1908

MLAIT On Linkedin: https://www.linkedin.com/company/mlait1908

MLAIT On Telegram: https://t.me/mlait

MLAIT On WhatsApp: https://chat.whatsapp.com/IDTD8ONgeZw2InepJEKrM7

]]>If any of the following condition holds, then the two events A and B are independent,

- P(A|B) = P(A)
- P(B|A) = P(B)
- P(A∩B) = P(A)P(B)

If none of these condition holds, the events are **dependent** and if any one of the condition holds from this the events are **independent**.

So, let’s get started …

As we learned before the formula of conditional probability,

P(A|B) = P(A∩B) / P(B)

The probability of intersection of two events A and B is

P(A∩B) = P(B)P(A|B) = P(A)P(B|A),if values swapped

If these events are independent, then P(A∩B) = P(A)P(B)

**Two Dependent Events:**

- A – Odd Number
- B – number < 4

P(A) = 1/2 ; P(B) = 1/2

P(A|B) = 2/3; P(B|A) = 2/3

Explanation: Only two odd numbers out of nmber < 4 means 3 values {1,2,3}. so 2/3.

P(A∩B) = P(A)P(B|A) = 1/2 * 2/3 = 1/3

Probability of a union of events, P(A U B) = P(A) + P(B) – P(A∩B)

If A and B are mutually exclusive,P(A∩B) = 0 and

P(A U B) = P(A) + P(B)

We can extend this formula to calculate the probabilities of more than 2 events.

Till then, Stay Connected

Connect with me on :

Linkedin: https://www.linkedin.com/in/patidarparas13/

Twitter: https://twitter.com/patidarparas13

MLAIT On Twitter: https://twitter.com/mlait1908

MLAIT On Linkedin: https://www.linkedin.com/company/mlait1908

MLAIT On Telegram: https://t.me/mlait

MLAIT On WhatsApp: https://chat.whatsapp.com/IDTD8ONgeZw2InepJEKrM7

]]>**Conditional probability is defined as the likelihood of an event or outcome occurring, based on the occurrence of a previous event or outcome.**

**Unconditional Probability is defined as the likelihood that an event will take place independent of whether any other events take place or any other conditions are present.**

So, let’s get started …

**Two events A and B are independent if events do not influence one another**.

If any of the following condition holds, then the two events A and B are independent,

- P(A|B) = P(A)
- P(B|A) = P(B)
- P(A∩B) = P(A)P(B)

If none of these condition holds, the events are **dependent** and if any one of the condition holds from this the events are **independent**.

**Consider these events generated by a single die roll:**

- A: odd number rolled
- B: even number rolled
- C = {1,2}

**Are A and B independent ?**

- First calculate, P(A)=1/2, P(B) = 1/2 because in a die roll there are 50% chances of odd and 50% chances of even numbers. Even ={2,4,6},Odd = {1,3,5}. Total = 6 possibilities. P(Even or A) = 3/6 = 1/2 and P(Odd or B) = 3/6 = 1/2.
- Since, A∩B = ∅ and P(A/B)=0 because at the same time a die roll cannot be an even and an odd number.
- P(A|B)
*≠*P(A), so events are**dependent**

**Are A and C independent ?**

- P(A|C) = 1/2, P(A) =1/2, P(C)=2/6 = 1/3 , P(A∩C) = P(A)*P(C) = 1/6
- P(A|C) = P(A∩C)/P(C) = (1/6)/(1/3) = 1/2
- P(A) = 1/2
- P(A|C) = 1/2 = P(A)
- Events are
**independent**

Till then, Stay Connected

Connect with me on :

Linkedin: https://www.linkedin.com/in/patidarparas13/

Twitter: https://twitter.com/patidarparas13

MLAIT On Twitter: https://twitter.com/mlait1908

MLAIT On Linkedin: https://www.linkedin.com/company/mlait1908

MLAIT On Telegram: https://t.me/mlait

MLAIT On WhatsApp: https://chat.whatsapp.com/IDTD8ONgeZw2InepJEKrM7

]]>**Probability of Union Of Events – Statistics Part 15**

So, let’s get started …

**Unconditional Probalility **: Probability that it will rain today giving no additional information.

**Conditional Probability :** Probability that it will rain today given it’s been raining an enitre week.

Here you can see that the unconditional probaility does not depends on other obervations, but the conditional probability depends on the other observations. There are some previous factors which need to take care while working on conditional probability because it depends on that factors.

Conditional probability is defined as the likelihood of an event or outcome occurring, based on the occurrence of a previous event or outcome.

assuming P(B) > 0 .The formula states that the probability of “A given B” and written as P(A|B), where the probability of A depends on that of B happening.

P(A|B) is derived by multiplying the probability of both A and B occurring and dividing that product by the probability of A by itself.

**Example**,

In a group of 100 sports car buyers, 40 bought alarm systems, 30 purchased bucket seats, and 20 purchased an alarm system and bucket seats. If a car buyer chosen at random bought an alarm system, what is the probability they also bought bucket seats?

Step 1: Figure out P(A). It’s given in the question as 40%, or 0.4.

Step 2: Figure out P(A∩B). This is the intersection of A and B: both happening together. It’s given in the question 20 out of 100 buyers, or 0.2.

Step 3: Insert your answers into the formula:

P(B|A) = P(A∩B) / P(A) = 0.2 / 0.4 = 0.5.

The probability that a buyer bought bucket seats, given that they purchased an alarm system, is 50%.

Unconditional Probability is defined as the likelihood that an event will take place independent of whether any other events take place or any other conditions are present.

The unconditional probability of an event can be determined by adding up the outcomes of the event and dividing by the total number of possible outcomes.

For example, if a die lands on the number five 15 times out of 60, the unconditional probability of landing on the number five is 25% (15 outcomes /60 total lots = 0.25).

There is one example from one of the blog ,

As a hypothetical example from finance, let’s examine a group of stocks and their returns. A stock can either be a winner, which earns a positive return, or a loser, which has a negative return. Say that out of five stocks, stocks A and B are winners, while stocks C, D, and E are losers. What, then, is the unconditional probability of choosing a winning stock? Since two outcomes out of a possible five will produce a winner, the unconditional probability is 2 successes divided by 5 total outcomes (2 / 5 = 0.4), or 40%.

Till then, Stay Connected

Connect with me on :

Linkedin: https://www.linkedin.com/in/patidarparas13/

Twitter: https://twitter.com/patidarparas13

MLAIT On Twitter: https://twitter.com/mlait1908

MLAIT On Linkedin: https://www.linkedin.com/company/mlait1908

MLAIT On Telegram: https://t.me/mlait

MLAIT On WhatsApp: https://chat.whatsapp.com/IDTD8ONgeZw2InepJEKrM7

]]>A multinomial coefficient is not just of separating two groups of elements but actually separating several groups,more than 2.

So, let’s get started …

We also know that for a set of disjoint events A(i),

P(U A(i)) = Submission

For every two (not necessarily disjoint(Which does not overlap)) events A and B, P(A ⋃ B ) = P(A) + P(B) – P(A ⋂ B)

This can be extended to 3 or more events, Ex: P(A⋃B⋃C) = P(A) +P(B) + P(C) – {P(A ⋂ B) + P(B ⋂ C) + P(A ⋂ C)} + P(P(A ⋂ B ⋂ C))

Example : Consider a cohort of 200 students. 50 students take programming(P),100 students take Electronics(E),150 students take maths (M). 30 Students take programming+electronics,45 students take electronics + maths,25 students take electronics+programming. 15 students take all 3 classes; some students take no classes from the list. What is the probability that a student takes at least one class ?

Solution : P(P) = 50/200, P(E) = 100/200, P(M) = 75/200

P(P ⋂ E) = 30/200, P(E ⋂ M) = 45/200, P(E ⋂ P) = 25/200, P(P ⋂ E ⋂ M) = 15/200

P(P ⋃ E ⋃ M) = 50/200 + 100/200 + 75/200 – {30/200+45/200+25/200}+15/200 = 140/200 = 0.7

Till then, Stay Connected

Connect with me on :

Linkedin: https://www.linkedin.com/in/patidarparas13/

Twitter: https://twitter.com/patidarparas13

MLAIT On Twitter: https://twitter.com/mlait1908

MLAIT On Linkedin: https://www.linkedin.com/company/mlait1908

MLAIT On Telegram: https://t.me/mlait

MLAIT On WhatsApp: https://chat.whatsapp.com/IDTD8ONgeZw2InepJEKrM7

]]>A binomial coefficient equals the number of combinations of k items that can be selected from a set of n items.

So, let’s get started …

It’s not just of separating two group of elements but actually separating several groups ,more than 2

Example: 10 students need to from 3 groups consisting of 4,3 and 3 members repectively.How many ways can students be assigned to these groups ?

Solution = First Group : Choose 4 students out of 10, 10**C**4 arrangements.

We are left with 6 students: number of ways to split them is 6**C**3

(10**C**4)(6**C**3) = (10!/4!6!) * (6!/3!3!) = 10!/4!3!3! = 4200

**Multinomial Coefficient written as **

**Just like the binomial coefficients,**

Example 1: Picking 4,3,3 students out of 10 : (10** C** 4,3,3) = 10!/4!3!3! = 4200

Example 2: Number of ways to arrange 3 a’s, 4 b’s and 5 c’s is : (12 **C** 3,4,5) = 12!/3!4!5! = 27,720

Till then, Stay Connected

Connect with me on :

Linkedin: https://www.linkedin.com/in/patidarparas13/

Twitter: https://twitter.com/patidarparas13

MLAIT On Twitter: https://twitter.com/mlait1908

MLAIT On Linkedin: https://www.linkedin.com/company/mlait1908

MLAIT On Telegram: https://t.me/mlait

MLAIT On WhatsApp: https://chat.whatsapp.com/IDTD8ONgeZw2InepJEKrM7

]]>Combinatorics is a branch of mathematics concerning the study of finite or countable discrete structures.

C(n,k) = P(n,k)/k! = n!/k!(n-k)!

So, let’s get started …

A binomial coefficient equals the number of combinations of k items that can be selected from a set of n items.

If your observations are independent, each represents one of two outcomes (think: success and failure), your number of trials is fixed and the probability of success is the same for each trial, then the probability you have exactly r successes during your n independent trials will be

This formula represents the binomial distribution. Here p is the probability of success in each instance, and q=1-p, the probability of failure.

The binomial coefficient n choose r tells you how many success-failure sequences, of the set of all possible sequences, will result in exactly r successes. The probability of each of those individual sequences happening is just p^{r}q^{n-r}.

**Binomial Coefficient Examples**

Example : A class has 15 girls and 30 boys. Pick 10 children at random. What’s the probability you’ll pick exactly 3 girls ?

Number of ways of picking 3 girls from 15 girls is : 15**C**3

Number of ways of picking 7 boys from 30 is : 30**C**7

Overall number of combinations is : 45**C**10

Therefore, P(3 girls) = 15**C**3 * 30**C**7/45**C**10 = 0.29

Till then, Stay Connected

Connect with me on :

Linkedin: https://www.linkedin.com/in/patidarparas13/

Twitter: https://twitter.com/patidarparas13

MLAIT On Twitter: https://twitter.com/mlait1908

MLAIT On Linkedin: https://www.linkedin.com/company/mlait1908

MLAIT On Telegram: https://t.me/mlait

MLAIT On WhatsApp: https://chat.whatsapp.com/IDTD8ONgeZw2InepJEKrM7

]]>Given a set of elements, all distinct arrangements of these elements are called the permutation of a set.

The number of ways you can arrange N elements out of N possibilities is…

P(n,n) = N X (N-1) X (N-2) X …. X 2 X 1 = N! permutations

So, let’s get started …

Combinatorics is a branch of mathematics concerning the study of finite or countable discrete structures.

**Combinatorial Methods**

Given a bag of balls B = {R,G,B,W,O}

If we pull out 2 balls after replacement, the number of arrangements is : P(5,2) = 5!/3! = 20

What if we don’t care about the order, i.e,. we consider {R,B} and {B,R} to be the same pick ?

How can we calculate the number of unique picks now ?

**Problem: **Find the number of subsets of a set(remember, the order doesn’t matter)

Given a bag of balls B = {R,G,B,W,O}

The total number of picks (including duplicate sets) is P(5,2) – And each of the picks has 2! possible arrangements.

So we reduce the total number of picks by the number of arrangements in each pick:

C(n,k) = P(n,k)/k! = n!/k!(n-k)!

In our case, C(5,2) = 5!/2!(5-2)!

Here they are: {RG,RB,RW,RO,GB,GW,GO,BW,BO,WO}

Till then, Stay Connected

Connect with me on :

Linkedin: https://www.linkedin.com/in/patidarparas13/

Twitter: https://twitter.com/patidarparas13

MLAIT On Twitter: https://twitter.com/mlait1908

MLAIT On Linkedin: https://www.linkedin.com/company/mlait1908

MLAIT On Telegram: https://t.me/mlait

MLAIT On WhatsApp: https://chat.whatsapp.com/IDTD8ONgeZw2InepJEKrM7

]]>**Counting Sample Points: It means how many sample points are there in the sample space.**

So, let’s get started …

Given a set of elements, all distinct arrangements of these elements are called the permutation of a set.

The number of ways you can arrange N elements out of N possibilities is…

P(n,n) = N X (N-1) X (N-2) X …. X 2 X 1 = N! permutations

N! = “N factorial” = a product of all numbers from N down to 1

- Assumes N is a non-negative integer
- By definition,0! = 1

**General Formula for Permutations** : n!/(n-k)!

Suppose there are n= 5 balls (RGBWO) and you draw k = 3 without replacement. How many possible arrangements are there ?

Solution : 5 possibilities on first draw, 4 on the second, 3 on the third, so 5 X 4 X 3 = 60.

But how to express it in terms of n and k ? : 5!/(5-3)! = 5!/2! = 60

Thus, the number of permutations of k elements out of n is P(n,k) = n!/(n-k)!

Example : Number of unique 5-letter words that can be arranged from letters {a,b,c,d,e} : 5**5 = 3125 (With replacement)

If each letter appears exactly once : 5! = 120 (Without replacement )

3-letter words, each letters appears once : P(5,3) = 5!/(5-3)! = 60

Till then, Stay Connected

Connect with me on :

Linkedin: https://www.linkedin.com/in/patidarparas13/

Twitter: https://twitter.com/patidarparas13

MLAIT On Twitter: https://twitter.com/mlait1908

MLAIT On Linkedin: https://www.linkedin.com/company/mlait1908

MLAIT On Telegram: https://t.me/mlait

MLAIT On WhatsApp: https://chat.whatsapp.com/IDTD8ONgeZw2InepJEKrM7

]]>