MathGroup Archive 1998

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

Search the Archive

Summing over like elements


I have a 2 column array.  Column 1 has some values, many of which are
repeated.  Column 2 has probabilities of these values.

I would like to sum the probabilities for each unique element in column
1. For example:

{{1, .5} , {2, .2} , {1, .1}}  should give me:

{{1, .6} , {2, .2}}


I'm sure I can do this with a "Do" loop -- however it seems that in
general "Do's" are pretty innefficient.

Does anyone have any suggestions?

                Mitch



  • Prev by Date: Re: Re: Defining differential operators question
  • Next by Date: Re: Disappearing variables
  • Previous by thread: UNEXPECTED END OF FILE !!!!!!