MathGroup Archive 2001

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

Search the Archive

RE: Greatest element in list


Hello Oliver,

as to the theorem you stated, I don't believe it. However, if you have in
your list e.g. an undefined symbol or something where numerical comparison
doesn't work, then you'll come to surprise.

In[1]:= list = Table[Random[Real, {0, 100}], {100}]; 
In[2]:=
(Position[#1, Max[#1]] & )[list = Append[list, "wake up"]]
Out[2]= {}

;-) Hartmut


> -----Original Message-----
> From: Oliver Friedrich [mailto:oliver.friedrich at tz-mikroelektronik.de]
To: mathgroup at smc.vnet.net
> Sent: Thursday, August 23, 2001 8:16 AM
> To: mathgroup at smc.vnet.net
> Subject: [mg30493] [mg30474] Greatest element in list
> 
> 
> Hi,
> 
> what's the best way to get the position of the greatest 
> number in list of
> reals? I've tried
> 
> Position[#,Max[#]]&list
> 
> but surprisingly, it doesn't work all the time, sometimes it 
> returns an
> empty list. How is that, because a theorem says that a non 
> empty set of real
> numbers must have at least one biggest element. So Max[#] 
> can't be empty.
> 
> Any solutions ?
> 
> Oliver Friedrich
> 
> 



  • Prev by Date: Re: Greatest element in list
  • Next by Date: Re: combining Log[] terms
  • Previous by thread: Re: Greatest element in list
  • Next by thread: Re: Greatest element in list