MathGroup Archive 2010

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

Search the Archive

Re: All componens different


On Aug 22, 11:51 pm, "Dr. Wolfgang Hintze" <w... at snafu.de> wrote:
> Given a list v of natural numbers I'm looking for a function d[v_] that
> returns True if all components are different and False otherwise.
>
> One solution is
>
> d1[v_] := ! Or @@ Flatten[Table[v[[i]] == v[[k]], {i, 1, Length[v]},
> {k, i + 1, Length[v]}]]
>
> Can you find more efficient (and elegant) solutions?

Unequal @@ v


  • Prev by Date: Re: Proper style for argument checking?
  • Next by Date: How to copy-paste Mathematica code into a message
  • Previous by thread: All componens different
  • Next by thread: Re: All componens different