Code for average degree of theta graphs

There are two different Mathematica notebooks, one for the even case and one for the odd case.

You may email the author if you have questions, but it will be hard for him to answer, since he no longer has access to the Mathematica software that reads these notebooks.