1. Define each of the following functions without using high-order functions.
  2. Write a program to generate all perfect numbers between 1 and 100. A perfect number is a positive integer that is equal to the sum of its proper divisors. For example, 6(=1+2+3) is a perfect number.
  3. Assume a set is represented as a list without duplicates. Define the following functions on sets:
    1. contains(X,S): X is a member of S.
    2. proper_subset(S1,S2): S1 is a proper subset of S2.
    3. disjoint(S1,S2): S1 and S2 are disjoint.
    4. union(S1,S2): the union of S1 and S2.
    5. intersection(S1,S2): the intersection of S1 and S2.
    6. difference(S1,S2): the difference of S1 and S2.
  4. Consider the following type definition for binary trees of integers:
    type Tree =
       | Void
       | Leaf of int
       | Node of int*Tree*Tree
    
    Define the following predicates:
    1. contains(T,X): T contains a node with the value X.
    2. count(T): the number of nodes in T.
    3. leaves(T): A set of all leaves in T.
    4. inorder(T): the in-order traversal of the nodes in T.
  5. Define each of the following functions using high-order functions.
  6. Find a DFA (Deterministic Finite Automaton) and write a program in F# to simulate it.