Reply to topic  [ 25 posts ]  Go to page 1, 2  Next
Working out the average 
Author Message
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 7:35 pm
Posts: 6580
Location: Getting there
Reply with quote
Hi all,

Quick question...

I know to work out the average (or mean) of a list of numbers you add them up and then divide the total by the number of numbers.

BUT!

Can you do it this way...

Take the first number.
Add the second number and divide the total by 2.
Add the third number and divide the total by 2.
...
Add the nth number and divide the total by 2.

Does that work?

Thanks!

_________________
Oliver Foggin - iPhone Dev

JJW009 wrote:
The count will go up until they stop counting. That's the way counting works.


Doodle Sub!
Game Of Life

Image Image


Tue Aug 24, 2010 7:33 pm
Profile WWW
Occasionally has a life
User avatar

Joined: Thu Apr 30, 2009 6:34 pm
Posts: 309
Reply with quote
no

_________________
iam_bored_ok on cpc
panda's are awesome


Tue Aug 24, 2010 7:36 pm
Profile
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 7:35 pm
Posts: 6580
Location: Getting there
Reply with quote
bubbles wrote:
no

Are you sure?

_________________
Oliver Foggin - iPhone Dev

JJW009 wrote:
The count will go up until they stop counting. That's the way counting works.


Doodle Sub!
Game Of Life

Image Image


Tue Aug 24, 2010 7:38 pm
Profile WWW
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 7:35 pm
Posts: 6580
Location: Getting there
Reply with quote
Hmm...

It seems that it doesn't work but my brain doesn't accept that fact.

LOL!

_________________
Oliver Foggin - iPhone Dev

JJW009 wrote:
The count will go up until they stop counting. That's the way counting works.


Doodle Sub!
Game Of Life

Image Image


Tue Aug 24, 2010 7:42 pm
Profile WWW
What's a life?
User avatar

Joined: Fri Apr 24, 2009 10:21 am
Posts: 12700
Location: The Right Side of the Pennines (metaphorically & geographically)
Reply with quote
There are three types of average. Mean, mode and median.
One is the total divided by the number of samples, one is the most common number in the samples and one is the middle number if put in order. I forget which is which.

_________________
pcernie wrote:
'I'm going to snort this off your arse - for the benefit of government statistics, of course.'


Tue Aug 24, 2010 7:43 pm
Profile WWW
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 7:35 pm
Posts: 6580
Location: Getting there
Reply with quote
Ah, I've just figures out why it doesn't work.

:D

LOL!

Brain fade moment for a second there :D

_________________
Oliver Foggin - iPhone Dev

JJW009 wrote:
The count will go up until they stop counting. That's the way counting works.


Doodle Sub!
Game Of Life

Image Image


Tue Aug 24, 2010 7:56 pm
Profile WWW
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 9:40 pm
Posts: 5288
Location: ln -s /London ~
Reply with quote
I can prove it doesn't work by means of a trivial counterexample, but it's bugging me. And I guess it makes sense, although initially I half expected it to work.

Trivial counterexample:
Image

And I guess it makes sense. If you have an average, then you're averaging your cumulative average with each new piece of data, so you increase the weighting of the nth datum as n increases exponentially, ie:
Image

_________________
timark_uk wrote:
Gay sex is better than no sex

timark_uk wrote:
Edward Armitage is Awesome. Yes, that's right. Awesome with a A.


Tue Aug 24, 2010 7:57 pm
Profile
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 9:40 pm
Posts: 5288
Location: ln -s /London ~
Reply with quote
Bugger, sorry it took so long! I was scribbling on a copy of the metro in green highlighter (not that green is a particularly slow colour, mind) and then used a quick online LaTeX compiler.

_________________
timark_uk wrote:
Gay sex is better than no sex

timark_uk wrote:
Edward Armitage is Awesome. Yes, that's right. Awesome with a A.


Tue Aug 24, 2010 7:58 pm
Profile
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 7:35 pm
Posts: 6580
Location: Getting there
Reply with quote
EddArmitage wrote:
Bugger, sorry it took so long! I was scribbling on a copy of the metro in green highlighter (not that green is a particularly slow colour, mind) and then used a quick online LaTeX compiler.

LOL, no problem.

I had the same feeling as you and then the same thought (i.e. the weighting of the accumulative average.

_________________
Oliver Foggin - iPhone Dev

JJW009 wrote:
The count will go up until they stop counting. That's the way counting works.


Doodle Sub!
Game Of Life

Image Image


Tue Aug 24, 2010 8:12 pm
Profile WWW
Spends far too much time on here
User avatar

Joined: Thu Apr 23, 2009 6:44 pm
Posts: 4141
Location: Exeter
Reply with quote
EddArmitage wrote:
Bugger, sorry it took so long! I was scribbling on a copy of the metro in green highlighter (not that green is a particularly slow colour, mind) and then used a quick online LaTeX compiler.


Sorry, but that post contains sooooo much win.

We really need rep on here.

_________________
"The woman is a riddle inside a mystery wrapped in an enigma I've had sex with."


Tue Aug 24, 2010 8:22 pm
Profile WWW
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 9:40 pm
Posts: 5288
Location: ln -s /London ~
Reply with quote
jonlumb wrote:
EddArmitage wrote:
Bugger, sorry it took so long! I was scribbling on a copy of the metro in green highlighter (not that green is a particularly slow colour, mind) and then used a quick online LaTeX compiler.

Sorry, but that post contains sooooo much win.

We really need rep on here.

Hmmm, I think I'd be into negative rep overall! What's so win-y about that post?

_________________
timark_uk wrote:
Gay sex is better than no sex

timark_uk wrote:
Edward Armitage is Awesome. Yes, that's right. Awesome with a A.


Tue Aug 24, 2010 8:43 pm
Profile
Spends far too much time on here
User avatar

Joined: Thu Apr 23, 2009 11:36 pm
Posts: 3527
Location: Portsmouth
Reply with quote
Post counts and sticky threads are the devils work.

Rep should replace post count IMO.

_________________
Image


Tue Aug 24, 2010 8:50 pm
Profile
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 7:35 pm
Posts: 6580
Location: Getting there
Reply with quote
EddArmitage wrote:
jonlumb wrote:
EddArmitage wrote:
Bugger, sorry it took so long! I was scribbling on a copy of the metro in green highlighter (not that green is a particularly slow colour, mind) and then used a quick online LaTeX compiler.

Sorry, but that post contains sooooo much win.

We really need rep on here.

Hmmm, I think I'd be into negative rep overall! What's so win-y about that post?

The Metro, the green highlighter, the comment about the green highlighter, the "quick" LaTex compiler, the rushed nature of it, etc...

It is a very funny and perfectly put together post :D

Almost worthy of Douglas Adams :D

_________________
Oliver Foggin - iPhone Dev

JJW009 wrote:
The count will go up until they stop counting. That's the way counting works.


Doodle Sub!
Game Of Life

Image Image


Tue Aug 24, 2010 8:50 pm
Profile WWW
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 9:40 pm
Posts: 5288
Location: ln -s /London ~
Reply with quote
Fogmeister wrote:
It is a very funny and perfectly put together post :D

Why thank thee. And I was still too slow!

_________________
timark_uk wrote:
Gay sex is better than no sex

timark_uk wrote:
Edward Armitage is Awesome. Yes, that's right. Awesome with a A.


Tue Aug 24, 2010 8:55 pm
Profile
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 6:58 pm
Posts: 8767
Location: behind the sofa
Reply with quote
Fogmeister wrote:
Can you do it this way...

I now know you know now, but it amused me that you thought of it. I remember following the same logic many years ago, although I forget what the project was.

The simplest way is to keep a tally of how many samples are taken, and a rolling total of all previous samples. At the very least, you need to know how many samples there have been so you can adjust the weighting accordingly.

Producing a "rolling average" is a bit of a pain in practice, because you require infinite precision numbers. Otherwise, you eventually reach a saturation point where no further changes to the readout are possible.

I'd be interested in what algorithms are used to display the "average fuel consumption" on trip computers. I know they're not all the same, and I suspect many of them weight recent samples more heavily. That is to say, it's a different kind of "average" all together.

_________________
jonbwfc's law: "In any forum thread someone will, no matter what the subject, mention Firefly."

When you're feeling too silly for x404, youRwired.net


Tue Aug 24, 2010 10:23 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 25 posts ]  Go to page 1, 2  Next

Who is online

Users browsing this forum: No registered users and 24 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.