[ltp] perl question:

Brad Langhorst linux-thinkpad@www.bm-soft.com
Wed, 23 May 2001 12:01:52 -0400


yeah - not thinkpad related at all...
you'll probably have better luck asking this question on a statistic's news 
group.
 
you could use perl to do this quite easily
just use the statistics perl modules..

brad
On Wednesday 23 May 2001 11:02 am, you wrote:
> I know this has little to nothing to do with Linux on ThinkPads other than
> I use my ThinkPad for school, but thought I might ask anyway.  For my class
> I have created a random numeric array which has 10 elements.  I am suppose
> to do a few things with it, but the one thing I seem to be a little stumped
> on is finding the most common occurrence of an element and then returning
> it's value.
>
> Example:
>
> @array = 2 4 6 3 4 8 1 9 7 5
>
> Mode = 4
>
> How do I capture that "4" is the most common element of the array?  I have
> tried using grep and a loop, but I am not getting the results I had hoped
> for.  Any pointers from anyone would be muchly appreciated.
>
> Thanks!
>
> Dan Root
> Safeco Information Systems
> danroo@safeco.com
> 206-545-3250
>
>
>
> ----- The Linux ThinkPad mailing list -----
> The linux-thinkpad mailing list home page is at:
> http://www.bm-soft.com/~bm/tp_mailing.html

----- The Linux ThinkPad mailing list -----
The linux-thinkpad mailing list home page is at:
http://www.bm-soft.com/~bm/tp_mailing.html