Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*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 2006

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

Search the Archive

Re: Use pattern to find minimum without using min

  • To: mathgroup at smc.vnet.net
  • Subject: [mg71845] Re: [mg71808] Use pattern to find minimum without using min
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Fri, 1 Dec 2006 06:21:43 -0500 (EST)
  • Reply-to: hanlonr at cox.net

{9, 4, 6, 5, 3, 7} //. 
  {{a___, b_, c___, d_, e___} :> {a,b,c,e} /; (b < d),
    {a___, d_, c___, b_, e___} :> {a,b,c,e} /; (b < d)}

{3}

{9, 4, 6, 5, 3, 7}//Sort//First

3


Bob Hanlon

---- wooks <wookiz at hotmail.com> wrote: 
> Tried
> 
> {9, 4, 6, 5, 3, 7} //. {a___, b_, c___, d_, e___} :> b /; (b < d)
> 
> and
> 
> {9, 4, 6, 5, 3, 7} //. {x_,y_,z___} :> {x,z} /; (x<y)
> 
> without much success.
> 


  • Prev by Date: Re: Algorithm used by "Reduce" function
  • Next by Date: Re: Use pattern to find minimum without using min
  • Previous by thread: Re: Algorithm used by "Reduce" function
  • Next by thread: Re: Use pattern to find minimum without using min