Question

Define a recursive function SINGLETONS such that if e is any list of numbers and/or symbols then (SINGLETONS e) is a set that consists of all the atoms that occur just once in e. Examples: (SINGLETONS ( ))-> NIL (SINGLETONS (G A B C B))-> (G A C) SINGLETONS (H G ABCB))(HGAC) (SINGLETONS (AGABC B)) (G C) SINGLETONS (B GA BCB))(GAC) [Hint: When e is nonempty, consider the case in which (car e) is a member of (cdr e), and the case in which (car e) is not a member of (edr e).]
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Recursive function is a function that either calls itself or it is in a potential cycle of function call. It is the function which calls itself during the execution. It enables the function to repeat itself several times outputting the result at the end of each iteration.There are two types of potential function. Singleton set have one and only one element. If one and only one member is called again and again then it is called recursive function SINGLETON. Singleton is also known as unit set.

S={Q} with an element Q.

B={x:x is neither composite nor a prime number} = {1}; having one single element 1 in it.

properties of singleton set:-

(i) If {a} be a singleton set, then {a} != a.

(ii) Ordered pair is said to be a set having two elements. It will be denoted by two distinct elements x and y as A={x,y}. Then the A will be called singleton. if x=y; i.e. A ={x=y}.   

in above example (SINGLETONS'(H G A B C B)) => (H G A C)

in this the element B is not in the set element because the B is repeated so it has being removed from the final set.

(SINGLETONS'(B G A B C B)) => (G A C)

In this also the element B is not there in the final set because B is repeated more than one time.

Add a comment
Know the answer?
Add Answer to:
Define a recursive function SINGLETONS such that if e is any list of numbers and/or symbols...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT