Expected Value and Variance of an n-Sided Die

Statistical Inference DS practice problem on Onlearn.

Difficulty: easy.

Topics: Expected Value and Variance of an n-Sided Die, Probability Mass Function, Linearity of Expectation, Second Central Moment, Arithmetic Series Summation, Big O Notation, Probability Theory, Statistical Inference, Discrete Mathematics, Calculus, Computational Complexity, Random Variables, Moment Generating Functions, Combinatorics, Summation Calculus, Asymptotic Analysis.

Write a Python function that computes the expected value and variance of a fair n sided die roll. The die has faces numbered 1 through n, each equally likely. The function should return a tuple (expected value, variance).