Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*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 2005

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

Search the Archive

Re: Re: Replacement equivalence?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg63253] Re: [mg63239] Re: Replacement equivalence?
  • From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
  • Date: Tue, 20 Dec 2005 23:35:37 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

On 20 Dec 2005, at 23:43, Andrzej Kozlowski wrote:

>
> On 20 Dec 2005, at 18:19, David Bailey wrote:
>
>> carlos at colorado.edu wrote:
>>> This is a spinoff of an ongoing thread in s.m.s.  Could the  
>>> nonlinear
>>> replacement
>>>
>>>                            b^2 -> 1
>>>
>>> be changed to the linear one
>>>
>>>                            b-> 1||-1
>>>
>>> Similarly
>>>              x^4 -> 16     to    x ->  2||-2||2*I||-2*I
>>>
>>> Any possible side effects?
>>>
>> Hello,
>>
>> Quite a few really, for example:
>>
>> b^2 /. b -> 1 || -1
>>
>>       (1 || -1)^2
>>
>> David Bailey
>> http://www.dbaileyconsultancy.co.uk
>>
>
> The only interpretation of the original post that makes any sense  
> to me is that what the poster was trying to get at is the fact that  
> the pattern _?(#^2 == 1 &) is equivalent to the pattern 1 | -1.  
> Indeed:
>
>
>
> Cases[{1, -1, 2, -1, 3}, _?(#^2 == 1 &)]
>
>
> {1, -1, -1}
>
>
>
>
> Cases[{1, -1, 2, -1, 3}, 1 | -1]
>
>
> {1, -1, -1}
>
>
>
> Andrzej Kozlowski
>
>
>


In fact, however, things are not as simple:


b /: b^2 = 1;


Cases[{b, 1, -1, 2, -1, 3}, _?(#^2 == 1 & )]


{b, 1, -1, -1}


Cases[{b, 1, -1, 2, -1, 3}, 1 | -1]


{1, -1, -1}

Andrzej Kozlowski


  • Prev by Date: Re: Unexpected behavior of Simplify
  • Next by Date: Re: Imposing boundary condition at infinity
  • Previous by thread: Re: Replacement equivalence?
  • Next by thread: Packages with Cyclic Dependencies