# Newbie question, playing with example #1

### Diskusi Umum

• Hello,

I am new to infer.net, so I apologize if my questions are dumb (you've been warned ;-) )

I've tried to add some coins to the example, and added some (naive) variables:

Variable<bool> firstCoinHead = Variable.Bernoulli(0.5);
Variable<bool> secondCoinHead = Variable.Bernoulli(0.5);
Variable<bool> thirdCoinHead = Variable.Bernoulli(0.5);
Variable<bool> FourthCoinHead = Variable.Bernoulli(0.5);

InferenceEngine ie = new InferenceEngine();

...

My problem is that, although both twoHead and threeHead are equal it gives me:

...

My understanding was that threeHead was supposed to be equal to twoHead... :-S

My fear is that if I try to build on this engine and work on a more complex network, I'll get in the end some wrong meaningless numbers.

• Diedit oleh 29 Februari 2012 18:41
29 Februari 2012 18:04

### Semua Balasan

• The posteriors on twoHead and threeHead should not be equal. You are observing twoHead to be false, so the posterior on twoHead must be Bernoulli(0). This observation means that posteriors on firstCoinHead etc are correctly reduced (if you run ie.Infer(firstCoinHead) you will get a Bernoulli(0.2764) and likewise the others). threeHead on the other hand is not constrained but its posterior will be affected by the observation on twoHead via the dependency on firstCoinHead etc.

Having said that, there are situations where you need to be careful with approximate inference with such logic problems. Please see the thread at http://social.microsoft.com/Forums/en-US/infer.net/thread/ffaa6ffd-498e-41e8-8787-011b16be348f.

John

02 Maret 2012 9:29