Compute probability of random arithmetic progression triple
Company: Mavensecurities
Role: Data Scientist
Category: Coding & Algorithms
Difficulty: medium
Interview Round: Take-home Project
Quick Answer: This question evaluates combinatorics and probability skills, specifically counting combinations and recognizing arithmetic progression structure among distinct integers, and belongs to the Coding & Algorithms category for Data Scientist roles.
Constraints
- Return the reduced fraction as a string.
Examples
Input: ()
Expected Output: '21/406'
Explanation: There are 210 arithmetic-progression triples among C(30,3)=4060 subsets.
Hints
- Clarify edge cases before coding.
- Keep the return value deterministic.