Compute P(A>B) for m- and n-sided dice

Quick Overview

This question evaluates understanding of probability theory and discrete combinatorics, specifically reasoning about pairwise outcomes and deriving a parameterized closed-form expression for P(A > B) when A and B are m- and n-sided dice.

Compute P(A>B) for m- and n-sided dice

Company: Reddit

Role: Data Scientist

Category: Statistics & Math

Difficulty: medium

Interview Round: Technical Screen

Two fair dice are rolled independently: - Die **A** has **m** faces labeled \(1,2,\dots,m\). - Die **B** has **n** faces labeled \(1,2,\dots,n\). Each face is equally likely. 1) Derive a closed-form expression for \(\mathbb{P}(A > B)\) as a function of \(m\) and \(n\). 2) Optionally, provide a simple Python function to compute it (either via the closed form or via counting).

Overview: This question evaluates understanding of probability theory and discrete combinatorics, specifically reasoning about pairwise outcomes and deriving a parameterized closed-form expression for P(A > B) when A and B are m- and n-sided dice.

|Home/Statistics & Math/Reddit
Reddit logo
Reddit
Sep 19, 2025
mediumData ScientistTechnical ScreenStatistics & Math
8
0

Two fair dice are rolled independently:

  • Die A has m faces labeled 1,2,,m1,2,\dots,m .
  • Die B has n faces labeled 1,2,,n1,2,\dots,n .

Each face is equally likely.

  1. Derive a closed-form expression for P(A>B)\mathbb{P}(A > B) as a function of mm and nn .
  2. Optionally, provide a simple Python function to compute it (either via the closed form or via counting).
Loading comments...