MathGroup Archive 2005

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

Search the Archive

simultaneous ... and ___

  • To: mathgroup at smc.vnet.net
  • Subject: [mg60863] simultaneous ... and ___
  • From: "borges2003xx at yahoo.it" <borges2003xx at yahoo.it>
  • Date: Fri, 30 Sep 2005 06:38:01 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

i have a function m
Clear[m]
m[{___, x1__ , x2___ , x3___ , ___, x3___ , x2___ ,
      x1__ , ___}] := {} /; (Length[{x1}] + Length[{x1}] +
Length[{x1}]) = 5


m[l_] := l
which transform every string in which three sublists are followed by
the three in reverse order, and the total of length of three are >=5.

Everything seems to works

now i want consider the same three sublists in which is permitted also
the repetition one or more times.

Clear[m1]
m1[{___, x1__ .., x2___ ..., x3___ ..., ___, x3___ ..., x2___ ...,
      x1__ .., ___}] := {}
m1[l1_] := l1

and all seem to work
m[{0, 1, 1, 2, 2, 2, 3, 4, 3, 3, 3, 3, 2, 1, 1, 1, 1, 8}]
gives {}

but if i add the length

m1[{___, x1__ .., x2___ ..., x3___ ..., ___, x3___ ..., x2___ ...,
      x1__ .., ___}] := {}
/; (Length[{x1}] + Length[{x1}] + Length[{x1}]) >= 15
m1[l1_] := l1

dont work
m[{0, 1, 1, 2, 2, 2, 3, 4, 3, 3, 3, 3, 2, 1, 1, 1, 1, 8}]
gives
m[{0, 1, 1, 2, 2, 2, 3, 4, 3, 3, 3, 3, 2, 1, 1, 1, 1, 8}]

if i change 15 with 6 for length
dont work


can anyone help me?


  • Prev by Date: Re: axes for Plot3D
  • Next by Date: Re: Re: Multicore Calculations
  • Previous by thread: Solve / NSolve take too much time or fail