Re: boolean function, interpolation
- To: mathgroup at smc.vnet.net
- Subject: [mg61567] Re: boolean function, interpolation
- From: Maxim <ab_def at prontomail.com>
- Date: Sat, 22 Oct 2005 03:24:06 -0400 (EDT)
- References: <dj2719$bgb$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
On Tue, 18 Oct 2005 07:08:25 +0000 (UTC), edi <esolakster at gmail.com> wrote:
> Hi,
>
> I would like to interpolate vectors (dimension:20-30 bits) over GF(2)
> and values (one bit)to a function (boolean). Is there easy way to this
> in Mathematica?
>
> Thanks.
>
If you just want to create a function which takes given values on given
boolean vectors, it is not hard:
In[1]:=
boolint[Lvecval_] := Module[
{conj},
conj[Lbool_] := Times @@ MapThread[
If[# == 0, 1 - #2, #2]&,
{Lbool, Array[Slot, Length@ Lbool]}];
Total@ Cases[Lvecval, {v_, 1} :> conj[v]] //
Evaluate // Function
]
In[2]:=
boolint[{{{0, 0, 0}, 1}, {{0, 1, 0}, 0}, {{1, 1, 1}, 1}}]
Out[2]=
(1 - #1)*(1 - #2)*(1 - #3) + #1*#2*#3&
We have constructed a function f such that
f[0, 0, 0] == 1
f[0, 1, 0] == 0
f[1, 1, 1] == 1
Maxim Rytin
m.r at inbox.ru