Skip to content
CampusEduX

Problem 1: Coin Flip Simulator

Easypython
Learn the Concept: Probability Basics

Problem Description

Write a Python program that simulates flipping a fair coin a given number of times, and prints the estimated probability of getting heads.

Input

An integer representing the number of coin flips to simulate.

Output

The estimated probability of heads, based on the simulation.

Constraints

  • Number of flips will be a positive integer (at least 100 recommended for a stable estimate).

Example Input

text
1000

Example Output

text
Estimated probability of heads: 0.49

Concepts Covered

random module, simulation-based probability estimation, loops.

Related Problems

  • Problem 2: Dice Roll Event Probability
    Easy · python
    Solve Problem
  • Problem 3: Conditional Probability Calculator
    Easy · python
    Solve Problem
  • Problem 4: Card Draw Probability (Without Replacement)
    Easy · python
    Solve Problem

Input (stdin)

Output

Run your code to see output here...