Computer Science
1. Let Σ = {0, 1} be an alphabet.
(a) Let w = 101 be a word over Σ. Compute |w|, the length of w.
(b) List all of the words in Σ3
2. Let {a, b, c} be an alphabet. List all of the words in Σ2
3. Let Σ = {a, b} be an alphabet and let · denote concatenation. Compute (ba · ε) · abb,
where ε is the empty word.
4. Let Σ = {0, 1} be an alphabet and let L ⊆ {0, 1} ∗ be the language defined as L = {w ∈ {0, 1} ∗ |w = x10y, x, y ∈ {0, 1}∗}.
(a) Determine whether 01 ∈ L.
(b) Determine whether 0101 ∈ L.
5. Let Σ = {0, 1} be an alphabet and let L ⊆ Σ ∗ be the language consisting of all words
over Σ that contain the substring 10. Construct a DFA that accepts L.
Thank you in advance
As per our guidelines, only 1 question will be answered at a time. So, please repost the remaining questions separately.
Given that,
The language contains the input alphabets Σ = {0, 1}
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps
- 1. solve a system of ordinary differential equations of first order numerically using solve_ivp. 2. generate plots after "solving" the differential equations using matplotlib.pyplot. In that tutorial, the equations of motion described the dynamics of a simple pendulum. In this problem, you will investigate the motion of a satellite orbiting the Earth. This is modelled as a two-body dynamics system. A brief outline of what you need to do in this problem set is below and that is followed by a systematic set of questions towards achieving specific objectives. You will find the tutorial a handty reference here. In this problem, you will have to first create a Python function called twobody_dynamics_first_order_EOMS. Given a time t and a state vector X, this function will return the derivatives of the state vector. Mathematically, this means you are computing X using some dynamics equation X = f(t, X). Once you have this function in Python, you can solve the differential equations it…arrow_forwardn and n+1 are integers with the same number of positive divisions. Find the integers n from 1<n<107. For example, the positive divisors of 14 are 1, 2, 7, 14, and 15 are 1, 3, 5, 15. (P.s.: You have to done it by C++.)arrow_forwardGive a recursive definition for the set of all strings of a’s and b’s that begins with an a and ends in a b. Say, S = { ab, aab, abb, aaab, aabb, abbb, abab..} Let S be the set of all strings of a’s and b’s that begins with a and ends in a b. The recursive definition is as follows – Base:... Recursion: If u ∈ S, then... Restriction: There are no elements of S other than those obtained from the base and recursion of S.arrow_forward
- e. Problem 5. Devise a function that receives a string and computes how many asterisks are in the string with a recursive method. For instance, if the input is "Able was I ere ***Elba", the function should output 3. If the input is "Peanuts", the function should return 0. Approach: Let's assume the signature of our function is countAsterisks(s) where s is the input string. In the body of your function, check if s[0] is equal to an asterisk. If the string contains only a single character and it is an asterisk, return 1. If the string contains only a single character and it is not an asterisk, return 0. If the string is longer than one character, determine if the first character is an asterisk and count it if this is the case. Then, create a new string s1 that is the same as the input string s but without the first character. Recursively call countAsterisks (s1) and return the value returned from this recursive call, plus one (if there is an asterisk in s[0]). Also, writing any explicit…arrow_forwardMust be new solution and run on GNU Common Lisp! Using Lisp, write a program that solves the Missionaries and Cannibals problem that uses a DFS( depth first search). It should use (mac start end). Start is the current state (which can be (3 3 l) and End is the goal state (which can be (0 0 r). This should output the sequences of moves needed to reach the end state from the start state. This should print nil if there is no solution. For example, the call should be something like this! Call: (mac '(3 3 l) '(0 0 r)) Output: ((3 3 l) (2 2 r) (3 2 l) (3 0 r) (3 1 l) (1 1 r) (2 2 l) (0 2 r) (0 3 l) (0 1 r) (1 1 l) (0 0 r))arrow_forwardIN VISUAL BASIC, solve Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be: 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education