The median( Command

We're glad you came by, but you might find what you're looking for elsewhere.

TI-Basic Developer is not the site it once was. While its information on commands and other calculator features remains almost second-to-none, its forum, archives, and even hosting service, Wikidot, have been decaying for years. The calculator community would love to see what you're working on, or help you in your next coding adventure, but TI-Basic Developer is no longer the place to do it.

Instead, you should head over to Cemetech (primarily American) or TI-Planet (primarily international). Both are active, well-established forums with their own archives, chatrooms, reference material, and abundant coding tools and resources. We'll see you there, we hope.

MEDIAN.GIF

Command Summary

Finds the median of a list.

Command Syntax

median(list,[freqlist])

Menu Location

Press:

  1. 2ND LIST to enter the LIST menu.
  2. LEFT to enter the MATH submenu.
  3. 4 to select median(, or use arrows.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The median( command finds the median of a list. It takes a list of real numbers as a parameter. For example:

:Prompt L1
:Disp "MEDIAN OF L1",median(L1

That's not all, however. Awesome as the median( command is, it can also take a frequency list argument, for situations when your elements occur more than once. For example:

:Disp median({1,2,3},{5,4,4})

is short for

:median({1,1,1,1,1,2,2,2,2,3,3,3,3})

The frequency list {5,4,4} means that the first element, 1, occurs 5 times, the second element, 2, occurs 4 times, and the third element, 3, occurs 4 times.

Advanced Uses

Frequency lists don't need to be whole numbers. Amazing as that may sound, your calculator can handle being told that one element of the list occurs 1/3 of a time, and another occurs 22.7 times. It can even handle a frequency of 0 - it will just ignore that element, as though it weren't there. One caveat, though - if all of the elements occur 0 times, there's nothing to take the median of and your calculator will throw an error.

Error Conditions

  • ERR:DATA TYPE is thrown, among other cases, if the data list is complex, or if the frequencies are not all positive and real.
  • ERR:DIM MISMATCH is thrown if the frequency list and the data list have a different number of elements.
  • ERR:DIVIDE BY 0 is thrown if the frequency list's elements are all 0.

Related Commands

.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Noncommercial 2.5 License.