[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] Love & Hate shenanigans



Ilmari Karonen <iltzu@sci.fi> writes:

<...>

> I think he meant "transitive".  In fact, they define a partial ordering
> among the set of words.  See below.

Ah yes that's the word.  Thanks!

> A relatively efficient solution is included below.  It relies on the
> fact that the partial ordering defined by Bullians is a subset of the
> full ordering defined by counting the 1-bits in the strings.

There is a further property of Bulleans that you all have probably
noticed.  There are two kinds of Bulleans - Or Bulleans and And
Bulleans.  A pair of words (A,B) is an And Bullean (A&B eq B) if and
only if (B,A) is a pair of Or Bulleans (B|A eq A).

Warning: Simplistic proof follows.

Let <A1,A2,...,An> be the digits of A and <B1,B2,...,Bm> be the digits
of B.  By the defn of &, if A&B eq B, then n>=m.  
Let C=A|B=<C1,C2...,Cm,An-m,...An> but from a binary and/or table:

Ax Bx (Ax & Bx) (Ax | Bx)
0  0      0         0 *
1  0      0         1
0  1      0         1
1  1      1         1 *

notice whenever Ax & Bx eq Bx, Ax | Bx eq Ax, hence
<C1,...,Cm>=<A1,...,Am>.  Hence, if A&B eq B, then B|A eq A.  

To show B|A eq A implies A&B eq B is trivially similar.  (And because
I've always wanted to say this - it is left as an exercise for the
reader) ;-)  

For bonus points, can anyone say anything about Xor Bulleans.

PS.  An Apology: Although it seemed like a good idea on the night,
Bulleans is probably not such a good name.  Probably should have gone
with "strange"|"boolean" eq smogo or something equally clever. *sigh*
Nevermind...

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe