You need to use the conditional given the first choice, so here is how it goes in R:
# The assigned probabilities
pr <- c(0.375,0.30,0.15,0.1,0.05,0.025)
# Choose the first person:
one <- (1:6)[which( rmultinom( 1, 1, pr )==1 )]
# Choose the second among the remaining
two <- (1:5)[which( rmultinom( 1, 1, pr[-one] )==1 )]
# Shown the numbers of those chosen - note that "two" is the
# number of the second chosen among the *remaining* 5, hence the
# indexing hazzle:
c( one, (1:6)[-one][two] )
Best regards,
Bendix Carstensen
From: A UK-based worldwide e-mail broadcast system mailing list [mailto:[log in to unmask]] On Behalf Of Dorothy Middleton
Sent: 30. juli 2013 16:33
To: [log in to unmask]
Subject: Re: simple but confusing
Yes; it is obvious.
-------- Original Message --------
Subject: simple but confusing
From: Rodrigo_Briceño <[log in to unmask]>
Date: Mon, July 29, 2013 9:55 am
To: [log in to unmask]
Hello friends. Sometimes you look an exercise and it seems so simple that you start to have doubts. This is the case I will describe here. I am writing the exercise and what I actually though. Any help is welcome.
On a particular week the office boss needs that 2 employees work 3 extra hours each day of the weekend, in order to finish an urgent job. There are 6 available employees. The office boss prefers not to choose himself the 2 employees (to avoid suspicion of favoritisms) and instead uses a random method. Having in mind that the 6 employees have different years of service, he tells them that he will assign probabilities to each one, proportionally to the years of service. The assigment of probabilities is:
Jaime, 30 years of service, 0.375 prob.
Luis, 24 years of service, 0.30 prob.
Graciela, 12 years of service, 0.15 prob.
Mireya, 8 years of service, 0.10 prob.
Mauricio, 4 years of service, 0.05 prob.
Marcela, 2 years of service, 0.025
a. Design a method to randomly select (without replacement) the 2 employees in order to respect the previous probabilities.
b. What is the probability that Graciela and Mauricio are the two chosen employees.
I have a conceptual doubt regarding if the choosing of employees should be considered an union or an intersection.
Regarding the method I though the following:
a. put 80 balls on a bag
b. each employee will have a number of balls named in relation to the years of service (so Jaime will have 30 balls for example).
c. the without replacement condition make me thinks if I have to quit all balls related to one employee after selecting him/her.
The second question: not sure if it is a conditional probability like P(Graciela)*P(Mauricio/Graciela) or instead a union is required...
Any thoughts?
--
Rodrigo Briceño
Economist
[log in to unmask]
SKYPE: rbriceno1087
You may leave the list at any time by sending the command
SIGNOFF allstat
to [log in to unmask], leaving the subject line blank.
You may leave the list at any time by sending the command
SIGNOFF allstat
to [log in to unmask], leaving the subject line blank.
You may leave the list at any time by sending the command
SIGNOFF allstat
to [log in to unmask], leaving the subject line blank.
|