CSci 555: Functional Programming
Spring Semester 1997

Assignment #7 (Part A)
Due Wednesday, 30 April


I may choose to add a Part B to this assignment at a later date.

  1. Define and implement a Haskell function that returns the string
            1 sheep, 2 sheep, 3 sheep, ...
    
    as an aid to insomniacs.

  2. Define and implement a Haskell function for the infinite list of factorial numbers such that
            factorial = [1,1,2,6,24,120,...]
    

  3. Define and implement the Haskell function
            runningSums :: [Int] -> [Int]
    
    which calculates the running sums of a list [a0,a1,a2,a3,...] generating the list:
            [0,a0,a0+a1,a0+a1+a2,a0+a1+a2+a3,...]
    

  4. We can generalize the Hamming problem by replacing the multiples 2, 3, and 5 with a list as of positive numbers. That is, we wish to find a list in ascending order that begins with 1 such that if x is in the list and a is in as then a * x is in the list. Design and implement a Haskell program for this generalized Hamming problem


UP to CSCI 555 assignments document?


Copyright © 1997, H. Conrad Cunningham
Last modified: 14 April 1997.