You are viewing a single comment's thread. Return to all comments →
C#
static void Main(String[] args) { double p = 1.0/3.0; Console.WriteLine(digitScale( geometricDist(5, p), 3 )); } static double geometricDist(int n, double p) { return p * Math.Pow(1-p, n-1); } static double digitScale(double d, int scale ){ double factor = Math.Pow(10, scale); return Math.Round(d * factor)/factor; }
Seems like cookies are disabled on this browser, please enable them to open this website
Day 4: Geometric Distribution I
You are viewing a single comment's thread. Return to all comments →
C#