r/askscience • • Sep 21 '13

Meta [META] AskScience has over one million subscribers! Let's have some fun!

[deleted] — view deleted post

1.4k Upvotes

234 comments sorted by

View all comments

143

u/AnkhMorporkian Sep 21 '13

One million words randomly chosen from the English language will average 5,100,000 characters.

33

u/[deleted] Sep 21 '13

Which dictionary?

61

u/AnkhMorporkian Sep 21 '13

I'll admit it, I cheated and used wolfram alpha. I can't figure out where they get their data from, but I'd bet they compute it from their own corpus.

The other values listed are in line with it though, and all sort of sources I did find put it right around that value as well.

13

u/[deleted] Sep 21 '13

Doesn't wolfram alpha give sources?

32

u/AnkhMorporkian Sep 21 '13

Usually it does, but in this case it doesn't give a source option. That's why I believe it's probably computed by the WolframAlpha people as opposed to sourced.

7

u/CelebornX Sep 21 '13

So the average word is 5.1 characters long?

8

u/bradgrammar Sep 21 '13

For your sentence the average is 4.57 characters per word.

4

u/ranon20 Sep 22 '13

The sentence above is too small a sample size.

6

u/bradgrammar Sep 22 '13

Your average is 5.1

3

u/lackofbrain Sep 22 '13

Well... There are only two words that are one letter long - "a" and "I", and a relatively small number that are 2 letters long - 26x26 is 676, and many of them (jf for example) are not valid words. If one of them has to be a vowel (including y) then that limits it 312 (26x6x2), and even then I'm not sure they are all real words. At 3 letter you start to get a lot more (including set, which IIRC has the longest single entry in the Oxford English Dictionary*). But it feels like there are probably more 4 and 5 letter words I actually use all the time, and a decreasing number that are longer than that.

I would imagine that the distribution is skewed towards the bottom end, but "about 5" letters seems plausible. I would probably have guessed at a bit less that 5 rather than a bit more but that's probably the limitations on my vocabulary biasing that.

* at least that's what a TV programme called Balderdash and Piffle told me once a long time ago!

1

u/sasquatch92 Sep 23 '13

I think this depends on whether you are sampling from a list of words in the English language or from things written in English. As an experiment, I sampled the average length of a million words taken from my computer's dictionary, together with a million words from a book. Sampling from the dictionary returned an average of 9.58 characters per word, and sampling from the book (American Gods) returned an average of 4.30. Given the quite large amount of larger esoteric words that were in even this dictionary, I'd say that English words as a whole would have an average word length of over the quoted 5.1 characters. However, 5.1 seems reasonable for an average of all English works.

Note: The (slow) python script I knocked up to calculate the averages can be found here, just modify the word splitting for a book.

1

u/AnkhMorporkian Sep 23 '13

It certainly does depend on the sample. I've used a different script I just wrote which is much more efficient to calculate my averages. The source is at the bottom. I have quite a few ebooks myself, including American Gods.

I've removed the table of contents from each book where necessary.

  • American Gods: 4.195
  • Anansi Boys: 4.199
  • Pride & Prejudice: 4.444

However, running it over more scientific works:

  • The Origin of Species: 4.883
  • Principia: 4.948
  • Various collection of biology papers I had on my computer: 5.337

I think you'll get more accurate results with this script, and it runs very quickly.

import re
with open('/path/to/file') as words:
	wordlist = [re.sub(r'[^A-Za-z_]+', '', x) for x in words.read().split()]
wordcount = len(wordlist)
wordlist = map(lambda x: len(x), wordlist)
wordlist = reduce(lambda x,y: x+y, wordlist)
print (wordlist/float(wordcount))