SlideShare a Scribd company logo
1 of 32
Randomized Algorithms
CS648

Lecture 10
Random Sampling
part-II
(To find a subset with desired property)
1
Overview
•
•
•
•

There is a huge list (1 million) of blood donors.
Unfortunately the blood group information is missing at present.
We need a donor with blood group O+.
What to do ?

Solution: (Select a random subset of donors.)
Repeat until we get a donor of blood group O+.
{ Pick phone number of a donor randomly uniformly
Call him to ask his Blood group.
}
Random Sampling

• Suppose there is a computational problem where we require to find a
subset with some desired properties.
• Unfortunately, computing such a set deterministically may take huge time.
• Random sampling carried out suitably may produce a subset with the
desired property with some probability.
RANDOMIZED ALGORITHM FOR
BPWM PROBLEM
Integer Product of Matrices
1

0

0

1

0

1

0

1

0

0

2

1

2

0

0

1

0

0

0

1

0

1

1

0

1

2

0

1

0

0

0

0

1

0

0

1

1

1

1

0

1

1

1

1

0

0

1

0

1

0

1

1

1

0

0

1

2

2

0

1

1

1

0

1

0

1

0

0

1

0

2

2

3 0
D

1

A

B
Boolean Product of Matrices
1

0

0

1

0

1

0

1

0

0

1

1

1

0

0

1

0

0

0

1

0

1

1

0

1

1

0

1

0

0

0

0

1

0

0

1

1

1

1

0

1

1

1

1

0

0

1

0

1

0

1

1

1

0

0

1

1

1

0

1

1

1

0

1

0

1

0

0

1

0

1

1

1
C

0

1

A

B
Boolean Product of Matrices
1

0

0

1

0

1

0

1

0

0

1

1

1

0

0

1

0

0

0

1

0

1

1

0

1

1

0

1

0

0

0

0

1

0

0

1

1

1

1

0

1

1

1

1

0

0

1

0

1

0

1

1

1

0

0

1

1

1

0

1

1

1

0

1

0

1

0

0

1

0

1

1

1
C

0

1

A

B
Boolean Product Witness Matrix (BPWM)
MOTIVATION FOR BPWM
All Pairs Shortest Paths (APSP)
All Pairs Shortest Paths (APSP)
Students having interest in algorithms are
strongly advised to study this novel
algorithm from Motwani-Raghwan book
or the original journal version. (This is, of
course, not part of the syllabus for CS648)
RANDOMIZED ALGORITHM FOR
BPWM
Boolean Product Witness Matrix (BPWM)
Boolean Product of Matrices
1

0

0

1

0

1

0

1

0

0

1

1

1

0

0

1

0

0

0

1

0

1

1

0

1

1

0

1

0

0

0

0

1

0

0

1

1

1

1

0

1

1

1

1

0

0

1

0

1

0

1

1

1

0

0

1

1

1

0

1

1

1

0

1

0

1

0

0

1

0

1

1

1
C

0

1

2

1

2

0

0

2

0

1

0

0

1

1

1

1

0

1

2

2

0

1

2

2

3

0

1

A
Look carefully at the integer
product matrix D. Does it
have any thing to do with
witnesses.

B

D
Boolean Product of Matrices
1

0

0

1

0

1

0

1

0

0

2

1

2

0

0

1

0

0

0

1

0

1

1

0

1

2

0

1

0

0

0

0

1

0

0

1

1

1

1

0

1

1

1

1

0

0

1

0

1

0

1

1

1

0

0

1

2

2

0

1

1

1

0

1

0

1

0

0

1

0

2

2

3 0
D

1

A

B
Boolean Product of Matrices
1 2 3 4 5
⨯ ⨯ ⨯ ⨯ ⨯
1

0

0

1

0

1

0

1

0

0

2

1

2

0

0

1

0

0

0

1

0

1

1

0

1

2

0

1

0

0

0

0

1

0

0

1

1

1

1

0

1

1

1

1

0

0

1

0

1

0

1

1

1

0

0

1

2

2

0

1

1

1

0

1

0

1

0

0

1

0

2

2

3 0
D

1

A
There is a way to manipulate A so
that D will store a witness for all
those pairs which have singleton
witness. Can you guess ?

B
Boolean Product of Matrices
1 2 3 4 5
⨯ ⨯ ⨯ ⨯ ⨯
1

0

0

1

0

1

0

1

0

0

2

4

2

0

0

1

0

0

0

1

0

1

1

0

1

2

0

1

0

0

0

0

1

0

0

1

1

1

1

0

3

3

3

3

0

0

1

0

1

0

1

1

1

0

0

2

2

2

0

2

1

1

0

1

0

1

0

0

1

0

2

2

3 0
D

2

A

B
Boolean Product of Matrices
1 2 3 4 5
⨯ ⨯ ⨯ ⨯ ⨯
1

0

0

1

0

1

0

1

0

0

5

4

5

0

0

1

0

0

0

1

0

1

1

0

1

6

0

1

0

0

0

0

1

0

0

1

1

1

1

0

3

3

3

3

0

0

1

0

1

0

1

1

1

0

0

2

6

6

0

2

1

1

0

1

0

1

0

0

1

0

5

6

7 0
D

2

A

B
Algorithm for Computing Singleton Witnesses
Algorithm Design for BPWM
1 2 3 4

…

n

⨯ ⨯ ⨯ ⨯ ⨯ ⨯ ⨯ ⨯ ⨯
1
1
0
1
1

0

1

1

1

0

0

1

0

1

1

0
1
1
0
0

A

B
1 2 3 4

…

n

⨯ ⨯ ⨯ ⨯ ⨯ ⨯ ⨯ ⨯ ⨯
1
1
0
1
1

0

1

1

1

0

0

1

0

1

1

0
1
1
0
0

A

B
1 2 3 4 5

…

n-1 n

⨯ ⨯ ⨯ ⨯ ⨯ ⨯ ⨯ ⨯ ⨯
1
1
0
1
1

0

1

1

1

0

0

1

0

1

1

0
1
1
0
0

A

B
0 2 3 0 5

…

n-1 0

⨯ ⨯ ⨯ ⨯ ⨯ ⨯ ⨯ ⨯ ⨯
1
1
0
1
1

0

1

1

1

0

0

1

0

1

1

0
1
1
0
0

A

B
No idea!
Let us ask the following related but easier
question.
Conclusion

A sketch of the solution for Question 1 was given in the class. The
students are encouraged to work out the exact details. The solution
will be presented in the beginning of next lecture class.

More Related Content

Viewers also liked

be quran walking among people
 be quran walking among people be quran walking among people
be quran walking among people
Hassan Elagouz
 
رسالة الصالحين للشيخ فوزى محمد أبوزيد
 رسالة الصالحين للشيخ فوزى محمد أبوزيد رسالة الصالحين للشيخ فوزى محمد أبوزيد
رسالة الصالحين للشيخ فوزى محمد أبوزيد
Hassan Elagouz
 
Presentation1
Presentation1Presentation1
Presentation1
Sanusia1
 
الولاية والأولياء لفضيلة الشيخ فوزى محمد أبوزيد
الولاية والأولياء لفضيلة الشيخ فوزى محمد أبوزيد الولاية والأولياء لفضيلة الشيخ فوزى محمد أبوزيد
الولاية والأولياء لفضيلة الشيخ فوزى محمد أبوزيد
Hassan Elagouz
 
كيف تكون داعيا إلى الله على بصيرة
كيف تكون داعيا إلى الله على بصيرةكيف تكون داعيا إلى الله على بصيرة
كيف تكون داعيا إلى الله على بصيرة
Hassan Elagouz
 
الصيام شريعة وحقيقة للشيخ فوزي محمد أبوزيد
الصيام شريعة وحقيقة للشيخ فوزي محمد أبوزيدالصيام شريعة وحقيقة للشيخ فوزي محمد أبوزيد
الصيام شريعة وحقيقة للشيخ فوزي محمد أبوزيد
Hassan Elagouz
 

Viewers also liked (18)

โครงงานคอมพิวเตอร์
โครงงานคอมพิวเตอร์โครงงานคอมพิวเตอร์
โครงงานคอมพิวเตอร์
 
be quran walking among people
 be quran walking among people be quran walking among people
be quran walking among people
 
Convenio de colaboracion para la ejecucion del programa de reforestacion en ...
Convenio  de colaboracion para la ejecucion del programa de reforestacion en ...Convenio  de colaboracion para la ejecucion del programa de reforestacion en ...
Convenio de colaboracion para la ejecucion del programa de reforestacion en ...
 
رسالة الصالحين للشيخ فوزى محمد أبوزيد
 رسالة الصالحين للشيخ فوزى محمد أبوزيد رسالة الصالحين للشيخ فوزى محمد أبوزيد
رسالة الصالحين للشيخ فوزى محمد أبوزيد
 
Prezi -bulldogs
Prezi -bulldogsPrezi -bulldogs
Prezi -bulldogs
 
Proposal ptk
Proposal ptkProposal ptk
Proposal ptk
 
Presentation1
Presentation1Presentation1
Presentation1
 
Micai13 turdus migratorius (2)
Micai13   turdus migratorius (2)Micai13   turdus migratorius (2)
Micai13 turdus migratorius (2)
 
نوافل المقربين
نوافل المقربيننوافل المقربين
نوافل المقربين
 
Ghid util
Ghid utilGhid util
Ghid util
 
الولاية والأولياء لفضيلة الشيخ فوزى محمد أبوزيد
الولاية والأولياء لفضيلة الشيخ فوزى محمد أبوزيد الولاية والأولياء لفضيلة الشيخ فوزى محمد أبوزيد
الولاية والأولياء لفضيلة الشيخ فوزى محمد أبوزيد
 
Biodiesel no Brasil
Biodiesel no BrasilBiodiesel no Brasil
Biodiesel no Brasil
 
كيف تكون داعيا إلى الله على بصيرة
كيف تكون داعيا إلى الله على بصيرةكيف تكون داعيا إلى الله على بصيرة
كيف تكون داعيا إلى الله على بصيرة
 
Tabel accize oug 8
Tabel accize oug 8Tabel accize oug 8
Tabel accize oug 8
 
Physics 1
Physics 1Physics 1
Physics 1
 
Social media project
Social media projectSocial media project
Social media project
 
Handbag hangers-wholesale
Handbag hangers-wholesaleHandbag hangers-wholesale
Handbag hangers-wholesale
 
الصيام شريعة وحقيقة للشيخ فوزي محمد أبوزيد
الصيام شريعة وحقيقة للشيخ فوزي محمد أبوزيدالصيام شريعة وحقيقة للشيخ فوزي محمد أبوزيد
الصيام شريعة وحقيقة للشيخ فوزي محمد أبوزيد
 

Similar to Lecture 10-cs648=2013

Lecture 10-cs648=2013 Randomized Algorithms
Lecture 10-cs648=2013 Randomized AlgorithmsLecture 10-cs648=2013 Randomized Algorithms
Lecture 10-cs648=2013 Randomized Algorithms
Anshul Yadav
 
SPIE Conference V3.0
SPIE Conference V3.0SPIE Conference V3.0
SPIE Conference V3.0
Robert Fry
 
OpenCL applications in genomics
OpenCL applications in genomicsOpenCL applications in genomics
OpenCL applications in genomics
USC
 
A new approach to ward off error propagation effect of aes –
A new approach to ward off error propagation effect of aes –A new approach to ward off error propagation effect of aes –
A new approach to ward off error propagation effect of aes –
Alexander Decker
 

Similar to Lecture 10-cs648=2013 (20)

Lecture 10-cs648=2013 Randomized Algorithms
Lecture 10-cs648=2013 Randomized AlgorithmsLecture 10-cs648=2013 Randomized Algorithms
Lecture 10-cs648=2013 Randomized Algorithms
 
Data Mining Lecture_4.pptx
Data Mining Lecture_4.pptxData Mining Lecture_4.pptx
Data Mining Lecture_4.pptx
 
Lecture 2 - Bit vs Qubits.pptx
Lecture 2 - Bit vs Qubits.pptxLecture 2 - Bit vs Qubits.pptx
Lecture 2 - Bit vs Qubits.pptx
 
Transformers ASR.pdf
Transformers ASR.pdfTransformers ASR.pdf
Transformers ASR.pdf
 
Exploiting Worker Correlation for Label Aggregation in Crowdsourcing
Exploiting Worker Correlation for Label Aggregation in CrowdsourcingExploiting Worker Correlation for Label Aggregation in Crowdsourcing
Exploiting Worker Correlation for Label Aggregation in Crowdsourcing
 
Elisa basics[2]
Elisa basics[2]Elisa basics[2]
Elisa basics[2]
 
Digital electronics logic design complete notes.pdf
Digital electronics logic design complete notes.pdfDigital electronics logic design complete notes.pdf
Digital electronics logic design complete notes.pdf
 
Tutorial 9 (bloom filters)
Tutorial 9 (bloom filters)Tutorial 9 (bloom filters)
Tutorial 9 (bloom filters)
 
02-gates-w.pptx
02-gates-w.pptx02-gates-w.pptx
02-gates-w.pptx
 
Unit_2_Boolean_algebra_and_Karnaugh_maps.pptx
Unit_2_Boolean_algebra_and_Karnaugh_maps.pptxUnit_2_Boolean_algebra_and_Karnaugh_maps.pptx
Unit_2_Boolean_algebra_and_Karnaugh_maps.pptx
 
SPIE Conference V3.0
SPIE Conference V3.0SPIE Conference V3.0
SPIE Conference V3.0
 
COMPUTER ORGANIZATION - Logic gates, Boolean Algebra, Combinational Circuits
COMPUTER ORGANIZATION - Logic gates, Boolean Algebra, Combinational CircuitsCOMPUTER ORGANIZATION - Logic gates, Boolean Algebra, Combinational Circuits
COMPUTER ORGANIZATION - Logic gates, Boolean Algebra, Combinational Circuits
 
23 gray codes
23 gray codes23 gray codes
23 gray codes
 
23 gray codes
23 gray codes23 gray codes
23 gray codes
 
OpenCL applications in genomics
OpenCL applications in genomicsOpenCL applications in genomics
OpenCL applications in genomics
 
Quantum computing for CS students: the unitary circuit model
Quantum computing for CS students: the unitary circuit modelQuantum computing for CS students: the unitary circuit model
Quantum computing for CS students: the unitary circuit model
 
Artificial Neural Networks_Bioinsspired_Algorithms_Nov 20.ppt
Artificial Neural Networks_Bioinsspired_Algorithms_Nov 20.pptArtificial Neural Networks_Bioinsspired_Algorithms_Nov 20.ppt
Artificial Neural Networks_Bioinsspired_Algorithms_Nov 20.ppt
 
Deep learning study 2
Deep learning study 2Deep learning study 2
Deep learning study 2
 
Lecture 18 M - Copy.pptx
Lecture 18 M - Copy.pptxLecture 18 M - Copy.pptx
Lecture 18 M - Copy.pptx
 
A new approach to ward off error propagation effect of aes –
A new approach to ward off error propagation effect of aes –A new approach to ward off error propagation effect of aes –
A new approach to ward off error propagation effect of aes –
 

More from Rajiv Omar

Lecture 6-cs345-2014
Lecture 6-cs345-2014Lecture 6-cs345-2014
Lecture 6-cs345-2014
Rajiv Omar
 
Lecture 7-cs345-2014
Lecture 7-cs345-2014Lecture 7-cs345-2014
Lecture 7-cs345-2014
Rajiv Omar
 
Lecture 14-2013
Lecture 14-2013Lecture 14-2013
Lecture 14-2013
Rajiv Omar
 
Lecture 2-cs648
Lecture 2-cs648Lecture 2-cs648
Lecture 2-cs648
Rajiv Omar
 
Lecture 13-cs648
Lecture 13-cs648Lecture 13-cs648
Lecture 13-cs648
Rajiv Omar
 
Lecture 14-cs648-2013
Lecture 14-cs648-2013Lecture 14-cs648-2013
Lecture 14-cs648-2013
Rajiv Omar
 
Lecture 17-cs648
Lecture 17-cs648Lecture 17-cs648
Lecture 17-cs648
Rajiv Omar
 
Lecture 18-cs648
Lecture 18-cs648Lecture 18-cs648
Lecture 18-cs648
Rajiv Omar
 
Lecture 19-cs648
Lecture 19-cs648Lecture 19-cs648
Lecture 19-cs648
Rajiv Omar
 
Lecture 20-cs648
Lecture 20-cs648Lecture 20-cs648
Lecture 20-cs648
Rajiv Omar
 
Lecture 22-cs648
Lecture 22-cs648Lecture 22-cs648
Lecture 22-cs648
Rajiv Omar
 
Lecture 3-cs648
Lecture 3-cs648Lecture 3-cs648
Lecture 3-cs648
Rajiv Omar
 
Lecture 4-cs648
Lecture 4-cs648Lecture 4-cs648
Lecture 4-cs648
Rajiv Omar
 
Lecture 5-cs648
Lecture 5-cs648Lecture 5-cs648
Lecture 5-cs648
Rajiv Omar
 
Lecture 6-cs648
Lecture 6-cs648Lecture 6-cs648
Lecture 6-cs648
Rajiv Omar
 
Lecture 7-cs648
Lecture 7-cs648Lecture 7-cs648
Lecture 7-cs648
Rajiv Omar
 
Lecture 8-cs648-2013
Lecture 8-cs648-2013Lecture 8-cs648-2013
Lecture 8-cs648-2013
Rajiv Omar
 
Lecture 9-cs648-2013
Lecture 9-cs648-2013Lecture 9-cs648-2013
Lecture 9-cs648-2013
Rajiv Omar
 

More from Rajiv Omar (20)

Lecture 6-cs345-2014
Lecture 6-cs345-2014Lecture 6-cs345-2014
Lecture 6-cs345-2014
 
Lecture 7-cs345-2014
Lecture 7-cs345-2014Lecture 7-cs345-2014
Lecture 7-cs345-2014
 
Lecture 14-2013
Lecture 14-2013Lecture 14-2013
Lecture 14-2013
 
Lecture 2-cs648
Lecture 2-cs648Lecture 2-cs648
Lecture 2-cs648
 
Lecture 15
Lecture 15Lecture 15
Lecture 15
 
Lecture 16
Lecture 16Lecture 16
Lecture 16
 
Lecture 13-cs648
Lecture 13-cs648Lecture 13-cs648
Lecture 13-cs648
 
Lecture 14-cs648-2013
Lecture 14-cs648-2013Lecture 14-cs648-2013
Lecture 14-cs648-2013
 
Lecture 17-cs648
Lecture 17-cs648Lecture 17-cs648
Lecture 17-cs648
 
Lecture 18-cs648
Lecture 18-cs648Lecture 18-cs648
Lecture 18-cs648
 
Lecture 19-cs648
Lecture 19-cs648Lecture 19-cs648
Lecture 19-cs648
 
Lecture 20-cs648
Lecture 20-cs648Lecture 20-cs648
Lecture 20-cs648
 
Lecture 22-cs648
Lecture 22-cs648Lecture 22-cs648
Lecture 22-cs648
 
Lecture 3-cs648
Lecture 3-cs648Lecture 3-cs648
Lecture 3-cs648
 
Lecture 4-cs648
Lecture 4-cs648Lecture 4-cs648
Lecture 4-cs648
 
Lecture 5-cs648
Lecture 5-cs648Lecture 5-cs648
Lecture 5-cs648
 
Lecture 6-cs648
Lecture 6-cs648Lecture 6-cs648
Lecture 6-cs648
 
Lecture 7-cs648
Lecture 7-cs648Lecture 7-cs648
Lecture 7-cs648
 
Lecture 8-cs648-2013
Lecture 8-cs648-2013Lecture 8-cs648-2013
Lecture 8-cs648-2013
 
Lecture 9-cs648-2013
Lecture 9-cs648-2013Lecture 9-cs648-2013
Lecture 9-cs648-2013
 

Recently uploaded

Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Dipal Arora
 
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
dollysharma2066
 
0183760ssssssssssssssssssssssssssss00101011 (27).pdf
0183760ssssssssssssssssssssssssssss00101011 (27).pdf0183760ssssssssssssssssssssssssssss00101011 (27).pdf
0183760ssssssssssssssssssssssssssss00101011 (27).pdf
Renandantas16
 
Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...
Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...
Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...
amitlee9823
 
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
lizamodels9
 
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabiunwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
Abortion pills in Kuwait Cytotec pills in Kuwait
 

Recently uploaded (20)

Famous Olympic Siblings from the 21st Century
Famous Olympic Siblings from the 21st CenturyFamous Olympic Siblings from the 21st Century
Famous Olympic Siblings from the 21st Century
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
 
BAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRL
BAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRLBAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRL
BAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRL
 
Monthly Social Media Update April 2024 pptx.pptx
Monthly Social Media Update April 2024 pptx.pptxMonthly Social Media Update April 2024 pptx.pptx
Monthly Social Media Update April 2024 pptx.pptx
 
A DAY IN THE LIFE OF A SALESMAN / WOMAN
A DAY IN THE LIFE OF A  SALESMAN / WOMANA DAY IN THE LIFE OF A  SALESMAN / WOMAN
A DAY IN THE LIFE OF A SALESMAN / WOMAN
 
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
 
Forklift Operations: Safety through Cartoons
Forklift Operations: Safety through CartoonsForklift Operations: Safety through Cartoons
Forklift Operations: Safety through Cartoons
 
John Halpern sued for sexual assault.pdf
John Halpern sued for sexual assault.pdfJohn Halpern sued for sexual assault.pdf
John Halpern sued for sexual assault.pdf
 
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
 
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
 
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRLMONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
 
Cracking the Cultural Competence Code.pptx
Cracking the Cultural Competence Code.pptxCracking the Cultural Competence Code.pptx
Cracking the Cultural Competence Code.pptx
 
0183760ssssssssssssssssssssssssssss00101011 (27).pdf
0183760ssssssssssssssssssssssssssss00101011 (27).pdf0183760ssssssssssssssssssssssssssss00101011 (27).pdf
0183760ssssssssssssssssssssssssssss00101011 (27).pdf
 
Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...
Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...
Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...
 
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best ServicesMysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
 
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
 
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabiunwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
 
It will be International Nurses' Day on 12 May
It will be International Nurses' Day on 12 MayIt will be International Nurses' Day on 12 May
It will be International Nurses' Day on 12 May
 
Value Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and painsValue Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and pains
 
Organizational Transformation Lead with Culture
Organizational Transformation Lead with CultureOrganizational Transformation Lead with Culture
Organizational Transformation Lead with Culture
 

Lecture 10-cs648=2013

  • 1. Randomized Algorithms CS648 Lecture 10 Random Sampling part-II (To find a subset with desired property) 1
  • 2. Overview • • • • There is a huge list (1 million) of blood donors. Unfortunately the blood group information is missing at present. We need a donor with blood group O+. What to do ? Solution: (Select a random subset of donors.) Repeat until we get a donor of blood group O+. { Pick phone number of a donor randomly uniformly Call him to ask his Blood group. }
  • 3. Random Sampling • Suppose there is a computational problem where we require to find a subset with some desired properties. • Unfortunately, computing such a set deterministically may take huge time. • Random sampling carried out suitably may produce a subset with the desired property with some probability.
  • 5. Integer Product of Matrices 1 0 0 1 0 1 0 1 0 0 2 1 2 0 0 1 0 0 0 1 0 1 1 0 1 2 0 1 0 0 0 0 1 0 0 1 1 1 1 0 1 1 1 1 0 0 1 0 1 0 1 1 1 0 0 1 2 2 0 1 1 1 0 1 0 1 0 0 1 0 2 2 3 0 D 1 A B
  • 6. Boolean Product of Matrices 1 0 0 1 0 1 0 1 0 0 1 1 1 0 0 1 0 0 0 1 0 1 1 0 1 1 0 1 0 0 0 0 1 0 0 1 1 1 1 0 1 1 1 1 0 0 1 0 1 0 1 1 1 0 0 1 1 1 0 1 1 1 0 1 0 1 0 0 1 0 1 1 1 C 0 1 A B
  • 7. Boolean Product of Matrices 1 0 0 1 0 1 0 1 0 0 1 1 1 0 0 1 0 0 0 1 0 1 1 0 1 1 0 1 0 0 0 0 1 0 0 1 1 1 1 0 1 1 1 1 0 0 1 0 1 0 1 1 1 0 0 1 1 1 0 1 1 1 0 1 0 1 0 0 1 0 1 1 1 C 0 1 A B
  • 8. Boolean Product Witness Matrix (BPWM)
  • 10. All Pairs Shortest Paths (APSP)
  • 11. All Pairs Shortest Paths (APSP) Students having interest in algorithms are strongly advised to study this novel algorithm from Motwani-Raghwan book or the original journal version. (This is, of course, not part of the syllabus for CS648)
  • 13. Boolean Product Witness Matrix (BPWM)
  • 14. Boolean Product of Matrices 1 0 0 1 0 1 0 1 0 0 1 1 1 0 0 1 0 0 0 1 0 1 1 0 1 1 0 1 0 0 0 0 1 0 0 1 1 1 1 0 1 1 1 1 0 0 1 0 1 0 1 1 1 0 0 1 1 1 0 1 1 1 0 1 0 1 0 0 1 0 1 1 1 C 0 1 2 1 2 0 0 2 0 1 0 0 1 1 1 1 0 1 2 2 0 1 2 2 3 0 1 A Look carefully at the integer product matrix D. Does it have any thing to do with witnesses. B D
  • 15. Boolean Product of Matrices 1 0 0 1 0 1 0 1 0 0 2 1 2 0 0 1 0 0 0 1 0 1 1 0 1 2 0 1 0 0 0 0 1 0 0 1 1 1 1 0 1 1 1 1 0 0 1 0 1 0 1 1 1 0 0 1 2 2 0 1 1 1 0 1 0 1 0 0 1 0 2 2 3 0 D 1 A B
  • 16. Boolean Product of Matrices 1 2 3 4 5 ⨯ ⨯ ⨯ ⨯ ⨯ 1 0 0 1 0 1 0 1 0 0 2 1 2 0 0 1 0 0 0 1 0 1 1 0 1 2 0 1 0 0 0 0 1 0 0 1 1 1 1 0 1 1 1 1 0 0 1 0 1 0 1 1 1 0 0 1 2 2 0 1 1 1 0 1 0 1 0 0 1 0 2 2 3 0 D 1 A There is a way to manipulate A so that D will store a witness for all those pairs which have singleton witness. Can you guess ? B
  • 17. Boolean Product of Matrices 1 2 3 4 5 ⨯ ⨯ ⨯ ⨯ ⨯ 1 0 0 1 0 1 0 1 0 0 2 4 2 0 0 1 0 0 0 1 0 1 1 0 1 2 0 1 0 0 0 0 1 0 0 1 1 1 1 0 3 3 3 3 0 0 1 0 1 0 1 1 1 0 0 2 2 2 0 2 1 1 0 1 0 1 0 0 1 0 2 2 3 0 D 2 A B
  • 18. Boolean Product of Matrices 1 2 3 4 5 ⨯ ⨯ ⨯ ⨯ ⨯ 1 0 0 1 0 1 0 1 0 0 5 4 5 0 0 1 0 0 0 1 0 1 1 0 1 6 0 1 0 0 0 0 1 0 0 1 1 1 1 0 3 3 3 3 0 0 1 0 1 0 1 1 1 0 0 2 6 6 0 2 1 1 0 1 0 1 0 0 1 0 5 6 7 0 D 2 A B
  • 19. Algorithm for Computing Singleton Witnesses
  • 21.
  • 22. 1 2 3 4 … n ⨯ ⨯ ⨯ ⨯ ⨯ ⨯ ⨯ ⨯ ⨯ 1 1 0 1 1 0 1 1 1 0 0 1 0 1 1 0 1 1 0 0 A B
  • 23. 1 2 3 4 … n ⨯ ⨯ ⨯ ⨯ ⨯ ⨯ ⨯ ⨯ ⨯ 1 1 0 1 1 0 1 1 1 0 0 1 0 1 1 0 1 1 0 0 A B
  • 24. 1 2 3 4 5 … n-1 n ⨯ ⨯ ⨯ ⨯ ⨯ ⨯ ⨯ ⨯ ⨯ 1 1 0 1 1 0 1 1 1 0 0 1 0 1 1 0 1 1 0 0 A B
  • 25. 0 2 3 0 5 … n-1 0 ⨯ ⨯ ⨯ ⨯ ⨯ ⨯ ⨯ ⨯ ⨯ 1 1 0 1 1 0 1 1 1 0 0 1 0 1 1 0 1 1 0 0 A B
  • 26. No idea! Let us ask the following related but easier question.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32. Conclusion A sketch of the solution for Question 1 was given in the class. The students are encouraged to work out the exact details. The solution will be presented in the beginning of next lecture class.