Assignment 1

Implement the function get_relation_class(a). The function takes a set M and returns a class representing relations on M (that is a subset of MxM). The class should support the following operations and predicates: The instances of the class representing relation should be immutable. That, is after an instance is created, its state cannot be modified. The time-complexity of your function need not to be optimal but it needs to be reasonable (e.g. adding n elements to an empty relation should not take O(n^2) time). To attain this you will probably need a data structure that is reasonable efficient at making changes in immutable objects. You probably do not want to implement one, I recommend using something from Pyrsistent library)

You should write your code in Python. Send your solution to lukotka.pts@gmail.com. The first deadline is 10.3.2020 23:59:59. The deadline for reviewed solution is 17.3.2020 23:59:59. The solutions sent later will be accepted, however the number of points awarded may be reduced.