Question: Help with functions, strings, and namespace in Python 3. Help with opening the files in the link and using them to experiment with Benford's Law.
Help with functions, strings, and namespace in Python 3. Help with opening the files in the link and using them to experiment with Benford's Law.
http://www.cse.msu.edu/~cse231/Online/Labs/Lab08/ (this is the link for the txt. files needed)



Thank you!
Benford's Law (sometimes called the First-Digit Law) is an observation about the distribution of first digits in many data sets: the number 1 occurs as the leading digit about 30% of the time, while larger numbers occur in that position less frequently (for example, 9 occurs as the first digit less than 5% of the time). As noted on Wikipedia: This result has been found to apply to a wide variety of data sets, including electricity bills, street addresses, stock prices, population numbers, death rates, lengths of rivers, physical and mathematical constants, and processes described by power laws (which are very common in nature). d P(d Relative size of P(d 1 30.1% 217.6% 3 12.5% 4 9.7% 5 7.9% 6 6.7% 7 5.8% 8 5.1% 9 4.6% Develop a program which will allow you to experiment with Benford's Law. The program will prompt the user for the name of an input file, read the contents of the file and count the leading digits, and then display the results. For simplicity, the program will assume that the data file contains integer numbers, with one value per line
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
