public void TestWrap()
    {
        var s = ProbabilityDistributionMonad.Wrap("test");

        s.Dictionary.Single().Key.AssertEquals("test");
        s.Dictionary.Single().Value.AssertEquals(BigRational.One);
    }
    public void TestFlatten()
    {
        var s = ProbabilityDistributionMonad.Wrap(ProbabilityDistributionMonad.Wrap("test")).Flatten();

        s.Dictionary.Single().Key.AssertEquals("test");
        s.Dictionary.Single().Value.AssertEquals(BigRational.One);

        var a1 = new ProbabilityDistributionMonad <string>(new Dictionary <string, BigRational> {
            { "a", BigRational.One / 7 },
            { "bra", BigRational.One / 7 * 2 },
            { "ca", BigRational.One / 7 * 4 }
        });
        var a2 = new ProbabilityDistributionMonad <string>(new Dictionary <string, BigRational> {
            { "da", BigRational.One / 3 },
            { "bra", BigRational.One / 3 * 2 },
        });
        var s2 = new ProbabilityDistributionMonad <ProbabilityDistributionMonad <string> >(new Dictionary <ProbabilityDistributionMonad <string>, BigRational> {
            { a1, BigRational.One / 5 },
            { a2, BigRational.One / 5 * 4 }
        }).Flatten();

        s2.Dictionary.Count.AssertEquals(4);
        s2.Dictionary["a"].AssertEquals(BigRational.One / 105 * 3);
        s2.Dictionary["bra"].AssertEquals(BigRational.One / 105 * 62);
        s2.Dictionary["ca"].AssertEquals(BigRational.One / 105 * 12);
        s2.Dictionary["da"].AssertEquals(BigRational.One / 105 * 28);
    }