Question: Here is the question relating to regular expression: (b) Marvellous Marketing has some company rules about mobile phone numbers. While such numbers can be any
Here is the question relating to regular expression:

(b) Marvellous Marketing has some company rules about mobile phone numbers. While such numbers can be any nonempty sequence of digits, there are certain subsequences of numbers which are forbidden, and certain others that are particularly favoured. 0 Forbidden numbers include any which contain 911, 666 or a sequence of at least 4 consecutive 8's. 0 Favoured numbers include any that contain 55, 77 or at least 3 8's (in any order). i. Show there is an overlap between forbidden and favoured numbers by giving three examples of numbers which are both. ii. Give a regular expression for favoured numbers. iii. Give a regular expression for forbidden numbers. iv. If R1 is a regular expression for favoured numbers and R2 is a regular expression for forbidden numbers, give a regular expression for a non empty sequence of numbers, each of which is either forbidden or favoured. v. Marvellous Marketing announces that all numbers which are neither for bidden nor favoured are ordinary. Does a regular expression exist for ordinary numbers? Justify your answer (but there is no need to explicitly construct such a regular expression, if it exists)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
