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.
Define a recursive function SINGLETONS such that if e is any list of numbers and/or symbols...
In Lisp 2. Code the function (replaceIn list possibleList repValue) which constructs a new list. It examines list for occurrences of any of the atoms from the possibleList. Those are replaced with repValue. This only examines the top-level items in list. Example: > (replaceIn '(P A T T E R) '(T R) 'S) (P A S S E S) 3. Code the function (insertAfter list atm insValue) which constructs a new list by inserting the specified insValue into the list...
2. Assume the group G acts on the set S. For E S, define Then G is a subgroup of G , which is called the stabilizer of r. The set is called the orbit of r (a) Consider the map ф' G S, defined by фг (g) :-9-x. Prove that there is one map (and only one) : G/G, S such that Vz ยู่'z q (where q: G -G/G, is the quotient map). (b) Prove that is injective. (Hint:...
3. In this problem we consider only functions defined on the real numbers R A function f is close to a function g if r e Rs.t. Vy E R, A function f visits a function g when Vr E R, 3y E R s.t. For a given function f and n E N, let us denote by fn the following function: Below are three claims. Which ones are true and which ones are false? If a claim is true,...
We have the symbols A, B, C, D, E, F, G, H with frequencies 1, 1, 2, 4, 8, 16, 32, 64. Show the Huffman tree and Huffman code for the symbols. How much compression does a 1000 digit file use when using this Huffman code based on an 8-bit ASCII code (ie, ISO 8859-1)?
2. Assume the group G acts on the set S. For E S, define Then G is a subgroup of G , which is called the stabilizer of r. The set is called the orbit of r (a) Consider the map ф' G S, defined by фг (g) :-9-x. Prove that there is one map (and only one) : G/G, S such that Vz ยู่'z q (where q: G -G/G, is the quotient map). (b) Prove that is injective. (Hint:...
In this problem we consider only functions defined on the real numbers R. A function f is close to a function g if 3r E R s.t. Vy R, A function f visits a function g when Vz E R,3y E R s.t. < y and lf(y)-g(y)| < We were unable to transcribe this imageBelow are three claims. Which ones are true and which ones are false? If a claim is true, prove it. If a claim is false, show...
In this problem we consider only functions defined on the real numbers R. A function f is close to a function g if 3x E R s.t. Vy E R, A function f visits a function g when Vz E R, R s.t. a<y and f() -g) For a given function f and n E N, let us denote by n the following function: n(x)-f(x)+2" Below are three claims. Which ones are true and which ones are false? If a...
Consider R4 as an inner product space with the following inner product : < (a,b,c,d), (e, f, g, h) >= ae + bf + .cg + gdh. Determine all the vectors orthgonal to both (1, 2, 8, 8) and (0,0,4, -8) in this inner product space. Hint: To do this take a general element from R4 and calculate its inner product with both these vectors separately. This should result in a system of two equations which you can then solve.
Sequences of numbers are a useful mathematical tool for exploring transitions and trends. Sequences of symbols create words, and sequences of words create languages, both Human and Computer. While sequences of nucleotides create DNA, which in turn create new sequences of nucleotides called RNA, which in turn creates sequences of amino acids called proteins, which in turn create, among other things, humans that create, among other things, computers. The quest to identify this “Source Code of Life” quickly became the...
Define a function called max_association(), which recieves 2 lists, lst1, which is a list of strings, and lst2, which is a list of integers. The function must return a list of strings associated to the highest integers in lst1. Assume both lists have the same length As an example, the following code fragment: L1 = ['a','b','c','d','e','f','g','h','i','j'] L2 = [1,2,3,1,3,2,3,1,2,1] result = max_association(L1,L2) print(result) should produce the output: ['c', 'e', 'g']