Question: Consider the (decimal) languages defined below. For each one, either give a regular expression for its elements or prove the language is non-regular: In all
Consider the (decimal) languages defined below. For each one, either give a regular expression for its elements or prove the language is non-regular:
In all examples, a number cannot start with a 0 (unless it is 0 itself): e) Le = { w | as an integer w is such that the sum of its digits is a multiple of 2 }. f) Lf = { w | as an integer w is a power of 2 }. g) Lg = { w | as an integer } (with SUM = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -}). h) Lh = { w | w is the decimal representation of a rational number}. (with SUM = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -, ., [,]}) Examples of such strings are 0.[3] representing the number 0.3333...=1/3 and -23.15[24] representing the number -23.152424242424...=-76403/3300.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
