Programming project asked you to explore ben fords law an


Question: Programming Project asked you to explore Ben ford's Law. An easier way to write the program is to use an array to store the digit counts. That is, count [0] might store the number of times 0 is the first digit (if that is possible in your data set), count [1] might store the number of times 1 is the first digit, and so forth. Redo Programming Project 3.15 using arrays. Write a program that tests Ben ford's Law. Collect a list of at least 100 numbers from some real-life data source and enter them into a text file. Your program should use an array to store the digit counts. That is, count [0] might store the number of times 0 is the first digit (if that is possible in your data set), count [1] might store the number of times 1 is the first digit, and so forth. For each digit, output the percentage it appears as the first digit.

Programming Project: This problem is based on a "Nifty Assignment" by Steve Wolfman ( https://nifty. stanford.edu/2006/wolfman-pretid). Consider lists of numbers from real-life data sources; for example, a list containing the number of students enrolled in different course sections, the number of comments posted for different Facebook status updates, the number of books in different library holdings, the number of votes per precinct, etc. It might seem like the leading digit of each number in the list could be 1-9 with an equally likely probability. However, Benford's Law states that the leading digit is 1 about 30% of the time and drops with larger digits. The leading digit is 9 only about 5% of the time. Write a program that tests Benford's Law. Collect a list of at least 100 numbers from some real-life data source and enter them into a text file. Your program should loop through the list of numbers and count how many times 1 is the first digit, 2 is the first digit, etc. For each digit, output the percentage it appears as the first digit.

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Programming project asked you to explore ben fords law an
Reference No:- TGS02404623

Now Priced at $10 (50% Discount)

Recommended (91%)

Rated (4.3/5)