# How to do Data Sampling with replacement?

Sampling with replacement is used to find probability with replacement. In other words, you want to find the probability of some event where there’s a number of balls, cards or other objects, and you replace the item each time you choose one.

Example: Let’s say you had a population of 7 people, and you wanted to sample 2. Their names are:

• John
• Jack
• Qiu
• Tina
• Hatty
• Jacques
• Des

You could put their names in a hat. If you sample with replacement, you would choose one person’s name, put that person’s name back in the hat, and then choose another name. The possibilities for your two-name sample are:John, John

• John, Jack
• John, Qui
• Jack, Qui
• Jack Tina
• …and so on.

When you sample with replacement, your two items are independent. In other words, one does not affect the outcome of the other. You have a 1 out of 7 (1/7) chance of choosing the first name and a 1/7 chance of choosing the second name.

• P(John, John) = (1/7) * (1/7) = .02.
• P(John, Jack) = (1/7) * (1/7) = .02.
• P(John, Qui) = (1/7) * (1/7) = .02.
• P(Jack, Qui) = (1/7) * (1/7) = .02.
• P(Jack Tina) = (1/7) * (1/7) = .02.

Note that P(John, John) just means “the probability of choosing John’s name, and then John’s name again.” You can figure out these probabilities using the multiplication rule.