Assignment 5 - Part A
A. Write a dual-side application that uses the US Census Bureau's name frequency data (see below). The scripts should allow the user to enter a first name and a last name into a form. What is returned to the user is a lookup of the first name's frequency both as a male and female first name, the frequency of the last name, and an estimate of the number of people in the United States who would share both of those names, using (imagined) up-to-the-minute population data from http://srufaculty.sru.edu/david.dailey/cs317/crudePop.htm The estimated number of people named "John Hancock" would be
(freq(male,John)*freq(male)+freq(female,John)*freq(female))*freq(Hancock)*current USpop
or
( 3.271%*48.2% + 0.012%*51.8%)*0.021% * 324,778,000 = 964
(estimated by US Census bureau's population clock at 10/24/2016 at 01:46 PM EST)
Output would be nicely structured in a manner somewhat like this:
Approximately 3.3% of males and .01% of females are named John.
Hence, about 1.58% of Americans are named John.
There are currently about the 324,778,000 Americans (estimated by US Census bureau's population clock at 10/24/2016 at 01:46 PM EST).
Hence, we predict there to be about 5139144 people named John in America.
The last name "Hancock" occurs roughly .021 percent of the time; meaning there are roughly 68,203 Hancocks in the country.
Overall, we'd expect (making the naive assumption that first and last names are distributed independently) that we have about 1079 people named "John Hancock."
Notes:
1. Three files from the US census bureau are located (on obsidian) in
/home/SRUNET/david.dailey/data$ ls -l /home/SRUNET/david.dailey/data/dis*
-rw-r--r--. 1 3107986 Sep 19 10:21 /home/SRUNET/david.dailey/data/dist_all_last
-rw-r--r--. 1 153900 Sep 19 10:21 /home/SRUNET/david.dailey/data/dist.female.first
-rw-r--r--. 1 43884 Sep 19 10:21 /home/SRUNET/david.dailey/data/dist.male.first
2. The proportion of males and females seen above (.482 and .518, respectively), are taken from data associated with the 1990 census and taken from the census bureau. You may use the same numbers in your script.