# Counting-Probability - permutations

## HOW IT IS RELATED TO MATH ?? ## Math and Probability

• To decide "how likely" an event is, we need to count the number of times an event could occur and compare it to the total number of possible events.
• Such a comparison is called the probability of the particular event occurring.

The Mathmetical theory of counting is known as combinatorial analysis.

## FActorial nOtaTion USe

• A simple way of writing the product of all the positive whole numbers up to a given number.

## What is N?!!

• n factorial is the product of all the integers from 1 to n.
• n factorial is represented with an exclamation mark : n!
• n!=n(n-1)(n-2)...(3)(2)(1)
• EXAMPLE:
5! = 5 × 4 × 3 × 2 × 1 = 120

• NOTE:
we cannot simply cancel a fraction containing factorials.

## counting: Principles and rules ## counting techniques

• Handle large masses of statistical data
• Understanding probability.

## Number of Outcomes of an Event

• event E defined as E = "season of the year"
• We write the "number of outcomes of event E" as n(E).

So in the example,

n(E)=4,

since there are 4 seasons in a year.30 days

## counting rule

• Let E1 and E2 be mutually exclusive events:

The number of times event E will occur can be given by the expression:

n(E) = n(E1) + n(E2)

where

n(E) = Number of outcomes of event E

n(E1) = Number of outcomes of event E1

n(E2) = Number of outcomes of event E2

## example

• Consider a set of numbers
S={−4,−2,1,3,5,6,7,8,9,10}

• Let the events E1, E2 and E3 be defined as:

E = choosing a negative or an odd number from S;

E1= choosing a negative number from S;

E2 = choosing an odd number from S.

• Find n(E).

• E1 and E2 are mutually exclusive events
• n(E) = n(E1) + n(E2)

= 2 + 5

= 7

## multiplication rule

• Two events E1 and E2 are to be performed and the events E1 and E2 are independent events. (one does not affect the other's outcome)
• Generalization:
Suppose that event E1 can result in any one of n(E1) possible outcomes; and for each outcome of the eventE1, there are n(E2) possible outcomes of event E2.

Together there will be n(E1) × n(E2) possible outcomes of the two events.

That is, if event E is the event that both E1 and E2 must occur, then

• n(E) = n(E1) × n(E2)

## example 1

• Say the only clean clothes you've got are
2 t-shirts and 4 pairs of jeans. How many different combinations can you choose?

• We have :

2 t-shirts and with each t-shirt we could pick 4 pairs of jeans. Altogether there are

2×4=8 possible combinations.

• We could write

E1 = "choose t-shirt" and

E2 = "choose jeans"

n(E1) = 2 (since we had 2 t-shirts)

n(E2) = 4 (since there were 4 pairs of jeans)

• So total number of possible outcomes is given by:

n(E) = n(E1) × n(E2) = 2 × 4 = 8 ## example 2

• What is the total number of possible outcomes when a pair of coins is tossed?

• The events are described as:

E1 = toss first coin (2 outcomes, so n(E1) = 2.)

E2 = toss second coin (2 outcomes, so n(E2) = 2.)

• They are independent, since neither toss affects the outcome of the other toss.
• So n(E) = n(E1) × n(E2) = 2 × 2 = 4 ## Theorem 1 - Arranging n Objects

In general, n distinct objects can be arranged in n! ways.

## Theorem 2 - Number of Permutations

The number of permutations of n distinct objects taken r at a time, denoted by Pnr, where repetitions are not allowed, is given by

Pnr=n(n−1)(n−2)...(nr+1)=n!(nr)!

## Theorem 3 - Permutations of Different Kinds of Objects

The number of different permutations of n objects of which n1 are of one kind, n2 are of a second kind, ... nk are of a k-th kind is

n!n1!×n2!×n3×...×nk!

## Theorem 4 - Arranging Objects in a Circle

There are (n−1)! ways to arrange n distinct objects in a circle
Probability Pizza Problem
probability 0.0000001 %