Re: Mean
- To: mathgroup at smc.vnet.net
- Subject: [mg48153] Re: Mean
- From: "Roger L. Bagula" <rlbtftn at netscape.net>
- Date: Fri, 14 May 2004 20:59:10 -0400 (EDT)
- References: <c81hen$4sd$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Try the hard way , sum the list and divide by the number of elements: mean=Apply[Plus,boys]/Dimensions[boys][[1]]] per.ronne at doesnt.work.spam.filter.invalid wrote: > I've just purchased Mathematica 5 but I've got some problems. > > I write: > > boys = > {192, 176, 178, 180, 189, 173, 177, 176, 176, 194, > 178, 172, 175, 180, 170, 174, 180, 184, 177, 181, > 190, 186, 187, 184, 190, 180, 178, 182, 181, 180, > 175, 182, 182, 181, 179, 190, 173, 189, 173, 183, > 172, 178, 182, 172, 190, 180, 176, 177, 181, 185, > 174, 178, 178, 178, 170, 175, 178, 186, 185, 182, > 179, 187, 183, 188, 191, 180, 193, 183, 185, 174, > 174, 180, 191, 180, 177, 185, 192, 187, 170, 176, > 170, 184, 179, 173, 184, 184, 190, 179} > > But when I try to get their average height [it is the height of boys in > Danish upper grammar schools, grade 13 at the age of around 19], I get: > > Mean[boys] > Mean[{192, 176, 178, 180, 189, 173, 177, 176, 176, 194, 178, 172, 175, > 180, > 170, 174, 180, 184, 177, 181, 190, 186, 187, 184, 190, 180, 178, > 182, 181, > 180, 175, 182, 182, 181, 179, 190, 173, 189, 173, 183, 172, 178, > 182, > 172, 190, 180, 176, 177, 181, 185, 174, 178, 178, 178, 170, 175, > 178, 186, > 185, 182, 179, 187, 183, 188, 191, 180, 193, 183, 185, 174, 174, > 180, > 191, 180, 177, 185, 192, 187, 170, 176, 170, 184, 179, 173, 184, > 184, 190, > 179}] > > And it doesn't help to put on a //N: > > Mean[boys] // N > Mean[{192., 176., 178., 180., 189., 173., 177., 176., 176., 194., 178., > 172., > 175., 180., 170., 174., 180., 184., 177., 181., 190., 186., 187., > 184., > 190., 180., 178., 182., 181., 180., 175., 182., 182., 181., 179., > 190., > 173., 189., 173., 183., 172., 178., 182., 172., 190., 180., 176., > 177., > 181., 185., 174., 178., 178., 178., 170., 175., 178., 186., 185., > 182., > 179., 187., 183., 188., 191., 180., 193., 183., 185., 174., 174., > 180., > 191., 180., 177., 185., 192., 187., 170., 176., 170., 184., 179., > 173., > 184., 184., 190., 179.}] > > If I look up in the Stephen Wolfram's Mathematica book 5th Edition on > page 109, it should be possible to get: > > data = {4.7, 7.2, 8.4, 5.8, 9.2, 3.9} > Mean[data] > 6.46667 > > But instead I get: > > Mean[{4.7, 7.2, 8.4, 5.8, 9.2, 3.9}] > > What is wrong?