ordered_structures_flashcards
What is an ordered structure?
A collection of elements where order matters.
How do ordered structures differ from sets?
In ordered structures, element arrangement matters, whereas in sets, order is irrelevant.
What is an n-tuple?
An ordered list of n elements.
How is a tuple different from a set?
A tuple considers order, while a set does not.
Give an example of a 3-tuple.
(a, b, c) where order is important.
What is a list?
A sequence of elements where duplicates and order are allowed.
What is the difference between a list and a tuple?
Lists are often used dynamically in programming, while tuples are fixed-size ordered structures.
Give an example of a list.
[2, 3, 5, 7] (a list of prime numbers).
What is a string?
A sequence of characters.
What is an example of a string?
“hello” is a string with five characters.
What is a formal language?
A set of strings following specific rules.
What is a relation?
A set of ordered pairs (a, b) where a is related to b.
Give an example of a relation.
“is less than” on natural numbers: (2,3), (3,5), etc.
What are common properties of relations?
Reflexivity, symmetry, transitivity.
How many 2-tuples can be formed from a set with 3 elements?
If order matters, there are 3 × 3 = 9 possible tuples.
How many 3-tuples can be formed from a set {a, b, c}?
3 × 3 × 3 = 27 different 3-tuples.
What are key takeaways about ordered structures?
Tuples, lists, and strings have fixed order, relations define relationships, and counting tuples depends on available choices.