ERASED TEST, YOU MAY BE INTERESTED ON Grammars, regexes and more
COMMENTS | STATISTICS | RECORDS |
---|
TAKE THE TEST
Title of test:
Grammars, regexes and more Description: that would be telling Author: EYEDOL Other tests from this author Creation Date: 30/08/2024 Category: Computers Number of questions: 17 |
Share the Test:
New Comment
No comments about this test.
Content:
Consider the following automaton.
Select the alternative that presents the regular expression that generates the same language recognized by the
automaton.
a) (ab)c∗ b) (a|b)c∗ c) a(b|c)∗ d) a(bc)∗ e) a(b)∗c. → num E → E + E E → E − E About this grammar, assign T (true) or F (false) to the following statements. ( ) It is ambiguous. ( ) It is LL(1). ( ) It is LR(1). ( ) It is SLR. ( ) It has left recursion. Select the alternative that contains, from top to bottom, the correct sequence. a) T, T, F, F, T. b) T, F, T, T, F. c) T, F, F, F, T. d) F, T, T, F, F. e) F, T, F, T, F. Consider the following grammar. A → a A → C B A B → B → b C → B C → c About this grammar, mark the correct alternative. a) The FIRST set of B is {b, c}. b) The FIRST set of C is {a, b}. c) The FOLLOW set of A is empty. d) The FOLLOW set of C is empty. e) The FOLLOW set of B is {a, b}. If the initial state is also the final state in a finite automaton, then this automaton a) does not accept the empty string. b) has no other final states. c) is deterministic. d) accepts the empty string. e) is nondeterministic. Consider the following automaton. About this automaton, consider the following statements. I. States 3 and 7 are equivalent. II. States 4 and 6 are equivalent. III. States 1 and 5 are equivalent. IV. States 2 and 8 are equivalent. Select the correct alternative. a) Only statements I and II are correct. b) Only statements I and IV are correct. c) Only statements III and IV are correct. d) Only statements I, II and III are correct. e) Only statements II, III and IV are correct. Regarding the search techniques used in artificial intelligence, consider the following statements. I. A genetic algorithm is a stochastic hill climbing search in which a large population of states is maintained. New states are generated by mutation and crossover, which combines pairs of states from the population. II. Breadth-first, depth-first and uniform-cost search are special cases of best-first search. III. The A∗ search expands nodes with a minimum value for f(n) = g(n) + h(n) . A∗ is complete and optimal, provided that it can be guaranteed that h(n) is admissible. IV. Local search methods such as hill climbing operate on complete state formulations, keeping in memory the entire path of nodes traversed in the search tree. Select the correct alternative. a) Only statements I and II are correct. b) Only statements I and IV are correct. c) Only statements III and IV are correct. d) Only statements I, II and III are correct. e) Only statements II, III and IV are correct. Regarding the concepts of verification and types of a programming language, consider the following statements. I. Type checking is the activity of ensuring that the operands of an operator are of compatible types. A compatible type is one that is valid for the operator or is allowed, according to the rules of the language, to be converted by the code generated by the compiler to a valid type. II. It is better to detect errors during execution than during the compilation of a program, since the compilation process of an algorithm must give priority to more complex issues of the semantic analysis of the program. III. When a language allows a given memory cell to store values of different types at different times during execution, type checking becomes unnecessary, since there is no way to perform type control in different iterations of the algorithm. IV. If all bindings of variables to types are static in a language, type checking can almost always be done statically. Dynamic type binding requires checking of types at runtime, which is called dynamic type checking. Select the correct alternative. a) Only statements I and II are correct. b) Only statements I and IV are correct. c) Only statements III and IV are correct. d) Only statements I, II and III are correct. e) Only statements II, III and IV are correct. Consider the following algorithm. MERGESORT(V, i, j) (1) If (i<j) then (2) m = (i+j)/2; (3) MERGESORT(v, i, m); (4) MERGESORT(v, m+1, j); (5) MESCLAR(v, i, m, j); (6) End; Regarding the asymptotic behavior of the Merge Sort algorithm, select the alternative that correctly presents its complexity. a) O(log n) b) O(n log n) c) O(n2) d) O(n3) e) O(2n). Regarding the appropriate choice for a sorting algorithm, consider the following statements. I. When worst-case scenarios are the concern, the ideal algorithm is Heap Sort. II. When the vector has most of the elements sorted, the ideal algorithm is Insertion Sort. III. When the concern is a good result for the average case, the ideal algorithm is Quick Sort. IV. When the concern is the best case and the worst case of the same complexity, the ideal algorithm is Bubble Sort. Select the correct alternative. a) Only statements I and II are correct. b) Only statements I and IV are correct. c) Only statements III and IV are correct. d) Only statements I, II and III are correct. e) Only statements II, III and IV are correct. Regarding the analysis of algorithms, consider the following statements. I. Dynamic programming can lead to efficient solutions for recursive algorithms with exponential complexity. II. Trial and error algorithms are impractical with recursive solutions, since they are applied exhaustively. III. A recursive algorithm has a shorter execution time than iterative coding for solving the same problem. IV. A binary search tree is suitable for solving problems of a recursive nature. Select the correct alternative. a) Only statements I and II are correct. b) Only statements I and IV are correct. c) Only statements III and IV are correct. d) Only statements I, II and III are correct. e) Only statements II, III and IV are correct. A support analyst noticed that the company's file server was slow at certain times of the day. Indicate the alternative that correctly and respectively presents a plausible cause and its optimal solution. a) Inefficient disk scheduling algorithm, which should be replaced by another algorithm. b) Appearance of thrashing phenomenon, which should limit the number of simultaneous users. c) Appearance of thrashing phenomenon, which should increase the amount of memory on the server. d) Appearance of burst phenomena, which should separate the services offered among more than one server. e) Appearance of burst phenomena, which should limit the number of simultaneous users. Regarding Computer Graphics, consider the following statements. I. Given a triangle mesh that approximates a sphere, the smoothness of the lighting generated by the Gouraud algorithm depends on the resolution of the mesh. II. In parallel projection, the viewing volume is rectangular. III. The Bresenham algorithm is a line rasterization algorithm. IV. The aliasing effect does not occur in the rasterization of two-dimensional triangle meshes. Select the correct alternative. a) Only statements I and II are correct b) Only statements I and IV are correct. c) Only statements III and IV are correct. d) Only statements I, II and III are correct. e) Only statements II, III and IV are correct. Election algorithms are used as a mechanism to recover the operability of some service within a distributed system. Based on this information, select the correct alternative. a) The Lamport clock is more efficient for carrying out the election because it is based on temporal relations. b) Services provided through central control do not require election mechanisms because they already determine the elected candidate. c) The Maekawa algorithm guarantees the conclusion of the election with a smaller number of messages than the Bullying algorithm. d) The Ring Election algorithm can be applied in any failure situation. e) The Bullying algorithm guarantees the definition of the election if the communication medium is reliable and sufficiently fast. Regarding regular languages, consider the following statements. I. Regular languages can be expressed by Moore and Mealy machines. II. Regular languages can be expressed by a finite automaton. III. If A and B are regular languages, then A ∩ B is also regular. IV. Let B = {ba, na}. We can say that B∗ = {λ, ba, na, ab, an, baba, bana, naba, anab, nana, aban, bababa, babana, banaba, banana, nababa, nabana, nanaba, nanana, abanba, babababa, ...}. Select the correct alternative. a) Only statements I and II are correct. b) Only statements I and IV are correct. c) Only statements III and IV are correct. d) Only statements I, II and III are correct. e) Only statements II, III and IV are correct. Machine learning can be defined as the field of Artificial Intelligence that aims to build systems that improve automatically with experience. Select the alternative that correctly presents techniques and/or algorithms characteristic of the area of machine learning. a) Backtracking, Fuzzy Logic and Genetic Algorithms. b) Q-learning, Backtracking and Quicksort. c) Q-learning, Sarsa and Backpropagation. d) Hopfield Networks, Fuzzy Logic and Simulated Annealing. e) Simulated Annealing, Sarsa and Hill-climbing. Genetic algorithms aim to assist in the process of solving complex problems using a method based on the evolution process found in nature: the better an individual adapts to its environment, the greater its chance of surviving and generating descendants. Regarding genetic algorithms, consider the following statements. I. The representation of the initial population is one of the phases proposed by genetic algorithms in which a set of k states, called a population, is generated. Each state (or individual) is represented as a chain over a finite alphabet. II. Genetic algorithms propose that successor states be generated by the combination of two parent states, thus storing less information in memory when compared to other search algorithms. III. The definition of the fitness function represents the phase of genetic algorithms in which each state of the initial population is evaluated through its fitness function, which determines the exact cost value of each individual. This function must be precise and accurate to truly express the value of each individual within the problem domain. IV. The crossover phase of genetic algorithms determines a crossover point, always defined randomly, so that each of the parent chromosomes has its bit string cut at the crossover point, producing two heads and two tails. The tails are exchanged, generating two new chromosomes. Select the correct alternative. a) Only statements I and II are correct. b) Only statements I and IV are correct. c) Only statements III and IV are correct. d) Only statements I, II and III are correct. e) Only statements II, III and IV are correct. read the instructions and chhose the best option a b c d e. |
Report abuse