BIOS 600 - Spring 2026
Lab 2 Due Friday January 23, at 11:59pm
HW 1 Due Tuesday, January 27 at 11:59pm
Starting a new Quarto document
New header
New chunk, running a chunk
Setting message and warning to false when reading in data or loading a package.
install.packages() vs. library(): Baking analogy!
Running code in Console vs. in your quarto document
Questions?
How do we come up with these probabilities?
Before we answer that question, a little bit of history…
Frequentist (classical) and Bayesian schools of thought
Historical analogy: Imagine a medieval coin maker who wants to prove that his coin is fair. He flips the coin thousands of times. If it lands on heads about half the time, he concludes it’s a fair coin.
This approach reflects long-run frequencies—the probability is defined by the frequency of an event (heads) occurring in many repeated trials.
Now, consider a knight deciding whether to trust the coin maker’s fairness. Even after seeing just a few flips, the knight forms a degree of belief about the coin’s fairness, adjusting this belief with more evidence.
This reflects the Bayesian interpretation—probability as a measure of belief or certainty about an event, updated as new information becomes available.
Each one is useful, just depends on context
Frequentist: Most helpful when you have large sample sizes and repeated trials. Typically used in settings where you rely on long-run frequencies, such as in hypothesis testing and confidence intervals (more on these later).
Bayesian: More useful when prior information or expert opinion is available, or when working with smaller sample sizes. Often applied in settings where you need to update probabilities as new data becomes available.
Setting: Consider a clinical trial for a new drug.
In large-scale randomized controlled trials (RCTs) to test a new drug’s efficacy, a frequentist approach is often more suitable.
This is because you rely on the law of large numbers (more on this in a few lectures!), where results become more reliable with repeated trials.
Frequentist methods like hypothesis testing and confidence intervals help establish the drug’s effectiveness based purely on the data without incorporating prior beliefs.
Setting: Diagnostic testing with prior information
When evaluating a rare disease using diagnostic tests, a Bayesian approach might be more useful.
If prior knowledge or expert opinion suggests a very low prevalence of the disease, this information can be incorporated into the analysis.
As new test results come in, the Bayesian method allows you to update the probability of a patient having the disease, leading to more nuanced decision-making, especially with small sample sizes or uncertain data.
Mathematical objects that model random experiments, real-world processes involving states that occur randomly
A probability space consists of three components:
A sample space, the set of all possible outcomes
Subsets of the sample space, called events, which comprise any number of possible outcomes (including none of them!)
A function that assigns probabilities to events
An event occurs if the outcome of the random experiment is contained in that event.
Sample spaces depend on the random experiment in question
Tossing a single fair coin
Tossing two fair coins
Sum of rolling two fair six-sided dice
Survival (years) after cancer diagnosis
Exercise
Events: Subsets of the sample space that comprise possible outcomes. Essentially, these are all the ‘plausibly reasonable’ events we’re interested in calculating probabilities for*:
*Note: there is some complicated math involved in calculating this. Don’t worry about it for now!
A number describing the likelihood of each event’s occurrence. This maps events to a number between 0 and 1, inclusive:
Tossing a single fair coin
Tossing two fair coins
Sum of rolling two fair six-sided dice
Survival (years) after cancer diagnosis
For the first three, you would probably intuit your way through using a discrete probability distribution (more on this in a few lectures)
For the last one, by making some assumptions on the survival process, we can use similar probability tools to arrive at an answer. (But it’s still complicated!)
Remember, events are subsets of the entire sample space. Let’s take for now the example of tossing a single fair coin and recording the outcome.
There are only two elements in the outcome space:
We can define the simple events of just \(A\) or \(B\) occurring, but are there “other” events we can define?
Sets can be related to each other in different ways. For two sets (or events) \(A\) and \(B\), the most common relationships are:
Two sets \(A\) and \(B\) are said to be disjoint if \(A \cap B = \emptyset\)
What are the intersection, union, complement, and difference of events \(A\) (getting a head) and \(B\) (a tail) as applied to our coin-toss example? Are the two events \(A\) and \(B\) disjoint?
What are the probabilities assigned to those events:
Komolgorov axioms
The probability of any event in the sample space is a non-negative real number (could be zero!)
The probability of the entire sample space is 1
If \(A\) and \(B\) are disjoint events (mutually exclusive), then the probability of \(A\) or \(B\) occurring is the sum of the individual probabilities that they occur
For two events \(A\) and \(B\) with probabilities \(P(A)\) and \(P(B)\) of occurring, the Kolmogorov axioms give us two important rules:
Question
How do we extend inclusion-exclusion to more than two events?
Questions
How do we interpret these in plain English?
How do we extend DeMorgan’s laws to more than two events?
| Coffee drinking | Died? Yes | Died? No | Total |
|---|---|---|---|
| None | 1039 | 5438 | 6477 |
| Med-Low | 4440 | 29712 | 29809 |
| High | 3601 | 24934 | 28535 |
| Total | 9080 | 60084 | 64821 |
What was the probability that a randomly selected person in the trial..
… did not drink coffee?
… died during the study or did not drink coffee?
…did not die during the study and was a high coffee drinker?
Name +
How was class today? OR
Artistic rendition of how class was today / something you learned today
