Skip to content

Demonstrate Zipf's law with Sherlock Holmes' stories

License

Notifications You must be signed in to change notification settings

a-s-russo/sherlock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Demonstrating Zipf's law using Sherlock Holmes' stories

Zipf's law states that the frequency of words found in books follows a power law. That is, the counts of certain words are inversely proportional to their ranks, wherein the most common word occurs twice as often as the second most frequent word, three times as often as the subsequent word, and so on.

The code demonstrates this empirical law by counting the occurence of words in all Sherlock Holmes' stories and plotting the frequencies on a log-log scale. A linear relationship can be observed, suggesting the power law holds for these data:

My Image

The stories are available for download on Kaggle.

About

Demonstrate Zipf's law with Sherlock Holmes' stories

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages