Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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)

image text in transcribed

image text in transcribed

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Horse Betting The Road To Absolute Horse Racing 2

Authors: NAKAGAWA,YUKIO

1st Edition

B0CFZN219G, 979-8856410593

More Books

Students also viewed these Databases questions

Question

What are five website design guidelines?

Answered: 1 week ago

Question

a score of 70 or higher on the test?

Answered: 1 week ago