Tag: science

  • Hypothesis Testing Part 3: Bringing it All Together

    Hypothesis Testing Part 3: Bringing it All Together

    So now that we know what sampling distributions are, we can better understand the mathematical ideas behind hypothesis testing. The basics of hypothesis testing is you want to prove something about the population (a population parameter) by assuming something about it, and seeing if you get sample data that is unlikely based on that original assumption. If you can calculate that the sample data that you actually have is unlikely assuming what you have assumed is true in the population, then you can say that what you’ve assumed is true in the population is not likely to be true. This assumption about the population is called the null hypothesis. The good news is that now that we know a lot about sampling distributions, we can calculate the probability of getting sample data with certain sample statistics based on population parameters. Let’s look at this in more detail.

    Hypothesis Test on a Population’s Mean

    One application of hypothesis testing is coming to a conclusion as to whether or not a population’s mean is a certain value. So let’s look at a scenario. Let’s say you work as a biologist and the long standing knowledge in the field is that the average length of this species of frog is 5 inches. Based on your experience in the field studying these frogs, you think that they are longer, on average, than 5 inches. How do you challenge the long standing claim of an average length of 5 inches? This is a perfect situation for hypothesis testing. If we are able to gather enough evidence that would be very unlikely to exist assuming that the assertion of the null hypothesis is true, we can conclude that the assertion of the null hypothesis is not true. So let’s look at how this will play out.

    First, we identify our null and alternative hypotheses. The null hypothesis is the established truth that you are hoping to find evidence against. The alternative hypothesis is what you’re trying to find evidence to support, because you think it is true in reality. So for this situation with the average lengths of frogs, our hypotheses would be:

    Basically, we’re assuming that the null hypothesis is true the whole time. So the next step would be to gather evidence. How do we gather evidence in this situation? It comes from sample data. So we would gather a sample of frogs and measure the average length of frogs in that sample. In this sample, we need to make sure that we satisfy the conditions needed to use the details of the sampling distribution of sample means. Remember, these conditions are: the sample needs to be a simple random sample, the sample size can’t be 10% or more of the population size, and the distribution of frog lengths in the population either needs to be normally distributed or the sample size must be at least 30 so that the central limit theorem can be applied for normality of sample means. Let’s say that we took a sample with these qualities, and these are the summary statistics:

    So let’s look at these sample statistics in a little bit of detail. As you can see, we took a simple random sample of 40 frogs, and the average height of those 40 frogs was 6 inches. Does this provide evidence that you’re right? That the true average height of all frogs in the population is more than 5 inches? Yes. If you’re thinking that this provides good evidence that the true mean of frog lengths is more than 5 inches because you think to yourself, “we have a sample of 40 frogs whose mean is 6 inches. That would probably be unlikely to happen if the true mean in the population was only 5 inches. That’s why this is strong evidence that the true mean length of frogs in the population is more than 5 inches”, then you’re thinking like a statistician. That’s the exact logic that we’re going to use here. However, the issue with that logic is the phrasing, “that would probably be unlikely if the population mean was only 5 inches”. And that’s the whole issue with this data. Is a sample mean of 6 inches from a sample of size of 40 really that unlikely if the true mean is only 5 inches?

    First, let’s realize that it is theoretically possible to get a sample of 40 frogs with a mean length of 6 inches. When we say that we are assuming the true mean length of the population of frogs is 5 inches in the null hypothesis, we are not saying that they are all 5 inches. If the population mean is 5 inches, some of the frogs will be longer than that. Some will be shorter than that. Is it possible that we got a simple random sample, and just due to random chance, we happened to get a sample of 40 that were longer than average? In other words, is it still possible that the population of frogs has a mean length of 5 inches, but we still get a sample of 40 frogs with a mean length of 6 inches? Yes, it’s definitely possible that happened.

    So now that we can agree that this sample is possible to occur even if the true mean length of frogs in the population is as low as 5 inches, you may counter with, “So it is possible that this could happen, but it would be very unlikely. I would think that if you take a sample of 40 things, the average of those 40 would be closer to the true average. So if the true mean of lengths in the population is only 5 inches, we should have gotten a sample of 40 with a sample mean very close to 5. Since 6 is not very close to 5, we can still say that this is very unlikely.” Well, there’s a flaw in this reasoning as well. You are claiming that 6 is too far away from 5 without directly considering the parameter that determines the far-ness of random variables from the mean. I’m of course referring to the standard deviation. If you claim that 6 is very far away from 5, maybe it is and maybe it isn’t. It all depends on the standard deviation of the distribution. If the standard deviation of the lengths of frogs is large, then it is more likely that you get lengths that are further from the mean. So what counts as far from the mean is really the number of standard deviations the value is from the mean. This idea should sound familiar. It’s called a z-score. So in other words, you can’t make a claim that 6 inches is too far away from the expected value of 5 inches without taking into consideration the inherent variability of the population distribution.

    So if we go back to what we learned in the previous post about sampling distributions, we can actually tie this all together and not just do some hand-waving explanation of what is likely or unlikely. We can instead calculate the likelihood of the sample data looking as severe as it does (or even worse) based on the assumption of the true population mean using the details of the sampling distribution of means.

    Remember from the previous discussion that the sampling distribution of sample means of a certain size can be approximated with a t-distribution if the true standard deviation of the population is not known. That will normally be the case. So if we only have the sample data, we will use the sample standard deviation as a best approximation to the population standard deviation. Under this condition, the best distribution to use for the sampling distribution of means is the t-distribution. So we just convert our sample mean of 6 into the corresponding t-statistic. We can then calculate the probability that this t-statistic is as far from its mean of 0 or further to the right. This will correspond with the probability that our sample mean is 6 or larger. This is that probability that we keep looking for. And this probability has a name. It’s called a p-value. You can see that if we have a small p-value, that is evidence for the alternative hypothesis since that literally means the probability that you would get a sample with the details that you did or even more extreme assuming the null hypothesis is true. Another way to think of this is that a low p-value means an unexpected result based on the assumption of the null hypothesis. The following figure outlines this whole process and the math involved:

    So as you can see, our intuition was right. It turns out that the probability of getting a sample of size 40 with a mean 6 inches if the population mean of frog lengths was really only 5 inches is incredibly unlikely. How unlikely? That’s what our p-value tells us. But, remember that it depends on the variability of the data which we accounted for in our analysis. So using sampling distributions, we don’t have to guess at how likely or unlikely our data is based on the assumption of the population distribution. We can actually calculate it and therefore defend our conclusion.

    Now this was an extensive discussion for a hypothesis test on a single population’s mean. All other hypothesis tests have the same sets of steps. The details of the conditions that have to be met, the distribution of the test statistic that you use, and some of the other steps may be a little different, but the flow of the logic and how you support you final conclusion are all based on the same idea. If you understand what a hypothesis test is really well one time, you can apply that logic to any other hypothesis test. The videos at the end of this lesson delve into other examples of hypothesis testing.

  • Hypothesis Testing Part 2: Sampling Distributions

    Hypothesis Testing Part 2: Sampling Distributions

    Remember, hypothesis testing works by assuming a value of a population parameter (the null hypothesis) and calculating how likely you are to see your associated sample statistic (or an even more severe value given by your alternative hypothesis) on any given sample. So let’s say we have a sample statistic like a mean or proportion. How do we calculate the likelihood or probability that we would observe a sample statistic this severe or more? It all comes down to the details of the relevant sampling distribution.

    What is a Sampling Distribution?

    A sampling distribution is a type of probability distribution that arises in the situation where you are trying to determine the probability of a sample statistic having a specific value or range of values. So for instance, let’s say we want to answer the question, “What is the probability that any given sample of n from a population has a sample average of x‾\bar{x} or more?” There is a way to figure this out if you know the details of the distribution in the population that the sample comes from, or if certain conditions are met with the sample.

    So let’s focus on a sampling distribution for a specific sample statistic. Let’s start by talking about the sampling distribution for sample means of a certain sample size nn from a population. First of all, let’s understand that a sample mean from a specific population is itself a random variable. If you have a population of people whose heights follow a specific probability distribution, an individual random person’s height is a random variable since it can be various values with a different associated probability for each value. We can call this variable that represents a random person’s height xx. But what about a sample mean from a sample of 40 people? Well that is also a random variable. If you take a simple random sample of 40 people from this population and measure their heights, and find the average height in that sample, is it perfectly predictable? No. But, as we shall see an average of 40 people’s heights from this population is much more predictable than any individual person’s height, meaning it has a much lower variance or standard deviation.

    But what does the distribution of sample means from a sample of size nn look like, and what characteristics does it have (like mean and standard deviation)? It turns out that if certain conditions are met, the probability distribution of sample means of samples of size nn is approximately normal with a mean of μ\mu and a standard deviation of σn\frac{\sigma}{\sqrt{n}} where σ\sigma is the standard deviation of the variable xx in the population distribution of xx. In other words, if we were to take a sample of size nn from a population that has some randomly distributed variable, we can calculate the probability of the sample having a sample mean above some value or between two values by any method you normally use to find the probability that a Normally distributed variable obtains a specific range of values (think of z-scores and normcdf on your calculator and all that jazz).

    Let’s look at the parameters of this sampling distribution of means in a little more detail. The mean of the sample means is the mean of the random variable in the population. So if we had a population of people and the height of a random person can be treated as a continuous random variable, the population has a certain mean height of μ\mu. That is, the average of all the heights in the population is μ\mu. What is the average value of all sample means of a specific sample size nn? It’s also μ\mu. In other words, the mean of the sample means is the mean of the random variable in the population. Another way to phrase this is, “the average of all the averages is the average.” This shouldn’t be a particularly shocking result. What is much more interesting is what the standard deviation ends up being.

    First, let’s discuss what we’d expect. What do you think is more predictable: the height of a single random person from the population, or the average of 50 random persons’ heights from the population? It shouldn’t take too much explaining to see that the average of 50 people would be more predictable. Why? Because rare events start to average out with a bigger sample size. Is it fairly likely to obtain a single person with a weird height? It’s probably not that unlikely. But if you get one weird height (by weird, I mean a height in a low probability interval of heights) out of 50, will that make the average that unpredictable? No, that one weird height will get averaged into the other 49, and as long as you don’t have many weird heights in that one sample, the average will not be that different than the true average in the population. Even two or three weird heights probably wouldn’t change the average of 50 that much from being around the true average. In other words, in samples, the sample average is more predictable than any single random element from the population. This is reflected in the standard deviation of sample means (σx‾\sigma_{\bar{x}}). If the standard deviation of the random variable in the population is σ\sigma, then the standard deviation of the sampling distribution of sample means has a standard deviation of σn\frac{\sigma}{\sqrt{n}}. So if you look at the math, the larger the sample size, the smaller the standard deviation of the sampling distribution of means. And if a random variable has a small standard deviation, then that means the values are, on average, not very far from the mean. Therefore, the values of the variable are more predictable. They are all huddled around the mean.

    So now that we’ve given an example of what a sampling distribution is, we’ll look at the details of some common sampling distributions.

    Sampling Distribution of a Single Population’s Sample Means

    This is what we’ve already been looking at in the previous example. It turns out that if certain conditions are met, the sample mean of a sample of size nn behaves as a random variable, meaning it can take on different values at varying probabilities. The original population distribution and the parameters (like mean and standard deviation) allow us to predict the probabilities of what the various sample means can be. But this predictive power is only true if certain conditions are met. So what are those conditions?

    Condition 1: The sample has to be a simple random sample

    This condition will need to be met for most probability and inferential statistics questions. Basically, in order for the probability distributions we have to mean anything, we can’t introduce any type of bias or change the probabilities in any way. If we do, we can’t use the same probability distributions.

    Condition 2: The sample size cannot be small

    Why can the sample size not be too small? If the sample size is too small, we can’t assume that the sampling distribution of means is normally distributed (or basically predictable in any way). We would only be able to proceed if we knew that the distribution of the original variable in the population follows a normal distribution. If the sample size is not too small, the variable that represents the sample means can not be assumed to be normally distributed. For means, that magic number is 30. If the sample size is at least 30, the central limit theorem shows us that the sample average will follow a normal distribution.

    Condition 3: The sample size cannot be too big

    One of the assumptions built into the math that we are going to use to analyze sampling distributions is that the elements in the sample are independent of one another. This would definitely be true if we were sampling with replacement. However, when sampling, you typically don’t sample with replacement. But if the population is large compared to the sample size, the probabilities are not very different from sampling with replacement. Therefore, the sample elements can be treated as if they were sampled with replacement. The magic number for this condition is 10%. If the sample size is less than 10% of the population size, the probabilities don’t change that much as you sample, and the elements in your sample can be treated as if they were sampled with replacement (independent).

    If these conditions are met, the sampling distribution of means can be modeled as a normal distribution with the following parameters:

    As you’ll see later, one of the main reasons you learn about sampling distributions is to test predictions about population parameters. In those situations, you rarely know the population standard deviation. As you can see in the above formula, you need to know the population standard deviation to determine the sampling distribution standard deviation and then calculate probabilities. When the population standard deviation is not known, you use the next best thing: the sample standard deviation. In the formula above, you just replace the population standard deviation with the sample standard deviation. Then, the distribution of normalized sample means follows a t-distribution with n−1n-1 degrees of freedom.

    Therefore, when the population standard deviation is not known, the normalized sample mean random variable can be modeled as:

    Sampling Distribution of the Difference of Two Sample Means from Two Different Populations

    Now it turns out that a linear combination of sample means from two (or more for that matter) populations also follows a normal distribution. Where this will show up later in hypothesis tests is when you are interested in the value of the difference between two means between two different populations. So that’s what we will focus on here: the sampling distribution of the difference between two sample means. So what conditions for inference need to be met? The same conditions for a single sample mean, but you have to check it for both samples. If both samples meet those conditions for means that we discussed in the previous paragraphs, then the difference in sample means can be modeled as a Normal Distribution with the following parameters:

    Just like before with the discussion of the sample mean sampling distribution, the standard deviations in the population are rarely known. Therefore, we just replace the standard deviations of the population with the next best thing: the sample standard deviations. Once we do this, the normalized variable follows the t-distribution:

    Be aware that this notation means the degrees of freedom is the minimum of the two degrees of freedom from the two samples.

    Sampling Distribution of a Single Population’s Sample Proportions

    This distribution arises when you are taking samples of a certain size and you are trying to predict the proportion of observational units within the sample that take on the value of a certain variable. That variable would have to be a binary categorical variable (it’s a categorical variable with either a success or failure level). So it turns out that if certain conditions are met, the sample statistic p_hat can be modeled as a random variable with a probability distribution approximated by a normal distribution. What are those conditions? Well two of the conditions are the same as they were for means. That is, the sample size can not be too big or it will violate the assumption of independent sampling, and the sample must be from random sampling. The last condition is the same as well, in that the sample size can’t be too small. However, what counts as “too small” is different for proportions.

    Condition 2: The sample size cannot be too small

    This number is different because it doesn’t work on the same principle of the Central Limit Theorem which is used for means. For proportions, the sampling distribution of sample proportions can only be modeled by a Normal Distribution because it actually follows a linear transformation of a Binomial Distribution, but a Binomial Distribution can be approximated as a Normal Distribution if the sample size is large enough. This is the golden number that determines if the sample size is large enough for a sampling distribution of sample proportions can be modeled as a Normal Distribution. npnp and n(1−p)n(1-p) have to both be at least 10. So as you can see, you can get away with taking a relatively small sample if the proportions of success and failure of the variable in the population are both relatively big (around 50%). However, if either the probability of success or failure is very small (the other would then be very big), you will need a larger sample size so that those products of sample size and proportions are both at least 10.

    Sampling Distribution of the Difference Between Two Sample Proportions from Two Different Populations

    Just like the sampling distribution of the difference between two sample means is just an extension of the sampling distribution of a single mean, the sampling distribution of a linear combination of two sample proportions is just an extension of the sampling distribution of a single proportion. So all the conditions that must be true for a single sample proportion for its sampling distribution to be approximated with a normal distribution must also be true for both samples when we are determining the sampling distribution of a linear combination of sample proportions. Just like for a linear combination of means, we are most interested in specifically the difference between two population proportions. So that is what we will focus on here. If all the conditions discussed previously for proportions are met for both samples, the difference between to sample proportions can be modeled as a Normal Distribution with the following parameters:

    What’s the Point?

    The point of all of this discussion of sampling distributions is so that we can determine probabilities that sample statistics (means, proportions, or differences of these between two samples) take on certain ranges of values. For instance, if you knew the probability of or the proportion of people in a population who are left-handed, and the conditions for inference of a sample proportion as we discussed earlier are met, we can calculate the probability of getting a sample proportion of left-handed people greater than a certain amount by using the details of the normal distribution that it follows. The following video instructions will make this more clear.

    However, the real point of all of this (as far as you’re concerned in this class) is that we can use these ideas of sampling distributions to indirectly test certain assumptions about the population distribution parameters. This process of testing certain values of population parameters using sample data and corresponding sample statistics and their corresponding sampling distributions is called Hypothesis Testing. We’ll explain how that all works in the next blog post.

  • Sequences and Series: The Basics

    Sequences and Series: The Basics

    What are Sequences and Series?

    Sequences and series are topics covered near the end of a Calculus 2 class, but show up in all kinds of situations. Let’s discuss what these two concepts mean in a little bit of detail. A sequence is just an ordered list of numbers or terms. For instance, the following would be considered a sequence:

    {1,3,5,7,9,11,13}\{1, 3, 5, 7, 9, 11, 13 \}

    In this sequence, the numbers in the sequence can be thought of as the output from a function, or the y-values. So what are the x-values? The x-values are the positions that the numbers take in the sequence. Looking back at the previous sequence, we can see that the 3rd number in the sequence is a 5. Therefore, you can think of this sequence as a function where it takes an input of 3 and produces an output of 5. The “position” we keep referring to is called an “index”.

    Many sequences of interest can be written as a mathematical expression that illustrates how the index becomes the sequence value (exactly how most functions are written as mathematical equations that detail how each input in the domain becomes each output in the range). Let’s try to come up with the mathematical relationship that maps the indices to the terms in the sequence. If you notice, the terms in the sequence are just the odd integers from 1 up to 13. So what mathematical expression, if any, would turn 1 into 1, 2 into 3, 3 into 5, 4 into 7, and so on? Well first, let’s pretend that the numbers in the sequence were the even integers. How would we turn 1 into 2, 2 into 4, 3 into 6, and so on? That’s a much easier relationship. You just double the index, and now you have the even integers. So how do we get the odd integers? Easy, just subtract 1 after you double the indices. This can be summarized in the following equation:

    an={2n−1}n=17a_n = \{2n-1\}_{n=1}^{7}

    This means that we have a sequence with the formula inside the curly brackets with an index that starts at 1 and ends at 7. In other words, we have 7 terms in our sequence (1 through 7) and to get the number at the nth index, you do the math inside the curly brackets. So how is this different from the function:

    f(x)=2x−11≤x≤7f(x) = 2x – 1 \quad 1 \leq x \leq 7

    These look like they’re saying the same thing to me. Well, they’re not because it really comes down to the difference between the variable nn and the variable xx. Remember that the variable n represents the index. That means that it represents the place that the associated term takes in the ordered list of terms that make up the series. So the “domain” of a series can only ever be integers since they represent the position of the terms in the list. However, the variable x is assumed to be a continuous variable. Therefore, in the previous function, x can take any value from 1 to 7 including decimals and fractions and anything else you can think of. This would be clear from the graphs of the sequence vs. the corresponding function. The graph of the sequence would only consist of 7 points. There would be a point at (1, 1), (2, 3), (3, 5), and so on, but there would be nothing in between since there is no index or position in the list of numbers between 1 and 2 or 2 and 3 and so on. The graph of the corresponding function would consist of a solid curve (a line in this case) defined by the function 2x−12x-1. But the curve would go through all the same points defined by the sequence if you think of the values of n as x-values and the sequence values as y-values. So in a lot of ways, sequences are like functions with the condition that the input variable can only be integers within a certain domain.

    In a Calculus 2 class, you’ll be mostly interested in sequences that have infinite terms. So the ordered list of terms or numbers is infinitely long without end. In this situation, we would be interested to know if the sequence converges or diverges. In this context, that just means that the numbers or terms that form the sequence start to approach a single value or term as you proceed infinitely down the list of numbers. This should sound familiar. I’m describing a limit. Therefore, to determine whether or not a sequence ana_n converges, we just need to find the value of the following limit:

    limn→∞⁡an\lim_{n \rightarrow \infty} a_n

    If this limit has a value, then the sequence converges. If this limit does not have a value (either because the value of the limit is ±∞\pm \infty or the values in the limit do not go to a specific number as you go infinitely far down the positions in the sequence), we would say that the sequence diverges. That’s all you have to know when it comes to sequences. Whether or not they converge or diverge only comes down to the value of the limit and whether or not it exists. One concept or idea that you will need to brush up on is how to evaluate limits at infinity.

    So we’ve been talking a lot about sequences so far and haven’t discussed anything about series yet. Are they the same thing? No. They’re similar, but they’re not the same. In fact, a series is just the sum of the terms in a sequence. That’s it. If you have a sequence and you add all the terms in the sequence together, you now have the corresponding series. With series, we’ll primarily be interested in those series that come from the summation of an infinite sequence. To determine whether a series converges or diverges, we’ll need to determine whether the sum of an infinite number of things adds up to a single number or if it does not. This is a much more difficult question to try and answer. There are many different convergence and divergence tests that are designed to determine whether or not a series converges. Just like solving an integral requires knowing certain integration techniques and when to use them, determining whether a series converges or not requires knowing certain convergence and divergence tests and when to use them.

    Some Basic Types of Series and Convergence/Divergence Tests

    For the rest of this blog post, we’ll look at some qualities and behaviors of series, discuss some common series you should know, and finally introduce some of the simplest convergence and divergence tests for series. First, let’s dive into the apparent contradiction of an infinite series. For an infinite series, we’re interested in whether it converges or not. This means we are interested in whether you get a specific number when you add up an infinite number of numbers. Why do we even need convergence and divergence tests for series? It seems like they would never converge, right? How in the world can you add up an infinite number of numbers and not get infinity or negative infinity? The answer is if the terms eventually become zero or if they shrink towards zero at a certain rate as you progress down the sequence of numbers your adding, the sum can be a finite amount. You’ve actually seen this before. In the context of the definite integral, we saw that you can add up an infinite number of things (rectangular slices of the region bounded by a curve) as long as the terms get smaller at a certain rate with the number of things that you’re adding.

    Nth Term Divergence Test

    So that actually brings us to our first type of convergence/divergence test. It is called the Nth Term Test for Divergence. This test is basically mathematically equivalent to the only convergence/divergence test we needed for sequences:

    limn→∞⁡an\lim_{n \rightarrow \infty} a_n

    For a sequence, the result of this limit tells us whether or not the terms in the sequence eventually tend toward a certain value or not as you progress infinitely far down the ordered list of terms. So how is this useful information for the infinite sum ∑n=1∞an\sum_{n=1}^{\infty} a_n? Well, what this limit literally tells us is what the numbers in the list of numbers we’re adding together start to become as you go infinitely far down the list. What would these numbers have to eventually converge to if the infinite sum has even a chance of converging? The answer is 0. If the infinite sum of numbers has even the slightest chance of adding up to a finite amount, the terms in the sequence would eventually have to start to become infinitesimally close to 0. That’s the basic idea of the Nth Term Test for Divergence. So what we can conclude is that if the numbers in the infinite sequence that we’re adding together to form the infinite series (or sum) DO NOT eventually get infinitesimally close to 0, then the series has no chance of converging, and we can conclude that it diverges.

    Let’s look at what this Nth Term Test for Divergence is saying. Basically, it says that if the terms in the series do not eventually get indistinguishably close to zero, we can conclude that the series diverges. This should make perfect sense. What would happen if you added up an infinitely long list of numbers (an infinite sequence), and the numbers in the list don’t become super close to 0? Then the sum would either add up to infinity or negative infinity, or the sum would not add up to anything specific. Either way, the series would not sum to a single finite amount. But let’s look at the other result. What if the numbers in the sequence your summing to form the series do eventually get down infinitesimally close to 0? Well that sounds like the series would have to converge since you’re eventually adding 0 over and over again forever, right? At this point our simple logic is starting to break down. We’ll prove this later, but for right now, just take my word for it that just because the numbers do eventually get down infinitesimally close to 0, that may not be enough. If the terms do eventually get down infinitesimally close to 0, you need to analyze the rate at which they get down close to 0. If you want to understand how it is possible for a series with terms whose limit as n approaches infinity is zero to not converge, think of a corresponding improper integral with an infinite upper bound for the limit of integration. If the function your integrating eventually gets down infinitesimally close to 0, that means the height of the region whose area you’re finding with that integral is getting infinitesimally close to 0. Doesn’t that mean that the area has to be a finite amount? Well, calculate the following integral, and you’ll see that just because the function that defines the height of the region eventually becomes infinitesimally small, that doesn’t mean that the area of the bounded region converges:

    A=∫1∞1x  dxA= \int_{1}^{\infty} \frac{1}{x} \ \ dx

    In fact, if you can make the connection between infinite series and their corresponding improper integrals, you can better understand the next convergence/divergence test that you’ll probably learn in class called The Integral Test. We’ll talk about that in a later post.

    Partial Sums

    One way that we can determine whether a series converges or diverges is to convert it to a sequence of partial sums and investigate if that sequence converges or not. Partial sums are just a running total of the total sum as you add one term to the previous term. These are generally denoted as sns_n.

    For the series

    ∑n=1∞an\sum_{n=1}^{\infty} a_n

    We can show the partial sums as

    sm=∑n=1mans_m = \sum_{n=1}^{m} a_n
    sm=a1+a2+a3+a4+⋯+am−1+ams_m = a_1+a_2+a_3+a_4+ \dots +a_{m-1}+a_m

    In other words, the mth partial sum sms_m is just the first “m” terms in the corresponding sequence added together. Let’s look at some of the math involved and how these partial sums reveal what’s going on with the infinite series. First, we should notice that the m+1st partial sum sm+1s_{m+1} is just the mth partial sum sms_m plus the next term in the series am+1a_{m+1}.

    sm=a1+a2+a3+a4+⋯+am−1+ams_m = a_1+a_2+a_3+a_4+ \dots +a_{m-1}+a_m
    sm+1=a1+a2+a3+a4+⋯+am−1+am+am+1s_{m+1} = a_1+a_2+a_3+a_4+ \dots +a_{m-1}+a_m+a_{m+1}
    sm+1−sm=am+1s_{m+1}-s_m = a_{m+1}
    sm+1=sm+am+1s_{m+1}=s_m + a_{m+1}

    So if we define a new sequence {sm}\{ s_m \} where sm=∑n=1mans_m = \sum_{n=1}^{m} a_n or the mth partial sum, the result of the convergence of this SEQUENCE of partial sums would be the result of the convergence of the corresponding infinite SERIES. So if we can come up with a formula for the mth partial sum of a series, we could then determine the convergence or divergence of that corresponding sequence of partial sums and determine if the series converges or diverges. This brings us to two specific types of series for which you can determine a formula for the corresponding sequence of partial sums.

    Telescoping Series

    A telescoping series is a series in which most of the terms end up adding up to zero such that a large sum can really be calculated by adding only a small number of the total terms. Something that “telescopes” in real life is like the hydraulic cylinder in the following picture. It is composed of concentric tubes that can extend out to form one long tube, or these concentric tubes can be collapsed down to a smaller form:

    If I could rename what a Telescoping Series is, I may rename it to a Collapsible Series because that’s really the behavior these types of series exhibit that make them interesting. Let’s see what this type of series looks like in action. Take the following series:

    ∑n=1∞(1n−1n+1)\sum_{n=1}^{\infty}\left( \frac{1}{n} – \frac{1}{n+1} \right)

    Let’s now take a look at the partial sums:

    s1=∑n=11(1n−1n+1)=11−12s_1 = \sum_{n=1}^{1}\left( \frac{1}{n} – \frac{1}{n+1} \right) = \frac{1}{1} – \frac{1}{2}
    s2=∑n=12(1n−1n+1)=s1+12−13=11−13s_2 = \sum_{n=1}^{2}\left( \frac{1}{n} – \frac{1}{n+1} \right) = s_1 + \frac{1}{2} – \frac{1}{3}= \frac{1}{1} – \frac{1}{3}
    s3=∑n=13(1n−1n+1)=s2+13−14=11−14s_3 = \sum_{n=1}^{3}\left( \frac{1}{n} – \frac{1}{n+1} \right) = s_2 + \frac{1}{3} – \frac{1}{4}= \frac{1}{1} – \frac{1}{4}
    s4=∑n=14(1n−1n+1)=s3+14−15=11−15s_4 = \sum_{n=1}^{4}\left( \frac{1}{n} – \frac{1}{n+1} \right) = s_3 + \frac{1}{4} – \frac{1}{5}= \frac{1}{1} – \frac{1}{5}

    Notice a pattern yet? What if I asked you to write out the formula for the mth partial sum sms_m?

    sm=∑n=1m(1n−1n+1)=11−1m+1s_m = \sum_{n=1}^{m}\left( \frac{1}{n} – \frac{1}{n+1} \right) = \frac{1}{1} – \frac{1}{m+1}

    The pattern is that there is always the first positive term that remains and there is one negative term that remains at the end. So now we have a formula to find the mth partial sum. What can we do with that? We can determine the convergence of the infinite sequence of partial sums to determine the convergence of the corresponding series. So now we’re back to analyzing a sequence. We just have to investigate the limit as m approaches infinity:

    limm→∞⁡11−1m+1=1−0=1\lim_{m \rightarrow \infty} \frac{1}{1}-\frac{1}{m+1} = 1-0 =1

    Therefore, we now know that this telescopic series converges to 1 because the sequence of partial sums converges to 1.

    Geometric Series

    A geometric series is another type of series where we’re able to come up with a formula for the sequence of partial sums. But what even is a geometric series? Geometric series are related to exponential functions. In a geometric series, the next term that you add to the previous partial sum to get the new partial sum is always the same number multiplied to the previous term:

    an+1=r⋅ana_{n+1} = r \cdot a_n

    This multiplier is called the common ratio “r”. This is similar to an exponential function where every time you increase x by 1, the new function value is the the same number times the function value before it:

    f(x)=rxf(x) = r^x
    f(x+1)=r(x+1)=rx⋅r1=r⋅rxf(x+1) = r^{(x+1)} = r^x \cdot r^1 = r \cdot r^x

    Therefore:

    f(x+1)=r⋅f(x)f(x+1) = r \cdot f(x)

    Because of this behavior, a geometric series can be written in this general form:

    ∑n=1∞a1⋅rn−1\sum_{n=1}^{\infty}a_1 \cdot r^{n-1}

    From this relationship, the following properties can be derived for a geometric series. Hopefully, proofs for these properties were offered in class or in your notes. If not, we can go through them in a later post. But for now, take my word that the following is true:

    So now let’s see this in action with an example of a geometric series. Let’s take the series:

    ∑n=1∞15⋅4n12n+3\sum_{n=1}^{\infty} 15\cdot \frac{4^n}{12^{n+3}}

    Now this doesn’t look like the exact form of a geometric series that we discussed before (∑n=1∞a1⋅rn−1\sum_{n=1}^{\infty}a_1 \cdot r^{n-1}). However, if every next term in the sequence of numbers is the same multiplier of the previous term, then it is geometric no matter what the formula looks like. Let’s see how we can determine this.

    r=an+1an=15⋅4n+112(n+1)+315⋅4n12n+3=15⋅4n+1⋅12n+315⋅4n⋅12n+4=412=13r = \frac{a_{n+1}}{a_n}=\frac{15\cdot \frac{4^{n+1}}{12^{(n+1)+3}}}{15\cdot \frac{4^n}{12^{n+3}}}= \frac{15 \cdot 4^{n+1} \cdot 12^{n+3}}{15 \cdot 4^n \cdot 12^{n+4}} = \frac{4}{12} = \frac{1}{3}

    Now do you see that we took an arbitrary term an+1a_{n+1} and divided it by the previous term ana_n without specifying what n is, and it still ended up where all the n’s divided out? Because we found that the value of any term divided by the previous term without specifying which specific term we’re referring to reduces to a constant ratio (13\frac{1}{3} in this case), this proves that the series is geometric. So not only do we now know that this series is a geometric series, we can also determine if it is convergent or not because we determined the value of the common ratio in the process of determining whether or not it was geometric, and the convergence or divergence of a geometric series only depends on the value of this common ratio. So we just ask ourselves, is the absolute value of the common ratio less than 1 or is it greater than or equal to 1? Since 13\frac{1}{3} is less than 1, we know that this geometric series will converge.

    But we can do better than that. Remember, for a geometric series (like a telescoping series), we actually have a formula for the partial sums. We therefore know that because the series converges, it will specifically converge to a11−r\frac{a_1}{1-r}. We know rr, but do we know a1a_1? Well, if you try to compare our geometric series with the formula for a geometric series that lists out a1a_1, you’d be tempted to say that a1a_1 is probably 15, right? Well it’s actually not. And the reason why is because what a1a_1 really represents is the first term in the geometric series. In our geometric series, I can tell you that the first term is not 15. So what is it? We can figure it out by just substituting 1 in for n and that will produce the value of a1a_1.

    a1=15⋅41121+3=15⋅412⋅123=153⋅123=51728a_1 = 15\cdot \frac{4^1}{12^{1+3}} = 15 \cdot \frac{4}{12 \cdot 12^3} = \frac{15}{3 \cdot 12^3} = \frac{5}{1728}

    Therefore, the actual sum of the series ∑n=1∞15⋅4n12n+3\sum_{n=1}^{\infty} 15\cdot \frac{4^n}{12^{n+3}} is 517281−13\frac{\frac{5}{1728}}{1-\frac{1}{3}} which simplifies to 51152\frac{5}{1152}.

    Summary

    In summary, a sequence is an ordered list of numbers which you can think of like a function. What you input is the position of the number in the list, and what you get out of the function is the number that goes in that position. To determine whether or not a sequence converges, there is only one test. You determine the limit of the function that defines the sequence as the value of the index goes to infinity. If this limit exists, the sequence converges to that value. If the limit does not exist, the sequence diverges.

    Series are much more complicated. A series is the sum of a sequence. A series converges if the sum of the infinite sequence it represents is a single finite amount. If the sum of the infinite sequence is not a single finite amount (either because it’s not a single determinant amount, or if it’s not finite), then the series diverges. But to prove if an infinite sum converges or not requires you to be much more clever. There are lots of different convergence and divergence tests for series. The most basic one we talked about in this post is the Nth Term Test for Divergence which operates on a simple principle. If the terms in the sequence that form the series never approach 0, then the sum cannot be a specific finite amount. However, if the terms in the sequence that form the series do approach 0, that leads to an inconclusive result. The series could converge or diverge still.

    By looking at the sequence of partial sums, we can determine if the infinite sum is approaching a single value or not. We discussed two types of series for which you can determine a formula for their partial sums: a telescoping series and a geometric series. By understanding what these two series are and how they behave, we can easily determine whether or not they converge and what they converge too. This is a very important distinction between these types of series and most of the other series that you come across. For most series, you will not be able to determine what they converge to specifically. You will only be able to determine whether or not the series converges at all.

  • Your Best Friend: The Unit Circle Part 1

    Your Best Friend: The Unit Circle Part 1

    What is The Unit Circle?

    The unit circle is a clever visual tool that can be used to analyze various aspects of trigonometry. First of all, it’s a circle. And while you may be most familiar with thinking of trigonometric functions in the context of right triangles, they can actually be thought of as parts of a circle. One of the limitations of thinking of trigonometric ratios solely from the perspective of right triangles is that the angles on a right triangle are restricted to be between zero and ninety degrees (0 to pi radians). However, the trigonometric functions are defined well outside this domain. Thinking of the trigonometric functions in the context of a circle allows you to analyze trigonometric relationships for any angle. Also, the definitions of the trigonometric functions in the context of right triangles naturally extends to their analysis as being part of a circle. In other words, you don’t have to relearn anything you know about trigonometry and right triangles to make sense of the unit circle approach to trigonometry. You just have to be able to expand your view to accommodate more possibilities. Everything you know about trigonometry using right triangles is still true on the unit circle. The unit circle just extends this analysis even further. What we’ll talk about in this article is specifically how to map your knowledge of trigonometry using right triangles onto the unit circle in order to take advantage of its greater capabilities in understanding trigonometry.

    The “unit” part of the unit circle has a specific meaning. Typically, any time you hear or see the word “unit” in the context of mathematics, it means 1. For instance, in more advanced math using vectors, you’ll hear the term “unit vector” which means a vector with a length of 1. So what about the unit circle is 1? Its radius is 1. As we’ll see when we’re mapping our right triangles onto the unit circle, the hypotenuses of these right triangles will be the same length of the radius of the circle.

    To analyze the trigonometry on a unit circle, the x and y coordinates of the points on (and sometimes off) of the circle are important. Therefore, this unit circle doesn’t mean anything without a relevant coordinate system. The location of the unit circle in the x-y plane is such that its center is at the origin. So to summarize, the unit circle is a circle with radius 1 centered at the origin of the x-y plane.

    How does the unit circle work in explaining trigonometric functions?

    The basic principles allowing the unit circle to be used for analysis of trigonometric functions are few and simple. Here they are:

    1. Angles are measured from the positive x-axis. Counter-clockwise rotations are positive angle changes. Clockwise rotations are negative angle changes.
    2. The x-value of a point on the circle is equivalent to cosine of the angle formed by the radius that extends out to that point and the positive x-axis
    3. The y-value of a point of the circle is equivalent to sine of the angle formed by the radius that extends out to that point and the positive x-axis

    This can be shown with a simple diagram:

    From these simple basic principles (along with all the analytical trigonometry you know), the unit circle can be used to analyze complicated problems involving trigonometry.

    Basic Trends that Emerge from the Unit Circle

    Because the x values of the points on the unit circle are the values of cosine of the corresponding angle and the y values of the points on the circle are the values of sine of the corresponding angle, we can see pretty easily the quadrants in which cosine and sine are negative and positive. This is summarized in the following figure:

    This all comes from the idea that cos⁡θ\cos{\theta} is x and sin⁡θ\sin{\theta} is y. In the first quadrant, cos⁡θ\cos{\theta} and sin⁡θ\sin{\theta} are both positive. Why? Because x and y are both positive in the first quadrant. In the second quadrant, cos⁡θ\cos{\theta} is negative and sin⁡θ\sin{\theta} is positive. Why? Because x is negative and y is positive in the second quadrant.

    Knowing the signs of sin⁡θ\sin{\theta} and cos⁡θ\cos{\theta} at different angles allows you to immediately determine the signs of the other 4 trigonometric functions for that value of θ\theta. For instance, we know from the reciprocal identities that tan⁡θ=sin⁡θcos⁡θ\tan{\theta} = \frac{\sin{\theta}}{\cos{\theta}}. Therefore, we know that any angle where sin⁡θ\sin{\theta} and cos⁡θ\cos{\theta} have the same sign, tan⁡θ\tan{\theta} will be positive (the first and third quadrants). And any angle where signs of sin⁡θ\sin{\theta} and cos⁡θ\cos{\theta} have different signs, tan⁡θ\tan{\theta} will be negative (second and fourth quadrants).

    Some other trends that we should notice is how the two functions sin⁡θ\sin{\theta} and cos⁡θ\cos{\theta} change as the angle θ\theta changes. We can determine this at a general level by just looking at the unit circle. Let’s start by looking at a specific angle. Let’s look at θ=0∘or0radians\theta = 0 ^ {\circ} \: \text{or} \: 0 \, \text{radians}. This corresponds to the point on the following diagram of the unit circle.

    Now we need to just ask ourselves, as θ\theta increases (we rotate counterclockwise from this point), what happens to the x and y values on the circle? Well, you should notice that the x value doesn’t change that much when you change the value of θ\theta a little bit. However, the value of y changes a lot when you change the value of θ\theta a little bit. So around the value 0∘or0radians0^{\circ} \, \text{or} \, 0 \, \text{radians}, cos⁡θ\cos{\theta} changes very slowly and sin⁡θ\sin{\theta} changes relatively quickly.

    But how are the functions changing when it comes to their values? Well we can look at the unit circle again and determine the answer. As we rotate around circle counterclockwise, the value of cos⁡θ\cos{\theta} decreases from its maximum value of 1 (the x value of the points on the unit circle decrease from the maximum value of 1), and the value of sin⁡θ\sin{\theta} increases from 0 (the y value of the points on the unit circle increase from their value of 0). Once we hit the angle of π2or90∘\frac{\pi}{2} \, \text{or} \, 90^\circ, the trend changes a little bit. Now we’re at the top of the circle and the value of cos⁡θ\cos{\theta} or x is changing fast (we’re basically moving horizontally for a moment at the top of the circle) and the value of sin⁡θ\sin{\theta} or y is changing slowly (again, because we’re basically moving horizontally, the y-values don’t change very quickly). Also, let’s again look at how their values are actually changing. cos⁡θ\cos{\theta} is still decreasing (as you rotate around the counterclockwise direction at the top of the circle, the x-values are still decreasing) and it actually becomes negative, and sin⁡θ\sin{\theta} actually starts decreasing as well from a maximum value of 1 (the y-values are at their largest, and start to decrease from 1 as you continue to rotate around the circle). We can continue to analyze these trends around the circle. This will be very useful when we look at how to determine the wave graphs of sin⁡θandcos⁡θ\sin{\theta} \, \text{and} \, \cos{\theta} later.

    What specific values are you supposed to know on the unit circle?

    So this is the main reason you need to know the unit circle. Other than the trends and behavior that the unit circle reveals about trigonometric functions, there are specific values of cos⁡θ\cos{\theta} and sin⁡θ\sin{\theta} (x and y) that you need to know for specific angles. Here is the full annotated unit circle with all of the values you need to know. At first, it looks daunting. But we’ll see in a moment that you only really need to know a few of these points and angles in order to be able to figure out the rest due to some of the symmetries that exist in circles.

    So these are all of the angles and points you need to know on the unit circle. It seems pretty daunting at first, but there are actually quite a few patterns we can observe. In fact, you only need to know the angles and ordered pairs in the first quadrant. From there, you can take advantage of all the symmetries of the circle to fully annotate all four quadrants. So let’s just look in depth at the first quadrant. Which angles do we need to know? From the diagram that includes the angles, we can see that we need to know the values of sin⁡θ\sin{\theta} and cos⁡θ\cos{\theta} for 0∘0^\circ, 30∘30^\circ, 45∘45^\circ, 60∘60^\circ, and 90∘90^\circ. You just need to memorize the angles. One way to remember these angles is to realize they account for the 90∘90^\circ that forms the first quadrant broken up into thirds (0∘0^\circ, 30∘30^\circ, 60∘60^\circ, and 90∘90^\circ) and halves (0∘0^\circ, 45∘45^\circ, and 90∘90^\circ).

    Now how do we remember the values of x and y (and therefore cosine and sine) for these angle values? There is actually a nice pattern that emerges in the numbers. Don’t ask me why this pattern exists. I have no idea why this interesting pattern emerges. It’s just something I’ve noticed that can help you remember the values you need to know in the first quadrant. First think of all of the values of x and y on the circle as square root of something divided by 2. You can see what I mean in the following figure:

    Now, let’s start filling these in. Inside every square root goes either a 0, 1, 2, 3, or 4. Let’s start with the point at angle 0 radians (the point that’s on the x-axis). What goes inside the square roots for the x and y? In the x-value, we’ll need to put a 4 inside the square root, and for the y-value, we’ll need to put a 0 inside the square root. But how does this make sense? Well, what is the x-value at that point? It should be 1. Remember, this is the unit circle centered at the origin with a radius of 1. Therefore, that point that is one full radius in the x-direction from the center would have an x-value of 1 plus the x-value of the center of the circle. Because the x-value of the center of the circle is 0, the x-value of this point is 1. So why did we put in 4? It’s because that’s inside a square root. The square root of 4 is 2, and 2 divided by 2 gives us the ultimate x-value of 1 that we know that needs to be. So that’s why the x-value of this point is 42\frac{\sqrt{4}}{2}. Now what about the y-value? Well, that’s obviously 0 at this point. It’s the same y-value as the center of the circle because we didn’t move up or down from the center. We just moved left or right. So what do we need to put inside the square root to make the total value 0? That would be 0 because 02=0\frac{\sqrt{0}}{2} = 0. So let’s put these points in the first quadrant of the unit circle.

    So now that we have the “first point” set, the pattern that emerges is that we just lower the value of the number inside the square root for the x-values by 1 at each new point as we rotate counter clockwise, and we just raise the value of the number inside the square root for the y-values by 1 at each new point as we rotate counter clockwise.

    Now let’s just simplify these values:

    So now we have the entire first quadrant filled out. How do we get the x and y values (cos⁡θ and sin⁡θ\cos{\theta} \ \text{and} \ \sin{\theta}) for all the other points on the circle? Well, we can take advantage of the symmetry of the circle and notice that all of the other points are just transformations of the points we already have. Let’s take a look at the second quadrant. Theses are all the same x and y values, but the x values are negative because it’s like we’ve flipped the second quadrant across the y-axis without moving up or down. That causes the x-values of the points to be the opposite sign.

    Now we have all of the points in the first and second quadrant. How do we get the rest of the points in the third and fourth quadrant? Well we can notice that due to the symmetry of the circle, the points on the bottom half (the third and fourth quadrants) are reflections of the points in the top half across the x-axis. This transformation just keeps all the x-values the same, but negates all of the y-values.

    Now we have the full unit circle filled out with all of the important points labeled. This was all based on a simple pattern that we notice in the first quadrant and the fact that the other quadrants are the same points as the first quadrant just reflected across the different axes. We can now use this information to answer questions and solve problems involving trigonometry. We’ll look at that in the next blog post.

    Summary

    In summary, the unit circle is a useful tool to visualize the trigonometric functions sin⁡θ\sin{\theta} and cos⁡θ\cos{\theta} and their behaviors as the angle θ\theta changes. The unit circle is a circle centered at the origin with a radius of 1. In this context, the angle θ\theta is defined as the angle created from an initial side on the positive x-axis where positive values of θ\theta are created by rotating counter clockwise, and negative values are created by rotating clockwise from the positive x-axis. On the unit circle, the x-coordinate is cos⁡θ\cos{\theta} and the y-coordinate is sin⁡θ\sin{\theta}. Taking advantage of various symmetries of the circle, we can transpose and transform points around to find the values of cos⁡θ\cos{\theta} and sin⁡θ\sin{\theta} for various angles.

  • Everything You’d Ever Want to Know About the Binomial Distribution

    Everything You’d Ever Want to Know About the Binomial Distribution

    What is the Binomial Distribution?

    The Binomial Probability Distribution is a type of probability distribution that can be described by a probability mass function. Remember that a probability mass function describes the probability of discrete random variables. Therefore, a variable that can be described by the Binomial Probability Distribution is a discrete random variable. This means that it can only take on discrete values (like heads or tails on a coin or the outcomes 1, 2, 3, 4, 5, or 6 on a roll of a die) rather than continuous values (like the length of a table leg produced in a factory which can take on any value across a range of potential values, even decimals like 23.125444234 inches). The Binomial Distribution itself and its corresponding probability mass function are used to calculate the probability of a certain number of successes happening within a certain number of repeated trials of an experiment. Some examples where the Binomial Distribution would be appropriate include:

    • If you flip a coin 50 times, what is the probability that you would get 12 heads (you need to interpret this as “what is the probability that you would get EXACTLY 12 heads”)?
    • In a large population of people (millions of people), the prevalence of a disease is 5%. What is the probability that in a random sample of 100 people, 10 people would have the disease (you need to interpret this as “what is the probability that EXACTLY 10 people would have the disease”)?
    • You work for an airline. You know from previous data that approximately 1/500 people who buy a ticket don’t end up using their plane ticket due to illness or being late and missing the flight. For a flight containing 100 seats, you sell 102 tickets. What is the probability that you have to kick at least 1 person off the flight?

    What makes all of these questions or situations solvable using the Binomial Distribution? There are a few qualities. Number one, we are interested in finding the probability that a number of “successes” occur within a number of repetitions of experimental “trials”. In the coin flip example, a head could be considered a success (we are interested in the probability of 12 heads), and the coin flips themselves would be considered repeated trials (we flip the coin a total of 50 times).

    Number two, the outcomes of each of the trials is dichotomous, meaning each trial results in a success or a failure (one of only two possible outcomes). In the disease problem mentioned in the previous paragraph, the individual trials would be each person selected. What are the two possible outcomes for each person? They either have the disease (a success) or they don’t (a failure).

    Number three, the trials must be independent and identically distributed. What does this mean? Well, independent means that the results of one trial don’t affect the probability of the outcomes of any other trial. A good example of this is the coin flip example. If I flip a coin one time (let’s say the first time of the 50 in the problem above) and it ends up heads, does the probability that the next flip of the coin will be heads change from what I thought it would be before I realized the first flip was heads? It shouldn’t, because once I pick up the coin and flip it again, the fact that it was heads already wouldn’t affect the probability that the next flip will be heads or tails. Once you flip it the second time, the probability just resets.

    Another example where the trials would be independent would be sampling with replacement. Let’s say you have a box that contains 20 red marbles and 30 blue marbles.

    Now before I select the first marble blindly from the box, the probability that I will select a red marble is 20/50, and the probability that I will select a blue marble is 30/50. Let’s say that I mix up the marbles and select one blindly, and when I look at it, it’s one of the red marbles. From this point, I can do one of two things. I can write down that I picked a red marble, place it back in the box, reshuffle everything and pick a new marble.

    Now what’s the probability that the next marble is red? It’s back to 20/50 because I put the red marble that I pulled out first back into the box so that there are 20 red marbles out of 50 total marbles. These trials (pulling a marble from the box) are independent because knowing that the first marble is red doesn’t affect the probability that the next one will be red (or blue, for that matter). Once I put the red marble back and remixed the marbles in the box, the probability is back to what it was originally.

    However, what if I don’t replace the marble? If I draw a marble and keep it out of the box, and then draw another marble, does knowing the color of the first marble affect the probability of drawing a certain color on the second draw? Absolutely. Let’s see why.

    If I drew a red marble on the first draw and left it out, what’s the probability that the next draw will also be red? It’s not 20/50 anymore because there aren’t 20 red marbles to pick, and there aren’t 50 marbles to pick from. There are only 19 red marbles and 49 total marbles. So if the first marble picked is red, the probability the second one is red is 19/49. But if the first marble is blue, the probability that the second marble is red is not 19/49. If you pick a blue marble first and leave it out of the box for the second draw, you still have 20 red marbles because you haven’t picked one yet, but you still have one marble missing from the original 50. Therefore, your chances of drawing a red on the second draw knowing you drew a blue on the first draw is now 20/49. Because the results of the first trial affect the probabilities of the outcomes in the second trial, these trials are not independent when we sample or draw marbles without replacement. For the Binomial Distribution to be applied, the individual trials MUST BE INDEPENDENT OF ONE ANOTHER!

    But what does it mean for the trials to be identically distributed? That just means that the probabilities of the outcomes for each of the trials is the exact same. Here’s an example of a series of trials where the probabilities of the outcomes are not all the same. Let’s say that you have a six-sided die that has one of the faces of the die with a picture of a coin’s head, and the other 5 faces of the die have a picture of a coin’s tails. So when you roll this die, you don’t get a number 1-6. Instead, you get either a head or a tail. Now let’s say that I want to know the probability of getting 4 heads when I flip a coin 7 times, roll this special die 1 time, and then flip the coin another 2 times. This would be 10 trials: 9 by flipping a coin, and 1 by rolling the die with head or tails outcomes.

    These trials are all independent. The flips of the coin don’t affect each other, and they don’t affect the outcome of the six-sided die. Likewise, the results of the six-sided die don’t affect the coin flips. Sounds good, right? It does, however, these trials are not identically distributed. The trials involving the coin are, but the single trial (the 8th one) where I’ve decided to determine heads or tails by rolling the die changes the distribution of the outcomes in that trial. The probability of heads is no longer ½ like it was in the coin trials. It’s ⅙ for the die. Therefore, even though the trials are independent (knowing the result of one trial doesn’t change the probability of any other trial), they are not identically distributed. Therefore, this situation couldn’t be modeled by the Binomial Distribution.

    So to summarize, the conditions that must be met to model a variable with the Binomial Distribution are:

    1. Repeated trials of an experiment where the outcomes of each trial are dichotomous: success or failure. If there are three or more possible outcomes from a trial, it can’t be modeled by a Binomial Distribution.
    2. The trials themselves are independent and identically distributed. If the results of one trial change the probabilities of the outcomes in a different trial, they are not independent. If the probability distribution for the outcomes are not all the same for each trial, they are not all identically distributed. If either of these things (independence and identical distributions) are not satisfied, it can’t be modeled by a Binomial Distribution.
    3. You are interested in finding the probability of a certain “x” number of successes within “n” number of trials that meet the above criteria – trials that meet this criteria are called Bernoulli trials.

    What Math Defines the Binomial Probability Distribution Mass Function?

    The probability mass function (the function that reports out the probability associated with a value of the variable) is:

    So to determine the probability that X takes on a specific value in a process that can be modeled with a Binomial Distribution, you just substitute the value of X in for x in the function and the number you get out is the probability that X is that value in the Binomial process. Now all of these numbers parameters actually mean something. Let’s review some interesting properties of the Binomial Distribution that arise because the results of the individual trials are dichotomous. First of all, the number of successes and failures must add up to the total number of trials. Why? Because those are the only two things that can happen. So if I tell you there were x successes in n trials, then how many failures were there? Let’s do a little bit of math. We know:

    Therefore,

    And as you can see, the number of failures is the number of total trials minus the number of successes. This is because the sum of the successes and failures must add to the total number of trials. What else comes about in the math because of the dichotomous nature of the individual trials? The probability of a failure is one minus the probability of a success. Let’s see why by looking at the details of a single trial and remembering what we know about basic probability theory. We know in each individual trial that there are only two possible outcomes: success or failure. We also know that these are individual discrete outcomes, meaning the chances of them both happening (probability of any individual trial having a success AND a failure) is zero. Therefore, we know that we could add their individual probabilities to equal to the total probability of 1.

    We can rearrange this algebraically to see that the probability of a failure is one minus the probability of a success:

    So the probabilities raised to their powers in the binomial probability mass function just represent the probabilities of successes and failures raised to the power of the number of times a success or failure appears in the trials and then multiplied together. We’ll see in a little bit where that comes from.

    But what about that big coefficient at the beginning. That is called a Combination. You can read it as “combinations of n taken x at a time” or “n choose x”. This can be interpreted two ways (and probably more). “n choose x” is the number of ways that you can take “n” number of things and group them into a group of size “x”. Another way to think of this number (which is the way that we’ll want to interpret it for it to make sense in the context of the binomial distribution) is “n choose x” represents the number of reorderings of “x” identical items in a sequence of “n” total things. Let’s discuss what this really means with an example. If I have 10 total marbles in a sequence that consist of 4 red marbles and, therefore, 6 blue marbles, and we want to know how many different reorderings of these marbles we can have, we would calculate 10 choose 4. You’ll also notice that we could have approached it as the number of ways the 6 blue marbles can be reordered within the 10 total spaces in the sequence. That would be 10 choose 6. If you look at the math, 10 choose 4 and 10 choose 6 are the exact same calculation. They result in the same number.

    10 choose 4 calculation and 10 choose 6 calculation

    So in our Binomial probability mass function, the coefficient in the beginning is a calculation of how many ways our “x” successes can be rearranged or reordered inside the sequence of “n” total trials. As you’ll see later, that is an important thing to consider when determining the probability of “x” number of successes within “n” sequential Bernoulli trials. So now that we see how all the individual numbers (and groups of numbers) in the Binomial distribution probability mass function actually have a direct meaning, let’s look at how to use the probability mass function to answer some questions.

    Using the Binomial Probability Mass Function to Solve Problems


    So now let’s look at some problems and how they can be modeled by a Binomial distribution, and we can use the Binomial probability mass function to find the probabilities of different situations. Let’s go back to a similar situation that we saw near the beginning.

    If you flip a coin 10 times, what is the probability that you would get 8 heads?

    Now first, let’s look at how the details of the Binomial distribution arise naturally from the situation described in this problem. First of all, we have 10 repeated trials. Those can be represented by the 10 blanks below

    10 blank trials picture

    An “H” in a blank means that toss of the coin resulted in a head and a “T” in a blank means that toss of the coin resulted in a tails. So let’s look at one result where we have 8 heads in the 10 total flips of the coin.

    Let’s calculate this probability. I’ll let Hi represent the ith toss is a heads, and Tj represents the jth toss results in a tails. So that first result could be denoted as:

    Probability notation for probability of first 8 heads

    P(H1∩H2∩H3∩H4∩H5∩H6∩H7∩H8∩T9∩T10)P(H_1 \cap H_2 \cap H_3 \cap H_4 \cap H_5 \cap H_6 \cap H_7 \cap H_8 \cap T_9 \cap T_{10})

    Notice if we only have 8 heads, there HAVE TO BE 2 tails. That’s why in that probability statement the last two are indicated as tails. That has to be true. If those are not accounted for, we are not finding the probability we want. If we look at each of these events (H1, H2, H3, etc.) they are all independent of each other. The fact that the first toss of the coin is heads doesn’t change the probability that the second will be heads from what the probability was before or the third and so on. Also, the distributions of the individual trials are all identical. They’re all 50% probability heads and 50% probability tails. Remember, for independent events, to find the probability of their intersection (their AND probability), you just multiply the separate probabilities together. So the probability of our specific sequence of heads and tails can be calculated as:

    Formula — probability of intersection is individual probs multiplied

    P(first eight heads)=P(H1)⋅P(H2)⋅P(H3)⋅P(H4)⋯P(T9)⋅P(T10)P(first \space eight \space heads)=P(H_1) \cdot P(H_2) \cdot P(H_3) \cdot P(H_4) \cdots P(T_9) \cdot P(T_{10})
    =(12)⋅(12)⋅(12)⋅(12)⋅(12)⋅(12)⋅(12)⋅(12)⋅(12)⋅(12)⋅(12)= \left(\frac{1}{2}\right) \cdot \left(\frac{1}{2}\right) \cdot \left(\frac{1}{2}\right) \cdot \left(\frac{1}{2}\right) \cdot \left(\frac{1}{2}\right) \cdot \left(\frac{1}{2}\right) \cdot \left(\frac{1}{2}\right) \cdot \left(\frac{1}{2}\right) \cdot \left(\frac{1}{2}\right) \cdot \left(\frac{1}{2}\right) \cdot \left(\frac{1}{2}\right)
    =(12)8⋅(12)2= \left(\frac{1}{2}\right)^8 \cdot \left(\frac{1}{2}\right)^2
    =(p)x⋅(1−p)n−x= \left(p\right)^x \cdot \left(1-p\right)^{n-x}
    =(prob. of success)(number of successes)⋅(prob. of failure)(number of failures)= \left(\text{prob. of success}\right)^{(\text{number of successes})} \cdot \left(\text{prob. of failure}\right)^{(\text{number of failures})}

    So is this our answer? No. This would be the answer if the question was “what is the probability that the FIRST 8 tosses of the coin are heads?”. We’re trying to answer the question about the probability of there being 8 heads ANYWHERE in the 10 total tosses. We don’t care if they’re the first eight, the last eight, or if the eight heads are dispersed any other way around the 10 total flips of the coin. So what do we need to do? We need to consider how many different ways these 8 heads can exist or be reordered within the 10 total tosses. That’s where that “n choose x” comes into play. If we calculate 10 choose 8 (or 10 choose 2, remember they’re actually the same calculation), that would be how many different sequences of heads and tails exist with 10 total tosses and 8 heads. Because all of the trials are identically distributed, any sequence of 8 heads in the 10 total tosses would have the same probability. That’s why we multiply the probability by this “n choose x” factor.

    (nx)=(108)=10!8!2!\binom{n}{x}=\binom{10}{8}=\frac{10!}{8!2!}

    Once we multiply those together, we now know the total probability of getting 8 heads IN ANY ORDER when we toss the coin 10 total times. And that is what we’re looking for in this problem. Not the probability that we get 8 heads in a SPECIFIC order, but in ANY order. That’s why we have to multiply that probability by “10 choose 8”. The “10 choose 8” accounts for all the possible orders of the 8 heads within the 10 coin tosses.

    P(X=8)=(108)⋅(12)8⋅(12)2≈0.0439P(X=8)=\binom{10}{8}\cdot \left(\frac{1}{2}\right)^8 \cdot \left(\frac{1}{2}\right)^2 \approx 0.0439

    So this is how to solve a classic, textbook binomial distribution problem. If you can understand this coin flip problem, you can apply the exact same logic to any other binomial distribution problem. You just have to make sure that each of the repeated trials are dichotomous (only two outcomes), independent, and identically distributed. Then, if you are interested in finding the probability of x number of successes in n total outcomes IN ANY ORDER, you can apply the binomial probability mass function to answer that question no matter the other details of the problem. To see this, let’s consider a more complicated problem that may not immediately look like it can be modeled by a binomial distribution:

    You work for an airline. You know from previous data that approximately 1/500 people who buy a ticket don’t end up using their plane ticket due to illness or being late and missing the flight. For a flight containing 100 seats, you sell 102 tickets. What is the probability that you have to kick at least 1 person off the flight?

    First, let’s discuss how this can be thought of just like the coin flipping problem. In the coin flipping problem, we had 10 repeated trials. Each toss of the coin was a separate trial. What are the trials in this example? Each person that does or doesn’t show up for the flight is a trial. In the coin toss example, each trial had two possible outcomes only: heads and tails. Is that true for the trials in this airline problem? Yes, the two possible outcomes for each trial or person is one of two: they are present for the flight, or they are not present for the fight.

    Are the trials independent? This is where it gets a little hairy. In real life, probably not. Let’s see why. Some people travel in groups. So let’s consider that there’s a family in these 102 people that bought a ticket: a husband, a wife, and 2 kids. If you know the result of the “husband trial”, meaning that you know whether the husband is present or not present for the flight, does that change the probabilities of the wife and 2 kids being present for the flight? I would say yes. Knowing that the result of the “husband trial” is success, that should make it much more likely (probably nearly 100%) that the wife and kids are present as well. If the result of the “husband trial” is failure, that should make it much less likely (maybe nearly 0%) that the wife and kids trials will be a success. So in real-world situations, we’d actually need to consider that. And if that is happening (we have families traveling, or groups, or people from the same business conference, etc.) knowing one person has missed the flight may make it more or less likely that other people will miss the flight. In this situation we’re trying to solve, we are going to assume that is NOT TRUE. We are going to treat these ticket holders like they are completely independent of one another. Therefore, the trials will be independent.

    In the coin toss example, the trials were identically distributed. That meant every toss of the coin had a 0.5 probability of heads, and 0.5 probability of tails. Do all the trials in the airline example have identical distributions? It depends on the information you have available. If you know one of the people who bought a ticket has a connecting flight that is scheduled to get in with just enough time to run across the airport and board this flight, that would make it less likely than an average person that they will make the flight. If you know one of the people who bought a ticket is staying in a hotel right by the airport, they are catching this flight for an important business thing, and they have one of those fast pass things that lets them go through the checkpoints really quickly, that would make it more likely than the average person that they would make their flight. Because we don’t know any of this, we treat them all like they’re the same. Therefore, when the problem says 1/500 people miss their flight, we use that probability for each individual person and say each individual person (without knowing any better) will have a 1/500 chance of missing their flight. For that reason, we can treat the trials as identically distributed: 1/500 probability of a trial resulting in missing the flight, and 1-1/500 or 499/500 probability of a trial making the flight. So all the conditions are met for this situation to be modeled as a Binomial Probability Distribution.

    Now we just need to make sure the question we’re trying to answer has to do with finding the probability of a certain number of successes IN ANY ORDER within a certain number of trials. That is true in this case. Let’s discuss why. The real question is “What is the probability that you have to kick at least 1 person off the flight?”. That doesn’t sound like the question we had with the coin tosses, but it actually is. Let’s think for a second. Kicking a person from the flight would mean that more people showed up for the flight than there are seats. So what we really need to interpret this as asking is “What’s the probability that more than 100 people show up for the flight?” If 100 or fewer people show up for the flight, we don’t have to kick anyone from the flight. If EXACTLY 101 people show up for the flight, we have to kick 1 person. If EXACTLY 102 people show up for the flight, we have to kick 2 people from the flight. And we should agree that more than 102 people can’t show up, because it says we only sold 102 total tickets. So that’s how this becomes a probability question we can answer. What is the probability that EXACTLY 101 OR EXACTLY 102 people show up for the flight out of the 102 total number of people that could show up for the flight. Be aware that the total number of trials is not the number of seats (100), it’s the number of ticket holders (102) because we’re trying to figure the probability that a certain number of those 102 ticket holders are successes (showing up for the flight).

    Now because we are trying to find the probability of EXACTLY 101 OR EXACTLY 102 successes, we can find the probability of EXACTLY 101 and EXACTLY 102 successes separately and just add them together to find their OR probability. Why? Because they are mutually exclusive. If you know EXACTLY 101 people showed up for the flight, what’s the probability that EXACTLY 102 people showed up for the flight (or EXACTLY 100, or EXACTLY 99, or EXACTLY 98, etc.)? It’s now zero. If I know EXACTLY 101 people showed up, the probability that also EXACTLY 102 people showed up is zero. This means the probability that EXACTLY 101 AND EXACTLY 102 people show up for the flight is zero, meaning they are mutually exclusive events. For mutually exclusive events, you can add their individual probabilities to find their OR probability. So in this problem, we just need to find two separate probabilities and add them together to answer the question. And since we’ve discussed that we’re assuming all the conditions are met for this situation to be modeled by a Binomial Distribution, we can use the Binomial Distribution Probability Mass function to find those probabilities:

    P(X=101)=(102101)⋅(499500)101⋅(1500)1≈0.1667P(X=101)=\binom{102}{101} \cdot \left(\frac{499}{500}\right)^{101}\cdot\left(\frac{1}{500}\right)^{1} \approx 0.1667
    P(X=102)=(102102)⋅(499500)102⋅(1500)0≈0.8153P(X=102)=\binom{102}{102} \cdot \left(\frac{499}{500}\right)^{102}\cdot\left(\frac{1}{500}\right)^{0} \approx 0.8153

    And so the end result is:

    Final answer

    P(X=101∪x=102)=P(X=101)+P(X=102)≈0.982P(X=101 \cup x=102) = P(X=101)+P(X=102) \approx 0.982

    So What’s the Bottom Line?

    The bottom line is that any time you have repeated trials of an experiment that only ever have two possible outcomes (success or failure), and the trials don’t affect each other (independence), and the distributions of the outcomes are all identical (the probability of a success or failure is the same in each individual trial), the probability of x number of successes within the n trials can be modeled by the Binomial Probability Distribution. This assumes that the order of the successes in the sequence does not matter. So if we look at the airline example again, and we say “what is the probability that you’ll have to kick the passenger in seat 3A off or the passenger in seat 6B off the plane?”, we can’t model it as a strictly binomial distribution anymore. We are still talking about a similar situation, but now we’re talking about specific passengers (meaning specific trials in the sequence of trials) and we therefore can’t multiply by the “n choose x” coefficient at the beginning which would cause us to find the probability of kicking off any two passengers, not the specific ones we’re talking about in those specific seats. And we also saw how the numbers in the probability mass function actually mean something. The coefficient at the beginning accounts for the number of possible ways you can have that many successes within that many total trials. The probabilities raised to their respective powers representing the number of successes and failures multiplied together calculates the probability of a single sequence of trials that has that many number of successes within the total. So when you multiply the probability of one sequence of x successes within n total trials times the number of different ways you can actually get x successes within n total trials, you get the total probability of x number of successes in any order within the n total trials.

    And as we saw, if the problem is really asking to find the probability that a few different numbers of successes happen (at most 3, meaning 0, 1, 2, or 3; at least 10, meaning 10, 11, 12, etc.; more than 10, meaning 11, 12, 13, etc.), you can just find the probability of each specific number of successes using the binomial distribution mass function and add them together to find their OR probability (any of those number of successes happen).