Write a one-class java program

Assignment Help JAVA Programming
Reference no: EM13320107

According to Benford's law, in data in some large-enough numerical datasets, the first significant digit is 1 much more often than would be expected; in fact, 1 occurs as the first significant digit in the data almost 30% of the time, and 9 occurs less than 5% of the time. (We would expect each to occur one-ninth, or about 11%, of the time if each digit were equally likely to occur as the first significant digit.)

According to Benford's law, each digit occurs as the first significant digit in a dataset as follows:

1253_Write a one-class Java program.png

We want to computationally determine if the data in a given dataset follows Benford's law.

Input

The file data.txt, which contains our dataset as rows of numerical data., with each row representing one unit of data.

Output

The percentage of occurrence of each digit as the first significant digit in the data, represented both numerically and visually.

Your output should appear as follows:

1 (4.550%) : *****
2 (32.123%) : ********************************
3 (23.623%) : ************************
4 (8.322%) : ********
5 (3.484%) : ***
6 (10.008%) : **********
7 (7.555%) : ********
8 (1.892%) : **
9 (8.443%) : ********

Your percentages should be rounded off (up or down, depending on the decimal value) to an integer to determine the number of stars in your output for each significant digit.

Obviously, the above output suggests that the underlying data does not follow Benford's law.

Assignment

Write a one-class (Benford.java) Java program with at least one method (besides main) to determine if the data in your dataset (i.e., in data.txt) follows Benford's law. Your program should generate output in the format given above. In a Word (DOCX) document, in no more than one or two sentences, state whether or not the data in your dataset more or less follows Benford's law and explain why you think so.

Name your project Benford. (This will be the name of the subdirectory of your workspace directory that will contain your source and object, or compiled, code.)

You will turn in the folder Benford (with all its files) and the Word document with your conclusions.


Attachment:- data.txt

Reference no: EM13320107

Questions Cloud

Determine the electric potential energy of the system : Three equal charges of magnitude +4.00 uC are placed at the corners of an equilateral triangle of side 2 cm. what is the electric potential energy of the system
What is the energy of the electromagnetic radiation : An electron and a positron have masses of 9.11 10-31 kg. They collide and both vanish, What is the energy of the electromagnetic radiation
How tall is the resulting image : If a lens with focal length 10 cm is placed 30 cm from an image 3 cm tall, and a cecond lens with focal length -15 cm is placed 36 cm from the image. how tall is the resulting image
Find the ratio of the particle masses : A head-on, elastic collision between two particles with equal initial speed vleaves the more massive particle (massm1) at rest. Find the ratio of the particle masses
Write a one-class java program : Write a one-class Java program with at least one method (besides main) to determine if the data in your dataset (i.e., in data.txt) follows Benford's law.
What will be the time constant of voltage decay : Draw a circuit for two resistors R1 and R2 in series, in parallel with a third resistor R3 in series with a capacitor C1. What will be the time constant of voltage decay
How fast would the particle be traveling : An alpha particle (doubly ionized He atom ) is created in a vacuum in the center between our pair of Helmholtz coils horizontal (in the xy plane), how fast would the particle be traveling
Define design storm specified for an urban area in tennessee : For a design storm specified for an urban area in Tennessee, the depth of rainfall is 2.5 inches (6.35 cm). Initial abstraction in depressions on the pervious and impervious areas was estimated at 0.5 inches (1.27 cm).
At what angle will the first order diffrection angle be : If a red laser light (He-Ne Laser) with a wavelength of 633 nm and a frequency of 4.739 *10^14 Hz, at what angle will the first order diffrection angle be

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd