0% found this document useful (0 votes)
13 views144 pages

Class Lectures (Scanned)

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views144 pages

Class Lectures (Scanned)

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 144

Page 1

Page 2

Then: 1 >> A
2 >> C
1 >> C ...... Complete. So, for 3 disks, 2^3 - 1 = 7 Moves required
Page 3
Page 4

S
this is called BASIS

That means : We assume Tn-1 = 2^(n-1) - 1


Page 5

( hypothesis)

from PDF => MUST See also:


Double Tower of Hanoi (DTOH) and
Triple Tower of Hanoi (TTOH) (with their Inductive Proof Too!)
Page 6
Page 7
Page 8

S
Page 9
Page 10

= 1 + n(n+1)/2
Page 11
Page 12
Page 13
Page 14
Page 15
Page 16
Page 17

of m m
k
that is, assume J(2 + x) = 2x+1 is true
for k = 0, 1, ..., (upto) m-1
m-1
So, J(2 + x) = 2x+1
m-1
J (2 + l /2) = 2(l/2) + 1 = l + 1
Page 18
Page 19
Page 20

m
J(n) = J (2 + l) = 2l+1

Question: Derive the Binary Property of the Josephus Problem.

Since n = 2^m + l; So: l = n - 2^m => The MSB of the binary


number (n-2^m) is 0, the rest of the bits are same as the bits of n. See example=>
Note: the last m bits of n is same as
the bits of l. Only the MSB different.
example:
if n=15(1111) then l=7 (0111)
if n=11(1011) then l=3 (0011)
*** So, n ke just 1-bit left rotate korlei solution J(n) paowa jabe
see examples Page 21

Q: Write and Solve the Generalized Josphus Recurrence by using Repertoire method.

Josephus Problem Recurrence:


J(1)=1
J(2n) = 2J(n) - 1
J(2n+1) = 2J(n) +1
So: alpha=1, beta= -1, gamma=1

gamma
2 f(1) + gamma

*This whole lengthy method is called


*** REPERTOIRE method***
*This whole lengthy method is called
*** REPERTOIRE method*** Page 22

A(11) = A(2*5+1)
= 2*A(5) = 2 [ A(2*2+1) ]
= 2 [ 2 [A(2) ] ] = 2 [ 2 [ 2 [ A(1) ] ] ] = 2^3 as before

m
n=2 +l
Page 23
*This whole lengthy method is called
*** REPERTOIRE method***

We already know
A(n) = 2^m

But, we know, A(n) = 2^m


*This whole lengthy method is called Page 24
*** REPERTOIRE method***

m
where n = 2 + l

See the Josephus


Problem Recurrence:
J(1)=1
J(2n) = 2J(n) - 1
J(2n+1) = 2J(n) +1
So: Find that in Josephus
problem,
*Q: Find a closed form expression for f(n) alpha=1,
from the following recurrence relations by
beta= -1, gamma=1
using Repertoire method.
f(1) = 2
f(2n) = 2f(n) + 2
f(2n+1) = 2f(n) + 3
Page 25
Question: Similar Recurrence deya thakte pare in exam/quiz. Repertoire method diye sheta
solve korte paro, But tate error hoite pare (jehetu long procedure) ... ... ... EASIER hoilo general ta solve kora, then
just general tar solution e alpha, beta, gamma er value boshiye deya ... as shown above ... tahole derivation korte
giye error howar chance thaklo na ...

Better to Understand from


Examples below ...

j always 0, 1, ... ... ... (d-1) hobe


Page 26

This is the Radix based property of the general Josephus recurrence ...

here, base = d

Question:
Find f(19) by
using the Radix based
property of the above recurrence.
Page 27

3
0 - 2
Page 28

3
0 - 2

Q: Find J(20) by Using the Radix Based Property of the


Generalized Josephus Recurrence.
Page 29
Page 30

This is OPEN form

CLOSED form is: n(n+1)(2n+1)/6 + n(n+1)/2; so find

How to Convert a SUM into a RECURRENCE?


In Previous Example: Page 31
alpha=0
beta=0
gamma=1

Repertoire
Method:
*Place This Box Here*

Rn=1
so, R1=1

Rn=1
so, R2=1
Page 32

Rn=n
so, R0=0

Rn=n
so, R1=1

Rn=n
so, R2=2
Page 33

So, R0 = 0, R1 = 1, R2 = 4
Page 34

Sn = (a) + (a+b) + (a+2b) + ... ... ... + (a+(n-1)b) + (a+nb)


Sn-1

Thus:
S0 = a
Sn = Sn-1 + a + bn

so: alpha = a
beta = a
gamma = b
Page 35

* Also, see Question 7 (Page 4) of


"Practise_Questions_02.docx"
Page 36

for

Sn = 0 + 1+ 2 + ... ... + (n-1) + n


Sn-1
S0 = 0
Page 37

a=1
b=2

Sn = 1 + 3 + 5 + ... ... + (2n-1) + (2n+1)


Sn-1
So: S0 = 1
Sn = Sn-1 + 1 + 2n

So: S0 = 0
Sn = Sn-1 + 2n
Thus: alpha =0
Beta = 0
Gama = 2

Sn = ... = n (n+1)
Page 38

There is a MISSING Part here, which you can find in


"Lec4-Sums.pdf" in the "PDF Lectures" folder. You must show those Steps to get marks
Page 39

Q: Find a Summation Factor for the following General Recurrence.

Small 's' = summation factor


Capital Sn = sn * an * Tn (the small sn is summation factor)
Page 40

or, s0a0T0
Page 41

The
Summation
Factor
of THIS
recurrence
is
THIS
Page 42
Page 43

partitioning
Page 44

At last we are now free from


the Summation term in Cn :)

a1 a2 ... ... an-1


b2 b3 ... ... bn
Page 45

*** To easily simplify the Above expression into the following


Harmonic Series Expression, See the file: "Sum (QS Harmonic).jpg" - which
is in the "PDF Lectures" folder
Page 46
Page 47

For each of these,


a=0, b=1 Solve the General a+bk as shown above
Then put the values of a and b
a=0, b=2 this reduces chance of calculation error in exam
Question: Write the following sum into its general form, then Convert
a=1, b=2 the general sum into a recurrence. Solve the general recurrence by
INDEX REPLACEMENT Technique to find the value of Sn for n = 100.
Sn = 3 + 10 + 17 + … … … + 703 OR 3 + 10 + … upto 101-th term
Solution: Write Sn as general form ( (a+bk)) with a=3, b=7 and n = 100
... thus, Prove & Use the above result of Index Replacement Technique
Page 48
Q: Derive the Formula for Perturbation Technique.
Page 49

+1

You have to find Sn= ak.


In the Pb formula ==> To get a0 ==> Put k = 0
To get ak+1 ==> Put k = k+1
To get an+1 ==> Put k = n+1
Page 50

k
Here, ak = k.2
put an+1, a0, ak+1
in Pb formula
Page 51
Page 52
Page 53

No Need!
Excluded
from syllabus!
Page 54
Page 55
Page 56

3 = 3
Page 57

3 =3
Rules: Page 58

(In all the following rules,


x = any number - integer
or real valued num
But, n = always an integer)
Page 59
Page 60

m-1
m
So, 2 <= n <= 2 - 1
Page 61

So, 6-bits are required to write 35 in binary

So, 6-bits are required to write 32 in binary


But, to write 31 in binary, 5 bits required

Since, m and m+1 are integer, we get: from rule 1 ==>


Page 62

As m^2 and (m+1)^2 both integers, we get from rules 6 & 7:


x < n <=iff=> x < n

example:
we know: 43 mod 10 = 3
how?
43 mod 10 = 43 - 10*4
= 43 - 10* 43/10
x mod y = x - y * x/y
Page 63
Page 64

55 mod 33
= 11 * (5 mod 3)
= 11 * 2
= 22
Page 65

example: ((((X mod 240) mod 60) mod 30) mod 10) mod 5
= X mod 5

Because, x mod 0 = x, by definition

now consider this whole thing as x


Page 66
Page 67
Page 68
Page 69
Page 70

division by 2 = Shift Right


multiply by 2 = Shift Left

(note: the 1st operand becomes the last operand)


Page 71
Page 72
Page 73
Page 74

*****
Excluded
Composite
From
Syllabus
*****
Or, you can Prove the next Proof : "Every integer
is either prime Or product of Primes" ==> which
Automatically Proves this proof
Page 75

Excluded
from
Syllabus

Page Missing Here !!! See the


"Missing Page" at the END (Last Page)
of this document
Page 76
Page 77

Equal or Greater
Page 78
Page 79
This Page: Excluded from Syllabus
Page 80
Page 81

6
Page 82

Read this part


from pdf lecture:
"Lec7-Number
Theory.pdf"
*** Besides, this
Lec-7 has some
additional topics,
like euclid number,
mersenne number - etc.
Page 83

Write and Prove the Fundamental Theorem of Arithmetic: Any Integer n>1 Can Be Represented as a Unique Product
of Prime Numbers Only. This unique product is called the Unique Prime Facorization of the integer n.
*** FIVE Questions in Lec7-Number Theory (involving Prime Exponent Representation, Euclid Prime, Mersenne
Prime, Prove or Disprove that ... ==> They are MUST SEE short Questions (last page of "Lec7-Number Theory.pdf" )
Page 84
Page 85

Write and Prove the Fundamental Theorem of Arithmetic: Any Integer n>1 Can Be Represented as a Unique Product
of Prime Numbers Only. This unique product is called the Unique Prime Facorization of the integer n.
*** FIVE Questions in Lec7-Number Theory (involving Prime Exponent Representation, Euclid Prime, Mersenne
Prime, Prove or Disprove that ... ==> They are MUST SEE short Questions (last page of "Lec7-Number Theory.pdf" )
Page 86

Prime
Page 87

maximum
Page 88
Page 89
Page 90

So, you should read it (*selectively*)from "Lec9-Number Theory.pdf" ... especially the 3 Proofs
Page 91
Page 92
Page 93
Page 94

n
Pr = n! / (n-r)!

n
Cr = n! / { r! * (n-r)! }
Page 95
Page 96
Page 97
Page 98

Note:
r can be negative
But,
if k < 0, rCk becomes 0

= apply formula (page 96) for other values of k


Page 99

Provide Intuitive Explanation ...

!
Page 100
Page 101

This is called "Abuse of Notation"


Page 102

Proof: RHS = ( r/k ) * (r-1) ! / [ (k-1)! *(r-k)! ]


= r! / [ k!* (r-k)!]
=rCk
=RHS
Page 103
Page 104

Provide Intuitive Explanation

from we get following (i)


Page 105
Page 106

n
where n=3
k=0

n=3

This is
Summation Formula
Page 107

m=2
n=4

m=2
Another n=4
form of So: n + 1 = 5
Summation m+1=3
formula
Thus: 5
3

*** Must Solve Maths using these formula from file: "Practise Question 03.docx" ****
Page 108

for m+k >= 0

identity

* write here the formula from previous page


Page 109

identity
Page 110
Page 111

Always, n >= m
Page 112
Page 113

Think: How to solve if k starts from


1 or 2 or 3, instead of 0
(may see the practise question doc file)

Find the sum of first n natural numbers (integers) by using the formula
from binomial coefficient
Page 114
Page 115

Sample Space S = Set of All Possible Outcomes


Event E = Set of Some Outcomes relevant to an
Event = Subset of S
We have to find Probabilit of Event E
= P(E) = size of Set E divided by size of Set S
=|E| / |S|

Event of Getting Even number


Even of Getting Greater than 2

Throwing 1 dice ==> 6 possible outcomes ==>


|S|=6

Sample space (=all possible


outcomes):

Outcome in Sample Space


Page 116

In 2 coins S = {(H,H), (H,T), (T,H), (T,T)}


throw, E = {(H,H), (H,T)}
P(E) = |E| / |S| = 2 / 4

Biased Coin =>

Sample Space has 36 possible outcomes


Page 117

Event A = The first Die is TWO


Event B = Both the Dice are EVEN
(check grammar: singular = Die, plural = Dice)

2 P(A) =
P{ (2,1), (2,2), (2,3),
(2,4), (2,5), (2,6) }
= 6/36 = 1/6
4 P{both even}even}
P (B)= P{both
=P{(2,2), (2,4), (2,6),
(4,2), (4,4), (4,6),
(6,2), (6,4), (6,6) }
= 9/36
= 1/4

Event E = 1st die > 3, 2nd die <2


= {(4,1), (5,1), (6,1)}
|E|=3
Sample Space S = {...36 outcomes...}
| S | = 36
thus, P (E) = 3 / 36
E and F: events

E OR F =

E AND F =
or EF
E OR F =

E AND F = *** Event = EF = E AND F


==> AND / intersection hobe
Page 118

(S)=

Both E and F are Sets


Any Set or Operations on Set can be
viewed as *Venn Diagram*

if E and F are disjoint Sets (Mutually Exclusive events)


Page 119

P(E|F): Probability of E Given F (i.e., it is


given that F has already happened!)
E ={ (1,5), P(EF)=P(E AND F)=> intersection use korba
(2,4), (3,3),
(4,2), (5,1) } F =

So, EF =
E AND F
= E intersect F
= {(4,2)}
F

P(EF) = P{ (4,2) } = 1/36

P(F) = P { (4,1), (4,2), ..., (4,6) } = 6/36


Page 120

Book
example
1.4 >>

P(F) = 6/10

P(E)= 1/10
EF = E AND F = E (intersect) F = {10} so, P(EF)=1/10
Page 121

Book Given that


example
1.5 >>

Find probability that

EF = E (intersect) F
= {(b,b)}

Book
example
1.6 >>
Page 122

Actually, You have to find P {Bev will get A in Chemistry}


= P {Bev takes Chemistry AND gets A in it}
= P (FE) = P (EF)

EF = Bev gets A after (and) taking chemistry

What is the probabilty that Both ...

E: First Ball drawn is Black


F: Second ball drawn is Black

independent
P(EF) = P(E) * P(F|E) - OR - P(F)*P(E|F) when E,F are NOT independent / dependant
Page 123

Another way : (using more text/explanation)


------------------------------------------------------
P (Both Balls Black)

= P (1st Ball Black AND 2nd Ball Black)

= P (1st Ball Black) * P(2nd Ball Black | 1st Ball


already Black)

= 7/12 * 6/11

= 42 / 132

Find the Probability that One Black Ball and One White Ball ....
What is the probability that no one ...
Page 124

1. What is the probability All THREE get their correct hats? => P(E1E2E3)

2. Solve both problems for FOUR persons also ...

Answer: = 1 - 2/3 = 1/3


P(E1) = 1/3 P(E2) = 1/3 P(E3) = 1/3

To understand,
VISUALIZE this scenario!!!
P(E2|E1)
= P(2nd person gets his hat | 1st person
already got his hat)

(only his hat is remained!)


* Also, Solve the previous Hat problem for FOUR persons.
=> see class lecture for four persons solution Page 125
* For both Three hat/ Four Hat problem, also find =>
Probability that at least 1 person finds his hat and P(at least 2 persons find hats)
Probability (EXACTLY 2 persons ...) = 0; Probability that All Find their own hats

Toss Coin ... Choose One of


the Urns Based on Head or Tail

P(White | Head) = EASY!


What is the probability P(Head | White) = Tough!
that
So Convert the Tough One
into Easy one by
Bayes formula !
Page 126

karon, er Ulta
chinta korata
difficult, P(H|W)
chinta korao jai na,
but opposite ta
P(W|H) super easy
Converted to think
to Easy One
Page 127

=
What is the
Probability that s

P(K|C) = Tough !
P(C|K) = EASY = 1.0
convert the tough one into easy
by Bayes formula !!!

= 1.0

ans Na jeneo correct korar


probability = 1/m (jehetu there are
m options in the MCQ)
Page 128

What is the
Probability that
P(E | D) = P (positive | disease)
= 0.95
c
P(E| D ) = P (positive | No Disease)
= P (false positive) = 0.01

P(D) = P(disease) = 0.005


P(Dc) = 1 - P(D) = 0.995

0.01
= 0.01
Page 129

This chapter best Explained in the TextBook (my


Soft Copy Book) (Ross - Chapter 2) see my pdf
version (I added many comments + text in Ross
ch 2 to guide you. Also: the example problems
are better explained in the Book soft copy (I added
some comments) + some example r also extended
by me *** Must see the textbook (with my added
comments in the Dropbox folder soft copy book)
which is

random variable Y = when Tossing TWO coins


Page 130

N : Geometric
Random Variable
Page 131

Geometric first time /1 time only


Page 132

at most
Page 133

+P(1)

= (i)

at most
= P(0) + P(1) +
P(2) + P(3)
=1-

For which value of p, a 4-engine plane will be


more relaibe than a 2-engine plane ?
Page 134
Page 135

= 1.5
Page 136
Page 137
Page 138
Page 139
Page 140
Page 141
Page 142
Page 143
Missing Page
after Page 75

You might also like