Question: 1. Write a program in S (using macros freely) that computes the function fx) 3x. 2. write the program without using macros for question 1.

1. Write a program in S (using macros freely) that computes the function fx) 3x. 2. write the program without using macros for question 1. 3. Let fCx) if x s even; f(x) 0 if x is odd. Write a program in9 4. Let f(x) 1 if x is even; f(x) undefined if x is odd. Write a program 5. Let f(x,)-1 if x! =; f(x, , xj) = 0 if x1 *x2. Without using 6. Let f(x) be the greatest number n such tha n2 sx. Write a program 7. Let ged(x,, x2) be the greatest common divisor of x, and x2. Write a that computes f. in that computes f macros, write a program in that computes f. in that computes f. program in that computes gcd. Textbook :Computability,Complexity, and Languages Author: Davis, Sigal, Weyuker Chapter 2 Exercise 1. Write a program in S (using macros freely) that computes the function fx) 3x. 2. write the program without using macros for question 1. 3. Let fCx) if x s even; f(x) 0 if x is odd. Write a program in9 4. Let f(x) 1 if x is even; f(x) undefined if x is odd. Write a program 5. Let f(x,)-1 if x! =; f(x, , xj) = 0 if x1 *x2. Without using 6. Let f(x) be the greatest number n such tha n2 sx. Write a program 7. Let ged(x,, x2) be the greatest common divisor of x, and x2. Write a that computes f. in that computes f macros, write a program in that computes f. in that computes f. program in that computes gcd. Textbook :Computability,Complexity, and Languages Author: Davis, Sigal, Weyuker Chapter 2 Exercise
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
