Percentage of cases they will contradict where atleast one of them is correct - probability

Braden and Fred are two independent journalists. Braden is usually correct in 33% of his reports and Fred in 70% of his reports. In what percentage of cases are they likely to contradict each other, talking about the same incident where at least one of them is correct.
Is this question supposed to solved with probability?

This is indeed supposed to be solved with probability.
There are 4 cases
Braden is right and Fred is right
Braden is right and Fred is wrong
Braden is wrong and Fred is right
Braden is wrong and Fred is wrong
We also know that the probability of two unrelated events both happening is equal to the product of the probabilities of the events:
From this, we can see that the probability of the first case is equal to the probability that Braden is right, multiplied by the probability that Fred is right
Using this logic on all four cases, we get the following probabilities:
Since we are only interested in the cases where they contradict each other, we can simply sum the probability of those two cases.
From that, we can see that the probability of the two contradicting each other is 17/30, or 57%

Related

calculate the Probability: What is the probability that no one makes the right decision?

I'm trying to solve an exercise from the stochastic project. Is anybody already done such exercises?
Consider a jury trial in which it takes 9 of the 12 jurors to convict the defendant; that is, in order for the defendant to be convicted, at least 8 of the jurors must vote him guilty. If we assume that jurors act independently and that, whether or not the defendant is guilty, each makes the right decision with probability θ (here could be 0.75 or 0.80), what is the probability that the jury renders a correct decision?
the questions are:
1) How many jurors making the right decision can be expected? 2) What is the probability that no one makes the right decision?
Thanks!
BR
Tony
How many jurors making the right decision can be expected?
It's 12*θ
What is the probability that no one makes the right decision?
It's (1-θ)^12

independent times to ensure minimum cut of graph at least one trial succeeds

I just finished with the first module in the algo specialization course in coursera.
There was an exam question that i could not quite understand. I have passed that exam, so there's no point for me to retake it.
Out of curiosity, I want to learn the principles around this question.
The question was posted as such:
Suppose that a randomized algorithm succeeds (e.g., correctly computes
the minimum cut of a graph) with probability p (with 0 < p < 1). Let ϵ
be a small positive number (less than 1).
How many independent times do you need to run the algorithm to ensure
that, with probability at least 1−ϵ, at least one trial succeeds?
The options given were:
log(1−p)/logϵ
log(p)/logϵ
logϵ/log(p)
logϵ/log(1−p)
I made two attempts and both were wrong. My attempts were:
log(1−p)/logϵ
logϵ/log(1−p)
It's not so much I want to know the right answer. I want to learn the principles behind this question and what it's asking for. So that I know how to answer similar questions in future.
I have posted this on the forum, but nobody answered after a month. So I am trying it out here.
NO need to post the answer directly. If you got me to get to aha moment, i will mark it as correct.
Thanks.
How many independent times do you need to run the algorithm to ensure that, with probability at least 1−ϵ, at least one trial succeeds?
Let's rephrase it a bit:
What is the smallest number of independent trials such that the probability of all of them failing is less than or equal to ϵ?
By the definition of independent events, the probability of all of them occurring is the product of their individual probabilities. Since the probability of one trial failing is (1-p), the probability of n trials failing is (1-p)^n.
This gives us an inequality for n:
(1-p)^n <= ϵ

Metropolis algorithm to solve a problem

I need to implement the metropolis algorithm to solve the example titled Cheating among students here. In summary the aim is to estimate the frequency of students cheating in an exam. The experiment is as follows:
Each student is asked to toss a coin. If the result is heads then student will answer honestly if he/she cheated. If the result is tails the student will toss a second coin and answer "yes, I cheated" if it lands heads and "no, I didn't" if it lands tails.
The experiment involved $N=100$ trials and the interviewer got $X=35$ "yes" answers.
I need to find the frequency of cheating using a raw implementation of the metropolis algorithm. To that end I have identified the following variables in the experiment:
$FC \sim Bernoulli(\theta=0.5)$. The probability distribution for the first coin.
$SC \sim Bernoulli(\theta=0.5)$. The probability distribution for the second coin.
$TA \sim Bernoulli(\theta=P)$. The probability of a true answer. That is, a student honestly answering.
At this point is where I start to get lost. I think $P$ is the probability that I am interested in when using metropolis. However, it depends on the two other probabilities $FC$ and $SC$. Moreover, I would say it depends on a new random variable $Z = FC \cdot TA + (1-FC)\cdot SC$ that depends on the two others.
My first question is: Am I right until this point in my reasoning?. If so,
from what I understand, metropolis proposes a value at each iteration. The probability of this value is computed taking into account the distributions listed above. So, does that mean that at each point I have to evaluate the probability of the proposed value according to $Z$?.

Course assignment algorithm

I need to assign n people to m courses, where each person specified their first and second preference and each course has a maximum number of persons attending. Each person can only attend one course. The algorithm should find one solution where
the number of people assigned one course out of their preference is maximized
the number of people assigned their first choice is maximized (taking into account 1 which is of higher priority).
I guessed that this is not an uncommon problem but a search returned nothing too useful, therefore I decided to roll my own. This is what I came up so far:
For courses which have less first preferences than maximum numbers of people attending, assign all those persons to the course
For other courses: Put random people into the course which have selected this course as first choice until the course is full
For courses which have less second preferences than free spaces, assign all those persons to the course
For other courses: Put random people into the course which have selected this course as second choice until the course is full
For each person without a course: At their first (then second) preference look out for a person which has chosen another course where spots are still free (if more than one is found take the one which has chosen the course with most free spots), move this person to their second choice and assign the missing person
I still don't think this algorithm will find the optimal solution to the problem due to the last step. Any ideas how to make this one better? Are there other algorithm which solve this problem?
Place everyone in their first choice course if possible.
If there is anyone who didn't get it, place them in their second choice.
Now, we might get some who didn't get any of their choices. (the "losers".)
Find a person who got his first choice course, which is also the second choice of the "loser". This guy will be reassigned to his second choice, while the "loser" takes his slot. If there is no such person, then your problem is unsolvable.
Note that this maximizes the number of people who got their first choice:
If you got your second choice, then it means either:
someone else already got your first choice as his first choice
someone else got your first choice as his second choice, but only because his first choice was taken as someone else's second choice, and whose first choice was filled with first choice students.
(Possibly that last bit is a bit hard to follow, so here's a rewording:)
For person X with first choice A and second choice B:
If X got choice B, then:
Y took X's slot in A, and Y's first choice is A.
Y took X's slot in A, and Y's second choice is A. Y's first choice is C, but C's slots are all filled with other students whose first choice is C as well.
This is similar to the stable marriage problem.
Given n men and n women, where
each person has ranked all members of
the opposite sex with a unique number
between 1 and n in order of
preference, marry the men and women
together such that there are no two
people of opposite sex who would both
rather have each other than their
current partners. If there are no such
people, all the marriages are
"stable".
Update:
Taking #bdares comments into account, and the fact that the courses have a finite capacity it would be hard to cast the problem as stable matching.
I would solve this as a linear program with the objective function based on the number of people who get their first choice and the course size as a constraint.
The first problem can be modeled as a maximum cardinality bipartite matching problem. The second problem can be modeled as a weighted bipartite matching problem (also known as the assignment problem).
Sounds like a linear bottleneck assignment problem. While you in the wiki page, check out the link provided in the reference section.

How do you determine the best, worse and average case complexity of a problem generated with random dice rolls?

There is a picture book with 100 pages. If dice are rolled randomly to select one of the pages and subsequently rerolled in order to search for a certain picture in the book -- how do I determine the best, worst and average case complexity of this problem?
Proposed answer:
best case: picture is found on the first dice roll
worst case: picture is found on 100th dice roll or picture does not exist
average case: picture is found after 50 dice rolls (= 100 / 2)
Assumption: incorrect pictures are searched at most one time
Given your description of the problem, I don't think your assumption (that incorrect pictures are only "searched" once) sounds right. If you don't make that assumption, then the answer is as shown below. You'll see the answers are somewhat different from what you proposed.
It is possible that you could be successful on the first attempt. Therefore, the first answer is 1.
If you were unlucky, you could keep rolling the wrong number forever. So the second answer is infinity.
The third question is less obvious.
What is the average number of rolls? You need to be familiar with the Geometric Distribution: the number of trials needed to get a single success.
Define p as the probability for a successful trial; p=0.01.
Let Pr(x = k) be the probability that the first successful trial being the k th. Then we're going to have to have (k-1) failures and one success. So Pr(x=k) = (1-p)^(k-1) * p. Verify that this is the "probability mass function" on the wiki page (left column).
The mean of the geometric distribution is 1/p, which is therefore 100. This is the average number of rolls required to find the specific picture.
(Note: We need to consider 1 as the lowest possible value, rather than 0, so use the left hand column of the table on the Wikipedia page.)
To analyze this, think about what the best, worst and average cases actually are. You need to answer three questions to find those three cases:
What is the fewest number of rolls to find the desired page?
What is the largest number of rolls to find the desired page?
What is the average number of rolls to find the desired page?
Once you find the first two, the third should be less tricky. If you need asymptotic notation as opposed to just the number of rolls, think about how the answers to each question change if you change the number of pages in the book (e.g. 200 pages vs 100 pages vs 50 pages).
The worst case is not the page found after 100 dice rolls. That would be is your dice always returned different numbers. The worst case is that you never find the page (the way you stated the problem).
The average case is not average of the best and worst cases, fortunately.
The average case is:
1 * (probability of finding page on the first dice roll)
+ 2 * (probability of finding page on the second dice roll)
+ ...
And yes, the sum is infinite, since in thinking about the worst case we determined that you may have an arbitrarily large number of dice rolls. It doesn't mean that it can't be computed (it could mean that, but it doesn't have to).
The probability of finding the page on the first try is 1/100. What's the probability of finding it on the second dice roll?
You're almost there, but (1 + 2 + ... + 100)/100 isn't 50.
It might help to observe that your random selection method is equivalent to randomly shuffling the whole deck and then searching it in order for your target. Each position is equally likely, so the average is straightforward to calculate. Except of course that you aren't doing all that work up front, just as much as is needed to generate each random number and access the corresponding element.
Note that if your book were stored as a linked list, then the cost of moving from each randomly-selected page to the next selection depends on how far apart they are, which will complicate the analysis quite a lot. You don't actually state that you have constant-time access, and it's possibly debatable whether a "real book" provides that or not.
For that matter, there's more than one way to choose random numbers without repeats, and not all of them have the same running time.
So, you'd need more detail in order to analyse the algorithm in terms of anything other than "number of pages visited".

Resources