Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is not a mathematical problem, per se, so shields down. Design this program and turn in your design artifacts prior to starting to code.

  1. This is not a mathematical problem, per se, so shields down.
  2. Design this program and turn in your design artifacts prior to starting to code.
  3. This program will read a list of numbers and determine if they adhere to Benford's law. We will demonstrate this by plotting the data and visually determining if it fits the pattern.
  4. From Wikipedia: Benford's law...is an observation that in many real-life sets of numericaldata, theleading digitis likely to be small.In sets that obey the law, the number 1 appears as the leading significant digit about 30% of the time, while 9 appears as the leading significant digit less than 5% of the time. If the digits were distributed uniformly, they would each occur about 11.1% of the time.
  5. You will write a program to do the following:
    1. Read a list of data from a data file specified by the user. The first line of the data file is the header to put on the graph, the remining lines are the data items. Sample data files are provided in the Programming assignment module. Not all data adheres to Benford's Law.
    2. Count the number of data items from the file that have a first digit of '1', then '2', up to '9'. For example, if the number from the file was "3871", it would be counted as a '3' because the first digit is a '3'.
    3. Output the data header, followed by a plot showing the number of data items in each category '1' - '9'.
  6. The graph below shows the expected pattern of data that adheres to Benford's Law. You will be plotting it horizontally, so it will look something like this:
image text in transcribed
Benford's Law 1: 2: 3: 4: 5: 6: 7: 8: 9 : Challenge: Add the percentage to the output lines as shown below: Benford's Law 1: 30.0% 2: 18.0% 3: 13.0% 4: 10.0% 5: 8.0% 6: 7.0% 7: 6.0% 8: 5. 0% 9 : 5.0%

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

Step: 3

blur-text-image

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

Modern Dental Assisting

Authors: Doni Bird, Debbie Robinson

13th Edition

978-0323624855, 0323624855

Students also viewed these Programming questions

Question

Which kind of lens is used to make a magnifying glass?

Answered: 1 week ago

Question

In which of the following environments can sound travel fastest?

Answered: 1 week ago

Question

Which type of energy does an object have when it is in motion?

Answered: 1 week ago