Randomized algorithm Tutorial 2 Solution for homework 1.

Slides:



Advertisements
Similar presentations
GOAL: IDENTIFY THE DIFFERENCE BETWEEN A DEPENDENT AND AN INDEPENDENT EVENT. Independent and Dependent Events.
Advertisements

Great Theoretical Ideas in Computer Science.
11.6 Geometric Probability
Algebra 1 Ch 2.8 – Probability & Odds.
Data Structures and Algorithms (AT70.02) Comp. Sc. and Inf. Mgmt. Asian Institute of Technology Instructor: Dr. Sumanta Guha Slide Sources: CLRS “Intro.
Random Variables and Expectation. Random Variables A random variable X is a mapping from a sample space S to a target set T, usually N or R. Example:
Section 7.4 (partially). Section Summary Expected Value Linearity of Expectations Independent Random Variables.
Lectures prepared by: Elchanan Mossel Yelena Shvets Introduction to probability Stat 134 FAll 2005 Berkeley Follows Jim Pitman’s book: Probability Section.
1 Discrete Structures & Algorithms Discrete Probability.
Games Game 1 Each pair picks exactly one whole number The lowest unique positive integer wins Game 2: Nim Example: Player A picks 5, Player B picks 6,
Probability And Expected Value ————————————
Math 310 Section 7.2 Probability. Succession of Events So far, our discussion of events have been in terms of a single stage scenario. We might be looking.
Great Theoretical Ideas in Computer Science.
Randomized algorithm Tutorial 1 Hint for homework 1.
The probabilistic method & infinite probability spaces Great Theoretical Ideas In Computer Science Steven Rudich, Anupam GuptaCS Spring 2004 Lecture.
Binomial & Geometric Random Variables
1 Discrete Probability Hsin-Lung Wu Assistant Professor Advanced Algorithms 2008 Fall.
Time for playing games Form pairs You will get a sheet of paper to play games with You will have 12 minutes to play the games and turn them in.
Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x 
Great Theoretical Ideas in Computer Science.
Probability Theory: Counting in Terms of Proportions Great Theoretical Ideas In Computer Science Steven Rudich, Anupam GuptaCS Spring 2004 Lecture.
Warm-up The mean grade on a standardized test is 88 with a standard deviation of 3.4. If the test scores are normally distributed, what is the probability.
Lectures prepared by: Elchanan Mossel Yelena Shvets Introduction to probability Stat 134 FAll 2005 Berkeley Follows Jim Pitman’s book: Probability Section.
Algebra 1 Probability & Odds. Objective  Students will find the probability of an event and the odds of an event.
Great Theoretical Ideas In Computer Science Steven Rudich, Anupam GuptaCS Spring 2004 Lecture 22April 1, 2004Carnegie Mellon University
PROBABILITY AND STATISTICS FOR ENGINEERING Hossein Sameti Department of Computer Engineering Sharif University of Technology Independence and Bernoulli.
Simple Mathematical Facts for Lecture 1. Conditional Probabilities Given an event has occurred, the conditional probability that another event occurs.
Chapter 6 Lesson 6.2 Probability 6.2: Definition of Probability.
IE241 Problems. 1. Three fair coins are tossed in the air. What is the probability of getting 3 heads when they land?
TIMES 3 Technological Integrations in Mathematical Environments and Studies Jacksonville State University 2010.
Learning to Play KardKuro Goals: Have Fun while Practicing Addition and Subtraction. Improve Social Learning Opportunities with Classmates. Become familiar.
Great Theoretical Ideas in Computer Science.
Dependent and Independent Events. Events are said to be independent if the occurrence of one event has no effect on the occurrence of another. For example,
P. STATISTICS LESSON 8.2 ( DAY 1 )
CSCE 411 Design and Analysis of Algorithms Set 9: Randomized Algorithms Prof. Jennifer Welch Fall 2014 CSCE 411, Fall 2014: Set 9 1.
Chapter 5: Probability Analysis of Randomized Algorithms Size is rarely the only property of input that affects run time Worst-case analysis most common.
ENGG 2040C: Probability Models and Applications Andrej Bogdanov Spring Jointly Distributed Random Variables.
Week 21 Conditional Probability Idea – have performed a chance experiment but don’t know the outcome (ω), but have some partial information (event A) about.
Independence and Bernoulli Trials. Sharif University of Technology 2 Independence  A, B independent implies: are also independent. Proof for independence.
COMPSCI 102 Introduction to Discrete Mathematics.
1 Parrondo's Paradox. 2 Two losing games can be combined to make a winning game. Game A: repeatedly flip a biased coin (coin a) that comes up head with.
Expectation. Let X denote a discrete random variable with probability function p(x) (probability density function f(x) if X is continuous) then the expected.
WOULD YOU PLAY THIS GAME? Roll a dice, and win $1000 dollars if you roll a 6.
Chapter 2. Conditional Probability Weiqi Luo ( 骆伟祺 ) School of Data & Computer Science Sun Yat-Sen University :
Binomial Distributions Chapter 5.3 – Probability Distributions and Predictions Mathematics of Data Management (Nelson) MDM 4U.
Lectures prepared by: Elchanan Mossel Yelena Shvets Introduction to probability Stat 134 FAll 2005 Berkeley Follows Jim Pitman’s book: Probability Section.
The Mean of a Discrete Random Variable Lesson
Great Theoretical Ideas in Computer Science for Some.
Tutorial 5: Discrete Probability I Reference: cps102/lecture11.ppt Steve Gu Feb 15, 2008.
Great Theoretical Ideas In Computer Science John LaffertyCS Fall 2006 Lecture 10 Sept. 28, 2006Carnegie Mellon University Classics.
Binomial Distributions Chapter 5.3 – Probability Distributions and Predictions Mathematics of Data Management (Nelson) MDM 4U Authors: Gary Greer (with.
Independent and Dependent Events Lesson 6.6. Getting Started… You roll one die and then flip one coin. What is the probability of : P(3, tails) = 2. P(less.
Bay-yuan Hsu. A i,j is the bin contains i balls and j white balls W i,j is the bin contains i balls and j white balls and the next draw we.
Expected Value and Fair Game S-MD.6 (+) Use probabilities to make fair decisions (e.g., drawing by lots, using a random number generator). S-MD.7 (+) Analyze.
Binomial Distribution. Bernoulli Trials Repeated identical trials are called Bernoulli trials if: 1. There are two possible outcomes for each trial, denoted.
Statistics 11 Understanding Randomness. Example If you had a coin from someone, that they said ended up heads more often than tails, how would you test.
Theory of Computational Complexity Probability and Computing Ryosuke Sasanuma Iwama and Ito lab M1.
Section 7.3. Why we need Bayes?  How to assess the probability that a particular event occurs on the basis of partial evidence.  The probability p(F)
Stat 35b: Introduction to Probability with Applications to Poker Outline for the day: 1.Odds ratio example again. 2.Random variables. 3.cdf, pmf, and density,
Great Theoretical Ideas in Computer Science.
Chapter 7. Section 7.1 Finite probability  In a lottery, players win a large prize when they pick four digits that match, in the correct order, four.
ICS 253: Discrete Structures I
3 Discrete Random Variables and Probability Distributions
Copyright © 2016, 2013, and 2010, Pearson Education, Inc.
Introduction to Discrete Mathematics
Determining the theoretical probability of an event
Conditional Probability
Discrete Probability Chapter 7 With Question/Answer Animations
Probability And Expected Value ————————————
Probability And Expected Value ————————————
Presentation transcript:

Randomized algorithm Tutorial 2 Solution for homework 1

Outline Solutions for homework 1 Negative binomial random variable Paintball game Rope puzzle

Solutions for homework 1

Homework 1-1 :a:a :b:b :c:c :d:d Box 1Box 2 step 1

Homework 1-1 Draw a white ball from Box 2 : event A  Pr(A) = Pr(A∩ (W ∪ B)) = Pr((A∩ W) ∪ (A∩ B)) = Pr(A∩ W) + Pr(B∩ W) = Pr(A|W)Pr(W) + Pr(A|B)Pr(B)

Homework 1-1 It is easy to see that

Homework 1-2 W i = pick a white ball at the i-th time

Homework 1-2

1 b maps 1 a only For b=1, 1.36<a<2.36 means a=2  Pr(W 1 ∩W 2 ) = 2/3 * 1/2= 1/3 Then we may try  b=2 →a=3 →odd  b=4 →a=6 →even

Homework 1-3 By the hint  X = sum is even.  Y = the number of first die is even  Z = the number of second die is odd  Pr(X∩Y) = ¼ = ½ * ½  Pr(X∩Z) = ¼ = ½ * ½  Pr(Y∩Z) = ¼ = ½ * ½  Pr(X∩Y∩Z) =0

Homework 1-4 Let C 1, C 2, …, C k be all possible min- cut sets.

Homework 1-5 i-th pair

Homework 1-5 Indicator variable  Pr(X i ) = 1 if the i-th pair are couple.  Pr(X i ) = 0 Otherwise Linearity of expectation  X= Σ i=1 to 20 X i  E[X] = Σ i=1 to 20 E[X i ] = Σ i=1 to 20 1/20 = 1

Homework 1-6

Homework 1-7 To choose the i-th candidate, we need  i>m  i-th candidate is the best [Event B]  The best of the first i-1 candidates should be in 1 to m. [Event Y]

Homework 1-7 Therefore, the probability that i is the best candidate is The probability of selecting the best one is

Homework 1-7 Consider the curve f(x)=1/x. The area under the curve from x = j-1 to x = j is less than 1/(j-1), but the area from x = j-2 to x = j-1 is larger than 1/(j-1).

Homework 1-7

→g’(m)=0 when m=n/e →g’’(m)<0, g(m) is max when m=n/e

Homework 1-7

Homework 1-8 (bonus) S={±1, ±2, ±3, ±4, ±5, ±6} X={1,-2,3,-4,5,-6} Y={-1,2,-3,4,-5,6} E[X]=-0.5 E[Y]=0.5 E[Z] = -3.5

Negative binomial random variable

Definition  y is said to be negative binomial random variable with parameter r and p if  For example, we want r heads when flipping a coin.

Negative binomial random variable Let z=y-r

Negative binomial random variable Let r=1 Isn’t it familiar?

Negative binomial random variable Suppose the rule of meichu game has been changed. The one who win three games first would be the champion. Let p be the probability for NTHU to win each game, 0<p<1.

Negative binomial random variable Let the event We know

Negative binomial random variable where Hence

Negative binomial random variable Given that NTHU has already won the first game. What is the probability of NTHU being the champion?

Paintball game

You James Bond, and Robin Hood decide to play a paintball game. The rules are as follows  Everyone attack another in an order.  Anyone who get “hit” should quit.  The survival is the winner.  You can choose shoot into air.

Paintball game  James Bond is good at using gun, he can hit with probability 100%.  Robin Hood is a bowman, he can hit with probability 60%.  You are an ordinary person, can only hit with probability 30%.  The order of shot is you, Robin Hood then James Bonds.

Paintball game What is your best strategy of first shoot? Please calculate each player’s probability of winning.

Rope puzzle

We have three ropes with equal length (Obviously, there are 6 endpoint). Now we randomly choose 2 endpoints and tied them together. Repeat it until every endpoint are tied.

Rope puzzle There can be three cases Which case has higher probability?