SlideShare a Scribd company logo
Randomized Algorithms
CS648
Lecture 4
• Linearity of Expectation with applications
(Most important tool for analyzing randomized algorithms)
1
RECAP FROM THE LAST LECTURE
2
Random variable
3
Expected Value of a random variable
(average value)
4
Ω
X= a X= b
X= c
Examples
5
Can we solve these problems ?
6
Balls into Bins
(number of empty bins)
7
1 2 3 … … n
1 2 3 4 5 … m-1 m
This is a right but useless answer !
Randomized Quick Sort
(number of comparisons)
8
We can not proceed from this point …
A recursion tree
associated with Randomized Quick Sort
9
1 2 3 4 5 … m-1 m
1 2 3 … … n
Balls into Bins
(number of empty bins)
Randomized Quick Sort
(number of comparisons)
Balls into Bins
(number of empty bins)
10
1 2 3 4 5 … m-1 m
11
1 2 3 4 5
1 2 3 4 5 6
0 1 0 1 0
Sum of Random Variables
12
Randomized Quick Sort
(number of comparisons)
13
Elements of A arranged in
Increasing order of values
14
1 0 … 0 1 1 … 0
What have we learnt till now?
15
The main question ?
16
Balls into Bins
(number of empty bins)
17
1 2 3 … … n
1 2 3 4 5 … m-1 m
Randomized Quick Sort
(number of comparisons)
18
Linearity of Expectation
19
Where to use Linearity of expectation ?
20
Think over the following questions?
21
Think over the following questions?
22
Independent random variables
23
Some Practice problems
as homework
• Balls into bin problem:
• What is the expected number of bins having exactly 2 balls ?
• We toss a coin n times, what is the expected number of times pattern HHT
appear ?
• A stick has n joints. The stick is dropped on floor and in this process each
joint may break with probability p independent of others. As a result the
stick will be break into many substicks.
– What is the expected number of substicks of length 3 ?
– What is the expected number of all the substicks ?
24
PROBLEMS OF THE NEXT LECTURE
25
Fingerprinting Techniques
26
Fingerprinting Techniques
27

More Related Content

PPT
Pre cal drill
PPTX
Coordinates (Mathematics 5)
PPT
3rd Test - Writing The Equation Of A Line
PDF
8th alg -l3.5
PPSX
Patterns number and geometric
PPT
Patterns sequences
PDF
8th alg -l3.6
PPTX
11 – 28 journal
Pre cal drill
Coordinates (Mathematics 5)
3rd Test - Writing The Equation Of A Line
8th alg -l3.5
Patterns number and geometric
Patterns sequences
8th alg -l3.6
11 – 28 journal

What's hot (17)

PPTX
Welcome1stdaypwpt2014 b
PPT
Polynomials review
PPT
Algebra 1 Standard Form
PPT
4.3 notes
PPTX
Functions four representations edmodo 2013 2014
PPS
Arithmetic series problems
PPTX
January 14, 2015
PPTX
Qa08 missing numbers
PPTX
Overview
PPTX
December 20
PPTX
January 21, 2015
PPT
Parallel & Perpendicular Lines
PPTX
Number sequences and patterns
PDF
Cmo sample-papers-for-class-5
PPT
Data Comes in Shapes
PPT
Graphing lines
PPTX
Rational functions day 2.pptx worked
Welcome1stdaypwpt2014 b
Polynomials review
Algebra 1 Standard Form
4.3 notes
Functions four representations edmodo 2013 2014
Arithmetic series problems
January 14, 2015
Qa08 missing numbers
Overview
December 20
January 21, 2015
Parallel & Perpendicular Lines
Number sequences and patterns
Cmo sample-papers-for-class-5
Data Comes in Shapes
Graphing lines
Rational functions day 2.pptx worked
Ad

Similar to Lecture 4-cs648 Randomized Algorithms (20)

PPTX
Lecture 4-cs648
PPTX
Lecture 3-cs648
PPTX
Lecture 3-cs648 Randomized Algorithms
PPT
Mathematics 6-Demo Teaching for Rural Areas
PPTX
Lecture Week 17 which hleps in study for logic and
PPTX
counting techniques
PPT
Recursion
PDF
lec 03wweweweweweweeweweweewewewewee.pdf
PDF
The Attractor
PPTX
Understanding Basics of Machine Learning
PPTX
GMAT Quant Strategy- What to expect in Quantitative Reasoning Section on the ...
PDF
STAB52 Introduction to probability (Summer 2025) Lecture 2
PDF
chapter1.pdf ......................................
PPTX
STAT: Counting principles(2)
PPTX
unit-3-permutation_combination.pptx
PDF
Day 11 least common multiple
PPTX
Statisticsljdhciwjhf[wp ofpwifovikjdjheo iw
PPSX
[Maths] arithmetic
PPTX
CS 161 Section 1 Slides - Stanford University
Lecture 4-cs648
Lecture 3-cs648
Lecture 3-cs648 Randomized Algorithms
Mathematics 6-Demo Teaching for Rural Areas
Lecture Week 17 which hleps in study for logic and
counting techniques
Recursion
lec 03wweweweweweweeweweweewewewewee.pdf
The Attractor
Understanding Basics of Machine Learning
GMAT Quant Strategy- What to expect in Quantitative Reasoning Section on the ...
STAB52 Introduction to probability (Summer 2025) Lecture 2
chapter1.pdf ......................................
STAT: Counting principles(2)
unit-3-permutation_combination.pptx
Day 11 least common multiple
Statisticsljdhciwjhf[wp ofpwifovikjdjheo iw
[Maths] arithmetic
CS 161 Section 1 Slides - Stanford University
Ad

More from Anshul Yadav (16)

PPTX
Lecture 19-cs648
PPTX
Lecture 17-cs648
PPTX
Lecture 14-cs648-2013
PPTX
Lecture 13-cs648
PPTX
Lecture 18-cs648
PPTX
Lecture 16
PPTX
Theoretical assign-2-hints
PPTX
Lecture 12-cs648-2013 Randomized Algorithms
PPTX
Lecture 11-cs648-2013 Randomized Algorithms
PPTX
Lecture 10-cs648=2013 Randomized Algorithms
PPTX
Lecture 9-cs648-2013 Randomized Algorithms
PPTX
Lecture 6-cs648 Randomized Algorithms
PPTX
Lecture 5-cs648 Randomized Algorithms
PPTX
Lecture 2-cs648 Randomized Algorithms
PPTX
Lecture 7-cs648 Randomized Algorithms
PPTX
Lecture 1-cs648
Lecture 19-cs648
Lecture 17-cs648
Lecture 14-cs648-2013
Lecture 13-cs648
Lecture 18-cs648
Lecture 16
Theoretical assign-2-hints
Lecture 12-cs648-2013 Randomized Algorithms
Lecture 11-cs648-2013 Randomized Algorithms
Lecture 10-cs648=2013 Randomized Algorithms
Lecture 9-cs648-2013 Randomized Algorithms
Lecture 6-cs648 Randomized Algorithms
Lecture 5-cs648 Randomized Algorithms
Lecture 2-cs648 Randomized Algorithms
Lecture 7-cs648 Randomized Algorithms
Lecture 1-cs648

Recently uploaded (20)

PDF
Electronic commerce courselecture one. Pdf
PDF
cuic standard and advanced reporting.pdf
PPTX
MYSQL Presentation for SQL database connectivity
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Big Data Technologies - Introduction.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Cloud computing and distributed systems.
Electronic commerce courselecture one. Pdf
cuic standard and advanced reporting.pdf
MYSQL Presentation for SQL database connectivity
The AUB Centre for AI in Media Proposal.docx
MIND Revenue Release Quarter 2 2025 Press Release
Dropbox Q2 2025 Financial Results & Investor Presentation
Spectral efficient network and resource selection model in 5G networks
Assigned Numbers - 2025 - Bluetooth® Document
Encapsulation_ Review paper, used for researhc scholars
Building Integrated photovoltaic BIPV_UPV.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
sap open course for s4hana steps from ECC to s4
Digital-Transformation-Roadmap-for-Companies.pptx
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Big Data Technologies - Introduction.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Network Security Unit 5.pdf for BCA BBA.
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Cloud computing and distributed systems.

Lecture 4-cs648 Randomized Algorithms