   Chapter 12.1, Problem 38ES ### Discrete Mathematics With Applicat...

5th Edition
EPP + 1 other
ISBN: 9781337694193

#### Solutions

Chapter
Section ### Discrete Mathematics With Applicat...

5th Edition
EPP + 1 other
ISBN: 9781337694193
Textbook Problem
1 views

# In 31—39, write a regular expression to define the given set of strings. Use the shorthand notations given in the section whenever convenient. In most cases, your expression will describe other strings in addition to the given ones, but try to make your answer fit the given strings as closely as possible within reasonable space limitations. 38. All telephone numbers that have three digits, then a hyphen. then three more digits, then a hyphen, and then four digits, where the first three digits are either 800 or 888 and the last four digits start and end with a 2.

To determine

Write a regular expression to define the given set of strings. Use the shorthand notations given in the section when ever convenient. In most cases, your expression will describe other strings in addition to the given ones. but try to make your answer fit the given strings as closely as possible wïthin reasonable space limitations.

All telephone numbers that have three digits, then a hyphen, then three more digits, then a hyphen, and then four digits, where the first three digits are either 800 or 888 and the last four digits start and end with a2.

Explanation

Given information:

All telephone numbers that have three digits, then a hyphen, then three more digits, then a hyphen, and then four digits, where the first three digits are either 800 or 888 and the last four digits start and end with a2.

Concept used:

The first three digits are either 800 or 888 and the last four digits start and end with a2.

Calculation:

The set of strings has 3 digits, a hyphen, 3 digits, another hyphen, and 4 more digits.

The objective is to write corresponding regular expression using shorthand notation.

The number digits can be denoted with ttie character class =[0|1|.......|9]

The three digits can be denoted as  or {3}

The first 3 digits are either 800 or 888, so write (800|888)

### Still sussing out bartleby?

Check out a sample textbook solution.

See a sample solution

#### The Solution to Your Study Problems

Bartleby provides explanations to thousands of textbook problems written by our experts, many with advanced degrees!

Get Started 