MathGroup Archive 2005

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

Search the Archive

Re: Checking for a given phrase in an expression


Out of the sleeve solution (I do not have time to have an intelligent one
right now) is to generate subsets of aa and then test if bb is a an element
in the list of subsets so
MemberQ[Subsets[aa, Length[bb]], bb]
returns True as expected
yehuda


On 9/27/05, lost.and.lonely.physicist at gmail.com <
lost.and.lonely.physicist at gmail.com> wrote:
>
> Hello everyone
>
> Is it possible to ask Mathematica to check if a given phrase occurs in
> an expression? Say I have
>
> aa = 1 + x + x y + Log[Sin[z]]
>
> and
>
> bb = x + Log[Sin[z]]
>
> Can Mathematica tell me such a phrase bb exists in aa? Can it tell me
> its 'position' within the expression aa?
>
> Thanks for the help!
>
>



  • Prev by Date: Re: Problem running multiple lines in a cell
  • Next by Date: Re: SingularValueDecomposition bug: fifty examples
  • Previous by thread: Checking for a given phrase in an expression
  • Next by thread: Re: Re: Checking for a given phrase in an expression