SlideShare a Scribd company logo
1 of 37
Advanced Algorithms
RCPIT 2
RCPIT 3
RCPIT 4
RCPIT 5
RCPIT 6
RCPIT 7
RCPIT 8
RCPIT 9
RCPIT 10
RCPIT 11
RCPIT 12
Probabilistic Analysis
• To use Probabilistic Analysis, we need to understand the data and make certain
assumptions about the distribution of inputs in the data.
• We need to proceed with analysis and computation of average case running time but we
also need to manage the cost of hiring
• So let's start by giving certain priority or rank to the candidate
• We need to assume that candidates might appear in a random manner, which will lead to
uniform random permutation.
• So how many permutations we can have (n!)
• And each permutation have an equal probability to appear as a sequence for the interview.
• So, probabilistic analysis just works on the assumption that the candidates appear in a
random order of their rank or priority, but what if they are not.
• We can proceed with randomized algorithm to bring about more control.
13
Randomized Algorithm
• In average-case analysis, we often assume that all inputs are equally
likely
• Actuality, some inputs might be much more likely
• If we're really unlucky, the most likely inputs can be the most costly (as in
some implementations of quicksort)
• What can we do?
• Force all inputs to be equally likely, by randomizing the input
RCPIT 14
Randomization for Hiring Problem
• In the hire-assistant problem, we can first randomly permute the lists of
candidates, and then run the algorithm
• Then, for any input, we'd be guaranteed that the expected number of hires
would be in n + O(1)
• How can we randomly permute a list, so that every permutation is equally
as likely?
• That is, how can we shuffle a list, so that every permutation is equally
likely? Assume that we have a good random number generator.
• When the input is random, we refer to the running time as expected running
time
15
Indicator Random Variable
• It is method to convert between probabilities and expectation
• Indicator variable associated with event A:
• I{A} = 1, if A occurs
• I{A} = 0, if A does not occur
Example: Flip a coin: Y is a random variable representing the coin flip
• X = I{Y = H} = 1, if Y = Head
• X = I{Y = T} = 0, if Y = Tail
RCPIT 16
What is Expected Value? (IRV)
RCPIT 17
• Expected value E[] of a random variable
• Value you "expect" a random variable to have
• Average (mean) value of the variable over many trials
• Does not have to equal the value of any particular trial
Expected Value in IRV
RCPIT 18
RCPIT 19
IRV = Probability
RCPIT 20
IRV Ex. Coin Tossing
RCPIT 21
IRV ex for Hiring Problem
RCPIT 22
Expected Value in HIRING
RCPIT 23
RCPIT 24
RCPIT 25
RCPIT 26
RCPIT 27
For all n days
RCPIT 28
Indicator Random variable
RCPIT 29
Types of randomized algorithms
RCPIT 30
RCPIT 31
RCPIT 32
Las Vegas algorithm
RCPIT 33
Quick Sort- an example of las Vegas
RCPIT 34
RCPIT 35
Monte Carlo
RCPIT 36
Game theoretic randomized algorithm techniques (Min-Max) Technique
• It Follows the Backtracking Algo.
• Best Move Strategy is used.
• Max will try to Maximize its Utility (Best Move)
• Min will try to Minimize its Utility (Worst Move)
RCPIT 37

More Related Content

Similar to AA_Unit_2.pptx

Chapter 3 Random Variable 1.ppt
Chapter 3 Random Variable 1.pptChapter 3 Random Variable 1.ppt
Chapter 3 Random Variable 1.pptZubairShah68
 
Lecture 2-cs648
Lecture 2-cs648Lecture 2-cs648
Lecture 2-cs648Rajiv Omar
 
Data Ananlysis lecture 7 Simon Fraser University
Data Ananlysis lecture 7 Simon Fraser UniversityData Ananlysis lecture 7 Simon Fraser University
Data Ananlysis lecture 7 Simon Fraser Universitysoniyamarghani
 
Stochastic Modeling for Valuation and Risk Management
Stochastic Modeling for Valuation and Risk ManagementStochastic Modeling for Valuation and Risk Management
Stochastic Modeling for Valuation and Risk ManagementRoderick Powell
 
simple-linear-regression (1).pptx
simple-linear-regression (1).pptxsimple-linear-regression (1).pptx
simple-linear-regression (1).pptxShrutiGupta3922
 

Similar to AA_Unit_2.pptx (10)

Chapter 3 Random Variable 1.ppt
Chapter 3 Random Variable 1.pptChapter 3 Random Variable 1.ppt
Chapter 3 Random Variable 1.ppt
 
Lecture 2-cs648
Lecture 2-cs648Lecture 2-cs648
Lecture 2-cs648
 
Crv
CrvCrv
Crv
 
Data Ananlysis lecture 7 Simon Fraser University
Data Ananlysis lecture 7 Simon Fraser UniversityData Ananlysis lecture 7 Simon Fraser University
Data Ananlysis lecture 7 Simon Fraser University
 
Test of hypothesis 1
Test of hypothesis 1Test of hypothesis 1
Test of hypothesis 1
 
Stochastic Modeling for Valuation and Risk Management
Stochastic Modeling for Valuation and Risk ManagementStochastic Modeling for Valuation and Risk Management
Stochastic Modeling for Valuation and Risk Management
 
16885618.ppt
16885618.ppt16885618.ppt
16885618.ppt
 
ACF.ppt
ACF.pptACF.ppt
ACF.ppt
 
Introducing Swift v2.1
Introducing Swift v2.1Introducing Swift v2.1
Introducing Swift v2.1
 
simple-linear-regression (1).pptx
simple-linear-regression (1).pptxsimple-linear-regression (1).pptx
simple-linear-regression (1).pptx
 

More from swapnilslide2019 (13)

Topic-G-JavaCollections Framework.ppt
Topic-G-JavaCollections    Framework.pptTopic-G-JavaCollections    Framework.ppt
Topic-G-JavaCollections Framework.ppt
 
Collectionsand GenericsInJavaProgramming.ppt
Collectionsand GenericsInJavaProgramming.pptCollectionsand GenericsInJavaProgramming.ppt
Collectionsand GenericsInJavaProgramming.ppt
 
Flow Network Introduction
Flow Network IntroductionFlow Network Introduction
Flow Network Introduction
 
kdtrees.pdf
kdtrees.pdfkdtrees.pdf
kdtrees.pdf
 
AA_Unit_6.pptx
AA_Unit_6.pptxAA_Unit_6.pptx
AA_Unit_6.pptx
 
AA_Unit_4.pptx
AA_Unit_4.pptxAA_Unit_4.pptx
AA_Unit_4.pptx
 
AA_Unit_3.pptx
AA_Unit_3.pptxAA_Unit_3.pptx
AA_Unit_3.pptx
 
AA_Unit 1_part-II.pdf
AA_Unit 1_part-II.pdfAA_Unit 1_part-II.pdf
AA_Unit 1_part-II.pdf
 
AA_Unit 1_part-I.pptx
AA_Unit 1_part-I.pptxAA_Unit 1_part-I.pptx
AA_Unit 1_part-I.pptx
 
Programming Laboratory Unit 1.pdf
Programming Laboratory Unit 1.pdfProgramming Laboratory Unit 1.pdf
Programming Laboratory Unit 1.pdf
 
PL-I.pdf
PL-I.pdfPL-I.pdf
PL-I.pdf
 
CI.pdf
CI.pdfCI.pdf
CI.pdf
 
PL-I.pdf
PL-I.pdfPL-I.pdf
PL-I.pdf
 

Recently uploaded

Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoordharasingh5698
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityMorshed Ahmed Rahath
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf203318pmpc
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Unit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfUnit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfRagavanV2
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...tanu pandey
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationBhangaleSonal
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxJuliansyahHarahap1
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueBhangaleSonal
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfRagavanV2
 
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...soginsider
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringmulugeta48
 
Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086anil_gaur
 

Recently uploaded (20)

Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
 
22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
 
Unit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfUnit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdf
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086
 

AA_Unit_2.pptx

  • 13. Probabilistic Analysis • To use Probabilistic Analysis, we need to understand the data and make certain assumptions about the distribution of inputs in the data. • We need to proceed with analysis and computation of average case running time but we also need to manage the cost of hiring • So let's start by giving certain priority or rank to the candidate • We need to assume that candidates might appear in a random manner, which will lead to uniform random permutation. • So how many permutations we can have (n!) • And each permutation have an equal probability to appear as a sequence for the interview. • So, probabilistic analysis just works on the assumption that the candidates appear in a random order of their rank or priority, but what if they are not. • We can proceed with randomized algorithm to bring about more control. 13
  • 14. Randomized Algorithm • In average-case analysis, we often assume that all inputs are equally likely • Actuality, some inputs might be much more likely • If we're really unlucky, the most likely inputs can be the most costly (as in some implementations of quicksort) • What can we do? • Force all inputs to be equally likely, by randomizing the input RCPIT 14
  • 15. Randomization for Hiring Problem • In the hire-assistant problem, we can first randomly permute the lists of candidates, and then run the algorithm • Then, for any input, we'd be guaranteed that the expected number of hires would be in n + O(1) • How can we randomly permute a list, so that every permutation is equally as likely? • That is, how can we shuffle a list, so that every permutation is equally likely? Assume that we have a good random number generator. • When the input is random, we refer to the running time as expected running time 15
  • 16. Indicator Random Variable • It is method to convert between probabilities and expectation • Indicator variable associated with event A: • I{A} = 1, if A occurs • I{A} = 0, if A does not occur Example: Flip a coin: Y is a random variable representing the coin flip • X = I{Y = H} = 1, if Y = Head • X = I{Y = T} = 0, if Y = Tail RCPIT 16
  • 17. What is Expected Value? (IRV) RCPIT 17 • Expected value E[] of a random variable • Value you "expect" a random variable to have • Average (mean) value of the variable over many trials • Does not have to equal the value of any particular trial
  • 18. Expected Value in IRV RCPIT 18
  • 21. IRV Ex. Coin Tossing RCPIT 21
  • 22. IRV ex for Hiring Problem RCPIT 22
  • 23. Expected Value in HIRING RCPIT 23
  • 28. For all n days RCPIT 28
  • 30. Types of randomized algorithms RCPIT 30
  • 34. Quick Sort- an example of las Vegas RCPIT 34
  • 37. Game theoretic randomized algorithm techniques (Min-Max) Technique • It Follows the Backtracking Algo. • Best Move Strategy is used. • Max will try to Maximize its Utility (Best Move) • Min will try to Minimize its Utility (Worst Move) RCPIT 37