Given the definition of "set", n can be

n =. e.#[


R.E. Boss



> -----Oorspronkelijk bericht-----
> Van: [email protected] [mailto:programming-
> [email protected]] Namens Matthew Brand
> Verzonden: donderdag 16 juli 2009 15:37
> Aan: Programming forum
> Onderwerp: Re: [Jprogramming] union and intersection
> 
>    u =. ~.@,
>    n =. ~.@(e.#[)
>     1 2 3 4 u 3 4 5 6
> 1 2 3 4 5 6
>     1 2 3 4 n 3 4 5 6
> 3 4
> 
> 
> 
> 2009/7/16 Kip Murray <[email protected]>:
> > The following is easy but interesting.
> >
> > A "set" is a numeric vector without repetitions.  Provide definitions
> for the
> > union u and intersection n of two sets:
> >
> >    1 2 3 4 u 3 4 5 6  NB. elements of one or the other
> > 1 2 3 4 5 6
> >
> >    1 2 3 4 n 3 4 5 6  NB. common elements
> > 3 4
> >
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> >
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to