|
@@ -59,7 +59,7 @@ Benford’s Law, named for physicist Frank Benford, who worked on the theory in
|
59
|
59
|
---
|
60
|
60
|
|
61
|
61
|
|
62
|
|
-### How to use Benford's Law to spot bogus data
|
|
62
|
+### How to Use Benford's Law to Spot Bogus Data
|
63
|
63
|
|
64
|
64
|
|
65
|
65
|
In this laboratory experience you will use Benford's Law applied only to the leading digit. To do this, you need to determine the frequency of each leading digit in the numbers of the file. Suppose that you are given a file that contains the following integer numbers:
|
|
@@ -101,7 +101,7 @@ After reading through all the data, the content of each array element will be th
|
101
|
101
|
|
102
|
102
|
---
|
103
|
103
|
|
104
|
|
-### Frequency of occurrence
|
|
104
|
+### Frequency of Occurrence
|
105
|
105
|
|
106
|
106
|
The **frequency of occurrence** is defined as the ratio of times that a digit appears divided by the total number of data. For example, the frequency of leading digit `1` in the example would computed as $$9 / 20 = 0.45$$. **Histograms** are the preferred visualization of frequency distributions in a data set. In essence, a histogram is a bar chart where the $$y$$-axis is the frequency and a vertical bar is drawn for each of the counted classifications (in our case, for each digit).
|
107
|
107
|
|
|
@@ -133,7 +133,7 @@ The **frequency of occurrence** is defined as the ratio of times that a digit ap
|
133
|
133
|
|
134
|
134
|
|
135
|
135
|
|
136
|
|
-## Reading data from text files in C++
|
|
136
|
+## Reading Data From Text Files in C++
|
137
|
137
|
|
138
|
138
|
This laboratory experience requires you to read data from a text file. You can skip the next section if you feel that your file reading skills are competent. Otherwise, read on...
|
139
|
139
|
|
|
@@ -273,7 +273,7 @@ Here are some code snippets for common reading tasks. Observe that all of them:
|
273
|
273
|
|
274
|
274
|
##Laboratory session
|
275
|
275
|
|
276
|
|
-###Exercise 1: Understand the data files and the provided code
|
|
276
|
+###Exercise 1: Understand the Data Files and the Provided Code
|
277
|
277
|
|
278
|
278
|
####Instructions
|
279
|
279
|
|