Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
CUSTOMER_CODE SMUDE DIVISION_CODE SMUDE EVENT_CODE APR2016 ASSESSMENT_CODE BC0052_APR2016 QUESTION_TYPE DESCRIPTIVE_QUESTION QUESTION_ID 72467 QUESTION_TEXT Define context-free grammar. Obtain the context free grammar for the regular expression (011 + 1)*(01)*. Def: A grammar G is a quadruple G = (VN, VT, Φ, S) where VN is set of variables or non-terminals VT is set of terminal symbols Φ is set of productions S is the start symbol, is said to be type 2 grammar or context free grammar (CFG) if all the productions are of the form SCHEME OF EVALUATION A — > α where α (VN VT)* and A VN. The symbol ^ (indicating NULL string) can appear on the right hand side of any production. The language generated from this grammar is called type-2 language or context free language (CFL). (4 marks) Solution: The expression (011 + 1 )*(01 )* is of the form A*B* where A = 001 or 1 and B = 01. The regular expression A*B* means that any number of A's (possibly none) are followed by any number of B's (possibly none). Any number of A's (that is, 011 's or 1 's) can be generated using the productions A→011A | 1A | Λ Any number of B's (that is, 01's) can be generated using the productions B → 01B|Λ (3 marks) Now, the language generated from the regular expression (011 + 1)*(01)* can be obtained by concatenating A and B using the production S → AB (1 mark) Therefore, the final grammar G = (VN, VT, Φ, S) where VN: {S, A, B} VT: {0, 1} Φ: S → AB, A →011A|1a|Λ B → 01B| Λ S: start symbol. (2 marks) QUESTION_TYPE DESCRIPTIVE_QUESTION QUESTION_ID 72471 QUESTION_TEXT Use the definition of order to show that Solution: The functions f and g referred to in the definition of Onotation are defined as follows. For all real numbers and For all real numbers SCHEME OF EVALUATION Therefore, where C = 4 and k = 1. for all x > 1. Or Hence, (10 marks) for all x > k QUESTION_TYPE DESCRIPTIVE_QUESTION QUESTION_ID 72472 QUESTION_TEXT Prove that “For any finite set A, the cardinality of the power set of A is 2 raised to a power equal to the cardinality of A”. Solution: i. Basis Step: Let A be a set of cardinality n = 0. Then and on the other hand, ii. Induction Hypothesis: Let n > 0, and suppose that provided that SCHEME OF EVALUATION iii. Induction Step: Let A be such that at least one element a. Let then Since n > 0, A contains By the induction hypothesis, Now the power set of A can be divided into two parts, those sets containing the element a and those sets not containing a. The latter part is just 2B, and the former part is obtained by introducing into each member of 2B. Thus This division, in fact partitions 2A into two disjoint equinumerous parts, so the cardinality of the whole is twice 2|B|, which, by the induction hypothesis, is This completes the proof. (10 marks) QUESTION_TYPE DESCRIPTIVE_QUESTION QUESTION_ID 72473 QUESTION_TEXT If generated by G. then find L(G), the language Solution: Since is a production, . Now, for all Therefore, we can write the following: . In the above derivation, at every step, the last step where is applied. SCHEME OF EVALUATION This implies that is applied, except in Therefore, Now suppose So we should start the derivation of w with S. If we are applying first, then we will get . Otherwise, the first production that we need to apply is . However, at any stage we can apply to obtain the terminating string. Therefore w can be derived in the following form. for some Hence (10 marks) QUESTION_TYPE DESCRIPTIVE_QUESTION QUESTION_ID 110656 QUESTION_TEXT That is Define the definition of basic terms i. Simple graph and general graph ii. Isolated vertex iii. Isomorphism iv. Circuit and cycle v. Finite and infinite graph Ans: SCHEME OF EVALUATION (i) Simple graph: A graph that has neither self loops nor parallel edges is called a simple graph. Graph containing either parallel edges or loops is also referred as general graph. (ii) Isolated vertex: A vertex having no incident edge is called as isolated vertex. In otherwords, a vertex v is said to be an isolated vertex if the degree of v is equal to zero. (iii) Isomorphism: Two graphs G and G1 is said to be isomorphic to each other if there is a one-to-one correspondence between their vertices and a one-to-one correspondence between their edges such that the incident relationship must be preserved. (iv) Circuit and cycle: A path of length ≥ 1 with no repeated edges and whose endpoints are equal is called a circuit. A circuit may have repeated vertices other that the endpoints; a cycle is a circuit with no other repeated vertices except its endpoints. Finite and infinite graph: A graph G with a finite number of vertices and a finite number of edges is called a finite graph. A graph ‘G’ that is not a finite graph is said to be an infinite graph. QUESTION_TYPE DESCRIPTIVE_QUESTION QUESTION_ID 110658 Define each of the following with an example. a. Subset b. Union c. Cartesian product d. Power set e. Equal sets QUESTION_TEXT a. Subset: A is a subset of B if every element of A is also an element of B. SCHEME OF EVALUATION Ex: IF A={1, 2, 3}, B={1, 2, 3, 4}, then A⊆B b. Union: IF A and B are two sets, then the set {x|x∈A or x∈B or both} is union of A and B. Ex: If A={1, 2, 3}, B={3, 4, 5} then A∪B={1, 2, 3, 4, 5} c. Cartesian product: If S and T are two sets, then the set {(s, t)|s∈S and t∈T} is called the Cartesian product of S and T. Ex: If X={a, b}, Y={x, y}, then X×Y={(a, x), (a, y), (b, x), (b, y)} d. Power set: Let A be a set. The set of all subsets of A is called the power set of A. Ex: If A={1, 2}, then P(A)={∅, {1}, {2, }, {1, 2}} e. Equal sets: Two sets A and B are said to be equal if A is a subset of B and B is a subset of A. Ex: A={1, 2}, B={1, 2}, then A=B (Each definition with example carries 2 marks)