Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to plot the normal distribution for a population of human heights.

My question is how can I input multiple frequencies for the same variable, without writing them out one by one.

e.g. I have 17 instances of 5'10", 20 of 5'11", 4 of 6'.

share|improve this question
Have a look at ConstantArray and Join. – b.gatessucks Jan 19 '13 at 14:18
up vote 7 down vote accepted
   Table[Quantity["5 feet 11 inches"], {7}], 
   Table[Quantity["5 feet 10 inches"], {20}]

So there are three things going on here -- we are using Mathematica Version 9 Quantity for things with units, Table to make individual lists of a given length, and Join to concatenate them.

You could also use ConstantArray instead of Table, and various different input forms of "5 feet 10 inches", etc.

share|improve this answer
I found it interesting that "5 feet 11 inches" becomes $5'11"$ which is, in FullForm, Quantity[MixedRadix[5, 11], MixedRadix["Feet", "Inches"] – DavidC Jan 19 '13 at 17:34
Table[5.10, {17}]

Should do the trick

share|improve this answer
  1. Table is best used for things that change while ConstantArray is optimized for repetition of a single element.

  2. Rather than typing either several times it will be faster to use Apply.

  3. Entering pairs of values is done more quickly with matrix entry tools than nested brackets.

Mathematica graphics

Mathematica graphics

(Flatten or Join can be used to merge sub-lists into one. I am using pre-v9 units in this example.)

All this said there may be a better way to "plot the normal distribution."

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.