ASSIGNMENT 1  DUE Thursday February 21st
___________________________________

1. Write a predicate, palindrome, which returns true if a given
list is a palindrome.

?-palindrome([a,b,c,b,a]).
  true
?-palindrome([a,b,c]).
  false


2. Write a predicate, exists, which when given a list L,
   a variable X, and an integer n, binds X  to the nth
   element of the list or to -1 if such an element does not exist.

   For example:

   ?-exists( [a,b,n,c,e], X, 4).

   X=c;
   no

   ?-exists( [a, b, c], A, 5).

   A=-1;
   no


3. Write the predicate, intersection, which computes the set 
theoretic intersection of two lists without duplicates. For example,

?-intersection( [a, b, c, a, d], [c, a,c, g], Y).

returns the list Y=[a,c]; no 4. Write a Prolog procedure to check if a list is in ascending or descending order. ?ordered([3,4,7]). yes ?ordered([6,4,2]). yes ?ordered([2,6,4,9]). no 5. Write a Prolog predicate, merge, to merge two sorted lists, which are both either ascending or descending. (the resulting list is also sorted in the same manner) ?merge([2,5,7],[4,5,6,8],M). M=[2,4,5,5,6,7,8]; no 6. This problem is a scheduling problem. The task is to match job applicants to a specific job. The requirements for the job are: At least three years' experience. A Bachelor's and a Master's degree. An average of two years per previous position overall to prove stability. Willingness to work overtime or to travel. Both are not necessary. Very good or excellent health. Use the following data set of applicants as a test bed: (a) Name: Jones Previous jobs, years on job: CAT --- 5 years IBM --- 4 years CILCO--- 1 year AIONICS---1 year Degrees: BS and MS Overtime= no, Travel =yes, Health=excellent (b) Name: smith Previous jobs, years on job: BORDOM ---8 years Degrees: BS Overtime: yes, Travel: yes, Health: good (c) Name: smart_allec Previous jobs, years on job: DELCO---1year MOTOROLLA---1 year LOGICON---1 year Degrees: BS, MS, PHD Overtime: no, Travel: no, Health: very good 7. Implement in Prolog the query answering system given in the book about investing based on investor's risk classification, but make the knowledge base more complex and instead of having numerous ask predicates-one per each independent variable- use a generalized ask-predicate to avoid duplication of questions issued to the user. (decision tree and example is on page 289) END OF ASSIGNMENT 1 ____________________________________________________________ ASSIGNMENT 2 PART 1: Use a neural network off the selve package, to build a Multilayered, feedforward, back propagation neural net for the data set given below. Inputs are speed and distance and output the amount of turn. Experimentation will determine the best architecture for the net. Provide hard copy listing: the architecture, activation functions and learning algorithm that you used, the weight set after training, the training and testing data sets that were used, and the training and testing errors of your best network model. PART 2: You are to use the JFS Fuzzy Logic System to implement a fuzzy controler which determines the amount of left or right turn of the automobile driving wheel (in degrees), in order for the automobile to follow a contour. The input fuzzy variables are speed of the automobile and the difference between the distances to the contour between the front of the automobile and the rear. Use experimentation to design the most appropriate fuzzy sets and membership functions, and test accuracy of your system at the end by using the same error function that you used in PART 1. PART 3: Compare the NN model that you built with the fuzzy model. Which is more accurate? Can you explain why? Data set for both parts: A run by a human driver yielded these sensor measurements: speed distance turn 10 +5 15 50 +5 30 10 +20 40 50 +20 60 15 -5 -15 50 -5 -30 15 -20 -43 50 -20 -65 70 +5 20 70 +20 39 70 -5 -24 70 -20 -55 _________________________________________________________________________________