PracHub
QuestionsLearningGuidesInterview Prep
|Home/Statistics & Math/Reddit

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

Last updated: Mar 29, 2026

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.

  • medium
  • Reddit
  • Statistics & Math
  • Data Scientist

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).

Quick Answer: 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.

Related Interview Questions

  • Justify synthetic control and handle inference - Reddit (hard)
|Home/Statistics & Math/Reddit

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

Reddit logo
Reddit
Sep 19, 2025, 12:00 AM
mediumData ScientistTechnical ScreenStatistics & Math
4
0

Two fair dice are rolled independently:

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

Each face is equally likely.

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

Browse More Questions

More Statistics & Math•More Reddit•More Data Scientist•Reddit Data Scientist•Reddit Statistics & Math•Data Scientist Statistics & Math

Write your answer

Your first approved answer each day earns 20 XP.

Sign in to write your answer.
PracHub

Master your tech interviews with 8,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • AI Coding Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.