Author Topic: How to get the most repeated value in a list?  (Read 2307 times)

0 Members and 1 Guest are viewing this topic.

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
How to get the most repeated value in a list?
« on: May 25, 2011, 09:43:50 am »
So I was learning statistics and when I do 1-Var Stats in the 83+ Series I can't seem to get the most repeated value in a sequence.

We call it "moda" in my language, which means "fashion", so not sure if you have a special name.

So I thought of making a TI-Basic program for it, but I have no idea of how to get the number of elements in a list nor how to do the thing actually.

I really have *no idea* of how to code it, do you guys have any idea?

How it'd look:

Code: [Select]
WHAT LIST?
1
THE MOST REPEATED VALUE IS 10

An example of L1 here would be:

Code: [Select]
10
10
9
8
7
9
10

Thanks a lot!

Offline Compynerd255

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 336
  • Rating: +53/-4
  • Betafreak Games
    • View Profile
    • Betafreak Games
Re: How to get the most repeated value in a list?
« Reply #1 on: May 25, 2011, 10:14:45 am »
In English, it's called "mode". I also have no idea how to code it, either. However, there are a few functions that might help:

dim(L1) (found in [2nd] (list), in the second submenu) returns the number of elements in the list. You can also store to this function to set the number of elements in a list.
L1(n) gets the nth element of the list, with 1 being the first element.
« Last Edit: May 25, 2011, 10:15:14 am by Compynerd255 »
The Slime: On Hold, preparing to add dynamic tiles

Axe Eitrix: DONE

Betafreak Games: Fun filled games for XBox and PC. Check it out at http://www.betafreak.com



Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: How to get the most repeated value in a list?
« Reply #2 on: May 25, 2011, 10:16:07 am »
Thanks Compynerd, I got it already thanks to merth :) http://weregoose.unitedti.org/#ModeCalculator

Offline sjasogun1

  • LV3 Member (Next: 100)
  • ***
  • Posts: 88
  • Rating: +8/-1
    • View Profile
Re: How to get the most repeated value in a list?
« Reply #3 on: May 31, 2011, 06:52:34 am »
It might list it as Mod, but I don't know if your 83+ also shows that when using 1Var. My casio shows it right beneath MaxX, above Mod:n and Mod:F
Veni, vidi, cecidi
(I came, I saw, I fell down dead)
MSPAFORUMS: http://www.mspaforums.com/
HOMESTUCK: http://www.mspaintadventures.com/?s=6&p=001901

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: How to get the most repeated value in a list?
« Reply #4 on: May 31, 2011, 06:01:00 pm »
It might list it as Mod, but I don't know if your 83+ also shows that when using 1Var. My casio shows it right beneath MaxX, above Mod:n and Mod:F

Yeah, TI seems to hate Mode, they don't have it neither on Nspire nor on 83+.