Skip to content

Instantly share code, notes, and snippets.

@usptact
Created August 27, 2019 22:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save usptact/fc928d57c44698edd2f219ddb9cac94d to your computer and use it in GitHub Desktop.
Save usptact/fc928d57c44698edd2f219ddb9cac94d to your computer and use it in GitHub Desktop.
using System;
using Microsoft.ML.Probabilistic.Models;
namespace twodice
{
class Program
{
static void Main(string[] args)
{
Variable<int> six = Variable.DiscreteUniform(6);
Variable<int> eight = Variable.DiscreteUniform(8);
Variable<bool> eight_larger = eight > six;
InferenceEngine engine = new InferenceEngine();
Console.WriteLine("Probability eight-sided dice rolled bigger number: " + engine.Infer(eight_larger));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment