Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

use of orderless

  • To: mathgroup at smc.vnet.net
  • Subject: [mg52516] use of orderless
  • From: borges2003xx at yahoo.it
  • Date: Tue, 30 Nov 2004 05:24:38 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

i'm  trying to implement a  mark all binary lists in which three non
overlapping sublists of the same  length(of length >= 3) a, b, and c ,
where
c  is the result of xor of a and b, in all way they can present
(orderless).
But it don't work . somebody can help me?

ZeroPad[x__] :=(*Takes Transpose after zero - padding*)Module[{l, y =
Map[(#
/. d_Integer :> IntegerDigits[d, 2]) &, {x}]}, l = Map[Length, y];
Transpose[MapThread[Join[Table[0, {Max[l] - #1}], #2] &, {l, y}]]]

BitwiseXor[x__] := Flatten[Apply[Mod[Plus[##], 2] &, ZeroPad[x], {1}]]
<< DiscreteMath`Combinatorica`
SetAttributes[mm, Orderless]
mmQ[t1, t2, t3] := True /; (BitwiseXor[t1, t2] == t3) && (Length[t1]
= 3) && (Length[t2] = 3) && (Length[t3] = 3)
m[{x1___, a1__, x2___, a2__, x3___, a3__, x4___}] := {} /; mmQ[{a1}, {
a2}, {a3}]
m[l_] := l
t1 = Strings[{0, 1}, 10];
Rest[Union[Map[m, t1]]]


Length[%]
1023


  • Prev by Date: Re: launching a kernel on a remote linux machine through ssh from a linux machine
  • Next by Date: help on sublists xor
  • Previous by thread: Animating Solutions of NDSolve with respect to Initial Conditions
  • Next by thread: help on sublists xor