You may wish to refer to the Power-laws “Scale free” networks and the Generating and Fitting Power Law Distributions in Matlab to figure out how to complete the tasks.

Generate 100,000 random integers from a power law distribution with exponent alpha = 2.1

- What is the largest value in your sample? Is it possible for a node in a network to have a degree this high (assuming you don't allow multiple edges between two nodes)?
- Construct a histogram of the frequency of occurrence of each integer in your sample.
Pajek will let you calculate the degree of each individual node (
`Net > Partitions > Degree > All`). Then, export the partition as a '.clu' file by clicking on the save icon to the left of the partitions drop-down select menu. Now, you can import it into Excel or another program and histogram it. Try both a linear scale plot and a log-log scale plot. - What happens to the bins with zero count in the log-log plot?
- Try a simple linear regression on the log transformation of both variables.
In Matlab, you can plot two data sets together as follows:
`plot(x1,y1,'r-',x2,y2,'b:')`. This will plot y1 vs. x1 as a red solid line, and y2 vs. x2 as a blue dotted line. (If you are using the fitlineonloglog.m Matlab script, you will feed it the binned data, and it will take the log of the x and y for you before doing a linear fit). What is your value of the power-law exponent alpha? Include a plot of the data with the fit superimposed. - Now exponentially bin the data and fit with a line. What is your value of alpha?
- Finally, do a cumulative frequency plot of the original data sample. Fit, plot, and report on the fitted exponent and the corresponding value of alpha.
- Which method was the most accurate? Which one, in your opinion, gave the best view of the data and the fit?

Open the NetLogo applet:
Click on '`setup`' to start out with a cycle of 5 vertices.
Click on '`Run`' to add vertices one by one, each with m edges. Play with the m and gamma parameters.

- Select m=1 and gamma=0. Add 300 vertices. Click on the '
`resize nodes`' button to size the vertices by their degree. Repeat the same, but with m = 1 and gamma = 1. What differences do you observe between the two networks, e.g. in terms of appearance, the number of vertices with degree 1, and the maximum degree of any vertex? - Generate two networks with 1000 vertices and m = 4. (You can run this faster by adjusting the speed slider at the top.) For one network select gamma = 0, and for the other gamma = 1. Which degree distribution looks more like a power law?

Submission of your homework is via WebCampus. You must submit all the required files in a single tar or zip file containing all the files for your submission.

Acknowledgement: The assignment is modified from Lada Adamic.