public void TestGetProbabilityLaplaceSmoothing2()
 {
     Assert.AreEqual(0.4, smallDistribution.GetProbabilityLaplaceSmoothing("item1"), 0.0);
     Assert.AreEqual(0.3, smallDistribution.GetProbabilityLaplaceSmoothing("item2"), 0.0);
     Assert.AreEqual(0.2, smallDistribution.GetProbabilityLaplaceSmoothing("item3"), 0.0);
     Assert.AreEqual(0.1, smallDistribution.GetProbabilityLaplaceSmoothing("item4"), 0.0);
 }
        public void TestGetProbabilityLaplaceSmoothing1()
        {
            Random random = new Random();
            DiscreteDistribution discreteDistribution = new DiscreteDistribution();

            for (int i = 0; i < 1000; i++)
            {
                discreteDistribution.AddItem("" + i);
            }

            Assert.AreEqual(2.0 / 2001, discreteDistribution.GetProbabilityLaplaceSmoothing("" + random.Next(1000)),
                            0.0);
            Assert.AreEqual(1.0 / 2001, discreteDistribution.GetProbabilityLaplaceSmoothing("item0"), 0.0);
        }