CHAPTER 3 Flashcards

(23 cards)

1
Q

T/F An alphabet Σ is a finite set of symbols

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

………………is a finite sequence of symbols from
a given alphabet (Σ).

A

A string (or word)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
A

DONE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

T/F means joining two strings together in order.

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

T/F If Σ = {a, b, c, . . . , z} and u = ab, v = ra and w = cad,
then
* vu = raab
* uu = abab
* wv = cadra
* uvwuv = abracadabra

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

…………means writing the string in the opposite
order

Example:
* If w = “hello”, then wᴿ = “olleh”.

A

Reverse of a string

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

………. For any string w and natural number n, the string
wⁿ means repeating w exactly n times through concatenation

If w = “hi” and n = 3, then w³ = “hihihi”.

A

Replication

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

………..The length of a string s, denoted as |s|, is the total
number of symbols (characters) in the string.

Ahmad| = 5 (The string “Ahmad” has 5 letters)

A

Length

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

…………………A string with no letters is
⚫ length of empty string is zero:
⚫ Concatenation with an empty string does not change a string:
For any string s, sλ = s and λs = s
Example: “hello” λ = “hello” and λ “world” = “world”. 

A

EMPTY

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

……….w is any continuous sequence of characters within w

If w = “football”, possible substrings include:
* “foot”
* “ball”
* “ootb”
* “tba”
* “all”

A

substring

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

T/F Every string is a substring of itself.

The empty string is a substring of every string.

A substring must preserve the original order of characters. (e.g.,
“otbl” is not a substring of “football”).

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

T/F A string p is a prefix of a string t if t starts with p and may contain extra
characters afterward.

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

T/F Proper Prefix:
A string p is a proper prefix of t if p is a prefix of t but is not equal to t
(i.e., p is shorter than t).

Example:
t = “hello”
* Prefixes: ” “, “h”, “he”, “hel”, “hell”, “hello”
* Proper Prefixes: ” “, “h”, “he”, “hel”, “hell” (excluding “hello” itself)

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Important prefixes in important notes?

A
  1. Every string is a prefix of itself → (e.g., “hello” is a prefix of “hello”).
  2. The empty string (λ) is a prefix of every string → (e.g., “” is a prefix of “computer”).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

T/F A string s is a suffix of a string t if t ends with s and may have additional
characters before it.

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

T/F A string s is a proper suffix of t if s is a suffix of t but is not equal to t (i.e., s is
shorter than t).

17
Q

Important Suffixes in important notes?

A
  1. Every string is a suffix of itself.
  2. The empty string (λ) is a suffix of every string.
18
Q

………….. Represents the set of all possible strings (including the
empty string) that can be formed from a given alphabet Σ.

A

The * Operation

19
Q

……….. is a collection of distinct elements or objects.

20
Q

T/F – A ⊆ B (A is a subset of B)
– A ⊂ B (A is a proper subset of B)

21
Q

T/F ⚫ Set Membership (∈):
* If a∈A it means a is an element of set A
⚫ Cardinality of a Set (|A|):
* The number of elements in a set.
* Example: For A= {1,2,3} the cardinality is ∣A∣=3.
⚫ Complement of a Set (A’):
* The set of all elements not in set A
* Example: If U={1,2,3,4} and A={1,2}, then A′={3,4}

22
Q

……………. It is a subset of Σ*, meaning it consists of some (or all) possible strings over Σ.