PracHub
QuestionsPremiumLearningGuidesInterview PrepNEWCoaches
|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)
Reddit logo
Reddit
Sep 19, 2025, 12:00 AM
Data Scientist
Technical Screen
Statistics & Math
2
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).

Solution

Show

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

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

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

Product

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

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL 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.