Zulip Chat Archive

Stream: Is there code for X?

Topic: Repeating probability events


Gareth Ma (Nov 14 2023 at 00:18):

Is there enough API in Mathlib to formalise that "the expected number of times we have to roll a Fin n-indexed dice before we get a 0 is n times"? If so, can someone point me to some relevant parts of Mathlib? I had no prior experience with probability measure in Mathlib at all.

Gareth Ma (Nov 14 2023 at 00:28):

I suppose you can formalise a random variable such that P[X=k]=(11n)k11n\mathbb{P}[X = k] = \left(1 - \frac{1}{n}\right)^{k - 1} \cdot \frac{1}{n}, but that kind of loses the point of the problem formulation, which is recursive in nature

Johan Commelin (Nov 14 2023 at 05:41):

I don't think we have much in this direction if you want to use the probability API. If you take the combinatorics approach, it might be more accessible.


Last updated: Dec 20 2023 at 11:08 UTC