# 31 Lecture

## CS101

### Midterm & Final Term Short Notes

## Flip a Coin

Coin flips are also used in games and simulations to ensure fairness. In games like poker or blackjack, the outcome of a coin flip can be used to determine who goes first or who gets to make a certain decision.

**Important Mcq's**

Midterm & Finalterm Prepration

Past papers included

Download PDF
**What is the probability of getting tails on a fair coin flip?**a) 0% b) 50% c) 100% d) None of the above**Answer: b) 50%****What is the purpose of using a coin flip in computer science?**a) To generate random numbers b) To ensure fairness in games and simulations c) To study probability and statistics d) All of the above**Answer: d) All of the above****What is the Monty Hall problem?**a) A problem involving flipping a coin multiple times b) A problem involving choosing between three doors and a prize c) A problem involving generating random numbers d) None of the above**Answer: b) A problem involving choosing between three doors and a prize****How can a coin flip be used to generate random numbers?**a) By assigning heads to 0 and tails to 1 b) By flipping the coin a number of times to generate a binary string c) By converting the binary string to a decimal number d) All of the above**Answer: d) All of the above****What is the probability of getting three heads in a row on a fair coin flip?**a) 1/8 or 12.5% b) 1/4 or 25% c) 1/2 or 50% d) 1 or 100%**Answer: a) 1/8 or 12.5%****How is a coin flip used in simulations?**a) To generate random numbers b) To ensure fairness c) To introduce random events d) None of the above**Answer: c) To introduce random events****What is the probability of getting heads and tails on two consecutive coin flips?**a) 0% b) 25% c) 50% d) 75%**Answer: b) 25%****How can a coin flip be used in cryptography?**a) To generate random numbers b) To ensure security c) To study probability and statistics d) None of the above**Answer: a) To generate random numbers****How is the Monty Hall problem solved using coin flips?**a) By assigning heads to the winning door b) By flipping a coin to decide which door to choose c) By flipping a coin to demonstrate that switching doors increase the probability of winning d) None of the above**Answer: c) By flipping a coin to demonstrate that switching doors increases the probability of winning****How can coin flips be used to study probability and statistics?**a) By flipping a coin multiple times and keeping track of the results b) By assigning heads to 1 and tails to 0 c) By using a computer to simulate coin flips d) None of the above**Answer: a) By flipping a coin multiple times and keeping track of the results**

**Subjective Short Notes**

Midterm & Finalterm Prepration

Past papers included

Download PDF
**What is the probability of getting heads on a fair coin flip? Answer:**The probability of getting heads on a fair coin flip is 50%.**How is a coin flip used to generate random numbers? Answer:**A coin flip can be assigned heads to 0 and tails to 1, and then flipped a number of times to generate a binary string. This binary string can then be converted to a decimal number, giving you a random number.**Why is generating truly random numbers on a computer a challenge? Answer:**Computers are deterministic machines, which means that they always follow a set of instructions and produce the same output every time they are given the same input.**How are coin flips used to ensure fairness in games and simulations? Answer:**In games like poker or blackjack, the outcome of a coin flip can be used to determine who goes first or who gets to make a certain decision. In simulations, coin flips can be used to introduce random events, such as a car accident or a power outage, that can affect the outcome of the simulation.**What is the Monty Hall problem? Answer:**The Monty Hall problem is a probability puzzle that involves three doors and a prize behind one of the doors. The problem involves choosing a door and then switching to another door after one of the other doors is revealed to be empty.**How is the Monty Hall problem solved using coin flips? Answer:**The Monty Hall problem can be solved using coin flips to demonstrate that the probability of winning the prize is higher if you switch doors.**What is the purpose of using a coin flip in simulations? Answer:**The purpose of using a coin flip in simulations is to introduce random events that can affect the outcome of the simulation.**How is a coin flip used in cryptography? Answer:**Coin flips can be used in cryptography to generate random numbers that are used as keys to encrypt and decrypt data.**What is the probability of getting three heads in a row on a fair coin flip? Answer:**The probability of getting three heads in a row on a fair coin flip is 1/8 or 12.5%.**How can coin flips be used to study probability and statistics? Answer:**Coin flips can be used to study probability and statistics by flipping a coin multiple times and keeping track of the results to learn about the probability of getting heads or tails.