|
|
andrel a écrit :
> On 12-Sep-08 21:14, Vincent Le Chevalier wrote:
>> There is also a similarity between the behaviours of positive
>> integers, multiplication and addition, and booleans, AND and OR. That is:
>>
>> Integers Booleans
>> a*(b+c) = a*b + a*c a AND (b OR c) = (a AND b) OR (a AND c)
>> 0 + a = a false OR a = a
>> 0 * a = 0 false AND a = false
>> if a>0, a+b>0 for all b if a is true, a OR b is true for all b
>> And so on...
>>
>> It does not work out that well if you set true <-> 0.
>>
> If you take
> true <-> 0
> false <-> 1
> OR <-> *
> AND <-> +
> it works again.
No, it's not as perfect. For example the equality:
(a AND b) OR (a AND c) = a AND (b OR c)
would translate as:
(a+b) * (a+c) = a*a + a*b + a*c + b*c
= a * (1+b+c) + b*c
!= a + b*c
because 1+b+c is not equal to 1 in all cases.
I agree it works in the boolean sense, that is if one side is zero, the
other is too. But you do not have the equality that you have in the
other approach.
I'm nearly sure there is a deeper reason for that but I can't think of
it right now.
--
Vincent
Post a reply to this message
|
|