[Wellington-pm] SEND + MORE = MONEY

Ewen McNeill ewen at naos.co.nz
Wed Mar 2 22:06:24 PST 2005


In message <ED7BD3F5F07F1F428628A09F50720F5306CA72 at clwlge2k03.clnz.net>, "Malcolm Allison" writes:
>Ewen McNeill wrote:
>>In message <422694C1.7010600 at vilain.net>, Sam Vilain writes:
>>>    use Quantum::Superpositions;   #....
>>>    my $a = any(1,0);
>>>   print ($a + $a == 1);  # prints 1, actually impossible
>>
>>$a + $a == 1  is possible if the first $a is taken as 1, and the second
>>$a is taken as 0 (or vice versa).  Where as there is no value in $a
>>which can be multiplied by 2 and yeild 1 (you get 2 or 0).
>
>so $a + $a == 1 if $a != $a?
>this seems a little like cheating to me  ;)

$a = any(1,0);  $a + $a == 1; 

corresponds to

any(1,0) + any(1,0) == 1

which is true providing you pick 1 from one of them and 0 from the other.

I don't really see that as cheating -- it's supposed to be true if there's
some way of picking values from each of the quantum superpositions (ie,
sets) such that it comes up with the desired result.

I suppose you could argue that it's breaking the analogy with quantum
physics (where looking at something supposedly resolves its value at
which point it is then fixed -- and hence $a should always take on the
same value), but the Quantum::Superposition (and the Perl6 equivilent)
is really more about set theory AFAICS.

You could try complaining to Damian Conway (original author) and/or
Steven Lembrak (current maintainer) that it violates the analogy with
quantum physics, by not respecting entanglement.  But I suspect at this
point they probably care more about compatibility with Perl 6 (which is
more set theory based I believe).

Ewen

PS: If the quantum superpositions are anything like all the possible
    permutations (1.8 million) then expect it to take a lot of time/memory
    in this situation.  (I had to abandon my first attempt to generate
    a set of all possible permutations and iterate through them, because
    the memory load was simply too high.  Hence the more object-oriented
    approach I posted, which generates one permutation at a time.)


More information about the Wellington-pm mailing list