**amchiclet posted on 03-04-2010 12:02 AM**

I'm trying to run a simple example. Here's how I thought it would work.

I have 2 variables, each with 3 discrete values, namely {0, 1, 2}.

I'm trying to define the following truth table where F(x,y) returns 2 only when both x and y are 0; otherwise 1;

X Y F(X,Y)

0 0 2

0 1 1

0 2 1

1 0 1

1 1 1

1 2 1

2 0 1

2 1 1

2 2 1

The marginalization of X should be <0.4,0.3,0.3> and Y's should be <0.4,0.3,0.3>

Here's the code I used.

Variable<int> x = Variable.DiscreteUniform(3);

Variable<int> y = Variable.DiscreteUniform(3);

Variable<bool> x0 = (x == 0);

Variable<bool> y0 = (y == 0);

Variable.ConstrainEqualRandom(x0 & y0, Bernoulli.FromLogOdds(Math.Log(2.0/8.0)));

InferenceEngine engine = new InferenceEngine();

Console.WriteLine("x = {0}", engine.Infer(x));

Console.WriteLine("y = {0}", engine.Infer(y));

The output I got was x=<0.2727,0.3636,0.3636>, y=<0.2727,0.3636,0.3636>

Can you tell me what I did wrong? Thank you.