Skip to content
CampusEduX

Problem 2: Dice Roll Event Probability

Easypython
Learn the Concept: Probability Basics

Problem Description

Write a Python program that simulates rolling a six-sided die a given number of times, and calculates the estimated probability of rolling a number greater than 4.

Input

An integer representing the number of dice rolls to simulate.

Output

The estimated probability of rolling a number greater than 4.

Constraints

  • Number of rolls will be a positive integer.

Example Input

text
5000

Example Output

text
Estimated probability of rolling > 4: 0.33

Concepts Covered

random.randint(), conditionals, simulation-based probability.

Related Problems

  • Problem 1: Coin Flip Simulator
    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...