A family wants to go on a holiday but they have difficulty deciding where.

- The family members that do travel are going to the same place and stay in the same accommodation.
- They can either stay in a hotel or on a camping site.
- The son will only join them if they stay in a hotel.
- All hotels in Greece that they can afford are already booked out.
- If they go to Italy, the father won't join them.
- The mother will only travel if the daughter travels as well.
- Both of the parents must travel because they are paying for the tickets.
- The travel agent only offers trips to Italy or Greece.

1.2) Write Python/SymPy code that implements two recursive functions according to the following description:

A triangular number is the number of dots in an equilateral triangle evenly filled with dots. The nth triangular number is equivalent to the sum of the integers from 1 to n. (For example, the first 5 triangular numbers are 1, 3, 6, 10, 15). Write a recursive function that calculates the nth triangular number.

A tetrahedral number is the number of dots in a pyramid with a triangular base and three sides that is evenly filled with dots. The nth tetrahedral number is the sum of the first n triangular numbers. (For example, the first 5 tetrahedral numbers are 1, 4, 10, 20, 35). Write a recursive function that calculates the nth tetrahedral number (using the function for triangular numbers).

(This data was derived from the list of publications of the Centre of Distributed Computing & Security. The author.csv file contains author names and the years in which they published papers. The coauthor.csv file contains authors and their co-authors. The author on the left is the first author of a paper; the one on the right is a co-author.)

2.1.1) Using Excel, calculate measures of central tendency (mode, median, arithmetic mean, geometric mean) and of dispersion (variance, standard deviation) for the author.csv data. The data may require some preprocessing, e.g. calculation of frequencies, first. Calculate only those measures that are appropriate and meaningful for the type of data. Also, produce a chart (diagram) of the data. For your answer, provide the values and print the chart. Write a couple of sentences explaining why certain measures are meaningful or not meaningful for this data.

2.1.2) Using NetworkX, calculate the PageRanks for both data sets and determine whether any of the two data sets is a small-world network. Your answer should include the code; the nodes with the highest PageRank and an answer to the question about small-world networks.

2.1.3) Produce a gif file for the non-bipartite graph using NetworkX and a concept lattice for the bipartite graph using ConExp. Choose a good layout for the gif file and make sure that there are not any overlapping nodes/labels in the concept lattice. Print the pictures and write a couple of sentences explaining/analysing the graphs.

Challenge: the average clustering coefficient used for determining small-world networks is not meaningful for bipartite graphs (why?). Write a Python script which calculates a clustering coefficient for bipartite networks that is at least somewhat meaningful. Test your script on the data from Part 2.

A basic solution for this problem can be developed with what you learned in this class and with looking for suitable functions in NetworkX. You should not need to use materials from the web for this, but you are allowed to use web materials if you want. If you are using web materials, you must include a list of URLs of the materials that you used.

- A PDF of your answers should be emailed to u.priss@napier.ac.uk
- Please include all your Python code and screenshots of your results, the excel spreadsheet, etc as appropriate.

You should change the permission of your files on the server (by using chmod 600 filename) so that others can't read them.

If you have mitigating circumstances, you should discuss this with your Programme Leader who might give you an extension. But extensions of more than 2 weeks are not accepted by the module leader, even if your Programme Leader signs this. If you have severe mitigating circumstances then you must go through the official mitigating circumstances process and submit your coursework at the resit diet.

If you don't demonstrate a Part of your coursework, the mark for that Part will be capped at 40%.

You can reach a total of 50 points for the coursework. This is 100% of your final mark. The points will be distributed as follows:

1.1 logic | 10 points |

1.2 recursive function | 10 points |

2.1.1 statistical measures | 7 points |

2.1.2 PageRank/small-world | 7 points |

2.1.3 pictures | 6 points |

Challenge | 10 points |