Theory of Computation Flashcards

Paper 1

1
Q

What is Abstraction?

A

Abstraction is the name given to the process of omitting unnecessary details from a problem.

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

Representational abstraction

A

A representation of a problem arrived at by removing unnecessary details from the problem.

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

Abstraction by generalisation /
categorisation

A

Grouping by common characteristics to form a hierarchical relationships

e.g. “is a kind of”

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

What is information hiding

A

Hiding all non-essential details of an object that doesn’t affect its essential characteristics.

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

What is procedure abstraction?

A

Breaking down a problem into reuseable procedures, abstraction specific values.

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

What is functional abstraction?

A

Hiding the specific computation method and only focusing on the input/output of the function

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

What is data abstraction?

A

Hiding details of data representation, allowing creation of new abstract data types.

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

What is problem abstraction/reduction?

A

Simplifying a problem by removing details until it’s similar to a previously solved problem.

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

What is decomposition?

A

Dividing a complex problem into smaller, more manageable sub-problems.

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

What is composition?

A

Combining simple procedures or data types to build more complex ones (e.g. tree structure).

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

What is automation in computer science?

A

Executing abstract models using algorithms, program code, and data structures.

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

What are the main steps to achieve automation?

A
  • Create models
  • Design algorithms
  • Implement in code
  • Use data structures
  • Execute the code
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the four constructs used in pseudocode?

A

Sequence, Assignment, Selection, Iteration

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

What does sequence mean in pseudocode?

A

Instructions are carried out one after the other, in order.

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

What is assignment in pseudocode?

A

Giving a value to a variable (e.g. x ← 5).

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

What is selection in pseudocode?

A

Choosing between actions based on conditions (IF, ELSE, etc.).

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

What is iteration in pseudocode?

A

Repeating actions using FOR or WHILE loops.

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

What is hand-tracing an algorithm?

A

Manually running through an algorithm step-by-step with test data to verify correctness.

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

How do you argue for the correctness of a program?

A

Use logical reasoning, test data, and user feedback.

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

What is a Finite State Machine (FSM)?

A

A computational model with a finite number of states, transitions between states based on inputs, and optional outputs (Mealy machines).

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

What is the difference between an FSM with and without output?

A
  • Without output: Only tracks state transitions.
  • With output (Mealy): Produces an output on each transition (e.g., 1 | “a”).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

How do you represent an FSM?

A

Using a state transition diagram (circles for states, arrows for transitions) or a state transition table.

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

What happens if an FSM reaches a non-final state with no valid transitions?

A

The input is rejected.

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

What is a set?

A

An unordered collection of unique elements (e.g., {1, 2, 3}).

25
What is set comprehension?
A compact way to define a set using rules (e.g., {x | x ∈ ℕ ∧ x > 5}).
26
What is the empty set?
A set with no elements, denoted {} or Ø.
27
What is the Cartesian product of sets?
The set of all ordered pairs from two sets (e.g., {1, 2} × {a, b} = {(1,a), (1,b), (2,a), (2,b)}).
28
What is the union (∪) of two sets?
All elements from both sets, excluding duplicates (e.g., {1, 2} ∪ {2, 3} = {1, 2, 3}).
29
What is the intersection (∩) of two sets?
Elements common to both sets (e.g., {1, 2} ∩ {2, 3} = {2}).
30
What is set difference (\ or -)?
Elements in the first set but not the second (e.g., {1, 2} \ {2} = {1}).
31
What does ⊆ and ⊂ mean?
* ⊆=> Subset (all elements of A are in B). * ⊂=> proper subset (A ⊆ B but A ≠ B).
32
What is a regular expression?
A shorthand to describe a set of strings (e.g., a(b|c)* matches "a", "ab", "ac", "abbc", etc.).
33
What do these metacharacters mean?
* (*): 0 or more repetitions. * +: 1 or more repetitions. * ?: 0 or 1 (optional). * |: OR (alternation). * ( ): Grouping.
34
What is the regex for "strings starting with 0, followed by any number of 1s"?
01*.
35
How are FSMs and regular expressions related?
They are equivalent—any language defined by a regex can be recognized by an FSM, and vice versa.
36
Convert the regex (ab)+c? to an FSM.
* Start → a → b → loop back for (ab)+. * Optional c → final state.
37
What is a countably infinite set?
A set whose elements can be paired with natural numbers (e.g., integers).
38
What is the cardinality of a set?
The number of elements in a finite set (e.g., |{1, 2}| = 2).
39
What is a regular language?
A language that can be defined by a regex or recognized by an FSM.
40
What set does {0^n 1^n | n ≥ 1} represent?
{01, 0011, 000111, ...} (equal 0s and 1s).
41
What is the output of a Mealy machine for input 101 if transitions are: * S0 → S1 on 1 outputs "a", * S1 → S2 on 0 outputs "b", * S2 → S2 on 1 outputs "c"?
"a" → "b" → "c" = "abc".
42
What is a context-free language?
A set of strings defined by a context-free grammar (CFG), where production rules determine valid strings.
43
How do CFLs differ from regular languages?
CFLs can handle recursion and nested structures (e.g., balanced parentheses), which regular expressions cannot.
44
What is BNF?
A notation for defining context-free grammars using production rules (e.g., ::= a )
45
What are non-terminals in BNF?
Symbols in that can be expanded further (e.g., ).
46
What are terminals in BNF?
Literal characters/strings that cannot be expanded (e.g., a, +, 123).
47
What does the | symbol mean in BNF?
OR (alternation) ## Footnote e.g., ::= 0 | 1 | ... | 9.
48
How does BNF support recursion?
A non-terminal can reference itself ## Footnote e.g., ::= | .
49
Write BNF for a signed decimal number.
::= + | - ::= 0 | 1 | ... | 9 ::= | | . ::= |
50
What is a syntax diagram?
A visual representation of BNF rules using: * Rectangles for non-terminals. * Ovals/Ellipses for terminals. * Arrows showing valid paths.
51
How does a syntax diagram for look?
Start → (rectangle) → End. OR Start → → loop back to .
52
Draw a syntax diagram for ::= <Forename> <Surname>. </div> </div> <div class='card-face answer'> <div class='answer-content'> [Title] → [Forename] → [Surname] </div> </div> </div> <div class='flashcard-row thin-card is-blurrable' data='{"aSoundUrl":null,"cardIsBlurrable":true,"number":53,"qSoundUrl":null,"resources":{"deckId":18767696,"packId":22847297,"cardId":591614552},"returnTo":"/packs/22847297/subscribe"}' id='card-591614552'> <div class='header'> 53 </div> <div class='card-face question'> <div class='question-content'> Why can BNF represent languages that regular expressions cannot? </div> </div> <div class='card-face answer'> <div class='answer-content'> BNF supports recursion (e.g., nested parentheses), while regex cannot count/match nested structures. </div> </div> </div> <div class='flashcard-row thin-card is-blurrable' data='{"aSoundUrl":null,"cardIsBlurrable":true,"number":54,"qSoundUrl":null,"resources":{"deckId":18767696,"packId":22847297,"cardId":591614891},"returnTo":"/packs/22847297/subscribe"}' id='card-591614891'> <div class='header'> 54 </div> <div class='card-face question'> <div class='question-content'> What is a production rule? </div> </div> <div class='card-face answer'> <div class='answer-content'> A replacement rule in a grammar (e.g., a → ab means "replace a with ab"). </div> </div> </div> <div class='flashcard-row thin-card is-blurrable' data='{"aSoundUrl":null,"cardIsBlurrable":true,"number":55,"qSoundUrl":null,"resources":{"deckId":18767696,"packId":22847297,"cardId":591614958},"returnTo":"/packs/22847297/subscribe"}' id='card-591614958'> <div class='header'> 55 </div> <div class='card-face question'> <div class='question-content'> Give an example of a non-regular language. </div> </div> <div class='card-face answer'> <div class='answer-content'> {a^n b^n | n ≥ 1} (equal number of as and bs in order). </div> </div> </div> <div class='flashcard-row thin-card is-blurrable' data='{"aSoundUrl":null,"cardIsBlurrable":true,"number":56,"qSoundUrl":null,"resources":{"deckId":18767696,"packId":22847297,"cardId":591615331},"returnTo":"/packs/22847297/subscribe"}' id='card-591615331'> <div class='header'> 56 </div> <div class='card-face question'> <div class='question-content'> Convert to BNF: "A password is 1+ digits followed by a letter." </div> </div> <div class='card-face answer'> <div class='answer-content'> <Password> ::= <Digit><Letter> | <Digit><Password> <Digit> ::= 0 | 1 | ... | 9 <Letter> ::= a | b | ... | z </div> </div> </div> <div class='flashcard-row thin-card is-blurrable' data='{"aSoundUrl":null,"cardIsBlurrable":true,"number":57,"qSoundUrl":null,"resources":{"deckId":18767696,"packId":22847297,"cardId":591615539},"returnTo":"/packs/22847297/subscribe"}' id='card-591615539'> <div class='header'> 57 </div> <div class='card-face question'> <div class='question-content'> What strings does <A> ::= x <A> y | z generate? </div> </div> <div class='card-face answer'> <div class='answer-content'> z, xzy, xxzyy, xxxzyyy, ... (nested x/y pairs around z). </div> </div> </div> <div class='flashcard-row thin-card is-blurrable' data='{"aSoundUrl":null,"cardIsBlurrable":true,"number":58,"qSoundUrl":null,"resources":{"deckId":18767696,"packId":22847297,"cardId":591618138},"returnTo":"/packs/22847297/subscribe"}' id='card-591618138'> <div class='header'> 58 </div> <div class='card-face question'> <div class='question-content'> In <A> ::= x <A> y | z, why do strings like xxzyy have multiple x/y even without a + symbol? </div> </div> <div class='card-face answer'> <div class='answer-content'> The recursion acts like a loop, generating nested pairs of x and y around z. </div> </div> </div> </div> </div> </div> <div class='flashcards-sidebar'> <div class='sidebar-header'> <div class='react-component' id='flashcards-search-bar'> <div class='placeholder market-search-bar' id='flashcards-search-bar-placeholder'></div> </div> </div> <div class='sidebar-content'> <p class='deck-subject-heading'> <a class="decks-in-subject-link" href="/packs/a-level-computer-science-22847297"><span class="pack-name">A-level Computer science</span> (4 decks) </a></p> <ul class='deck-list-items'> <a class='deck-link ' href='/flashcards/fundamentals-of-programming-18763114/packs/22847297'> <li class='deck-list-item'>Fundamentals of programming</li> </a> <a class='deck-link ' href='/flashcards/fundamentals-of-data-structures-18750288/packs/22847297'> <li class='deck-list-item'>Fundamentals Of Data Structures</li> </a> <a class='deck-link ' href='/flashcards/fundamentals-of-algorithm-18764509/packs/22847297'> <li class='deck-list-item'>Fundamentals of algorithm</li> </a> <a class='deck-link selected' href='/flashcards/theory-of-computation-18767696/packs/22847297'> <li class='deck-list-item'>Theory of Computation</li> </a> </ul> </div> </div> </div> <div id='tooltip-controller'></div> <div data='{"packId":22847297,"source":"spaced-repetition-modal","subject":"A-level Computer science","resources":{"deckId":18767696,"packId":22847297},"returnTo":"/packs/22847297/subscribe"}' id='spaced-repetition-modal-controller'></div> <div id='banner-controller'></div> <div id='dialog-modal-controller'></div> <div class='band band-footer'> <div class='footer-main'> <ul class='sections'> <li class='section key-links'> <p class='section-heading'> Key Links </p> <ul class='options-list'> <li class='option'> <a id="footer-pricing-link" class="option-link" href="/pricing?paywall=upgrade">Pricing</a> </li> <li class='option'> <a class="option-link" href="/companies">Corporate Training</a> </li> <li class='option'> <a class="option-link" href="/teachers">Teachers & Schools</a> </li> <li class='option'> <a class="option-link" target="_blank" rel="nofollow noopener noreferrer" href="https://itunes.apple.com/us/app/brainscape-smart-flashcards/id442415567?mt=8">iOS App</a> </li> <li class='option'> <a class="option-link" target="_blank" rel="nofollow noopener noreferrer" href="https://play.google.com/store/apps/details?id=com.brainscape.mobile.portal">Android App</a> </li> <li class='option'> <a class="option-link" target="_blank" rel="noopener" href="https://www.brainscape.com/faq">Help Center</a> </li> </ul> </li> <li class='section subjects'> <p class='section-heading'> Subjects </p> <ul class='options-list'> <li class='option'> <a class="option-link" href="/subjects/medical-nursing">Medical & Nursing</a> </li> <li class='option'> <a class="option-link" href="/subjects/law">Law Education</a> </li> <li class='option'> <a class="option-link" href="/subjects/foreign-languages">Foreign Languages</a> </li> <li class='option'> <a class="option-link" href="/subjects-directory/a">All Subjects A-Z</a> </li> <li class='option certified-classes'> <a class="option-link" href="/learn">All Certified Classes</a> </li> </ul> </li> <li class='section company'> <p class='section-heading'> Company </p> <ul class='options-list'> <li class='option'> <a class="option-link" href="/about">About Us</a> </li> <li class='option'> <a target="_blank" class="option-link" rel="nofollow noopener noreferrer" href="https://brainscape.zendesk.com/hc/en-us/articles/115002370011-Can-I-earn-money-from-my-flashcards-">Earn Money!</a> </li> <li class='option'> <a target="_blank" class="option-link" href="https://www.brainscape.com/academy">Academy</a> </li> <li class='option'> <a target="_blank" class="option-link" href="https://brainscapeshop.myspreadshop.com/all">Swag Shop</a> </li> <li class='option'> <a target="_blank" rel="nofollow noopener" class="option-link" href="/contact">Contact</a> </li> <li class='option'> <a target="_blank" rel="nofollow noopener" class="option-link" href="/terms">Terms</a> </li> <li class='option'> <a target="_blank" class="option-link" href="https://www.brainscape.com/academy/brainscape-podcasts/">Podcasts</a> </li> <li class='option'> <a target="_blank" class="option-link" href="/careers">Careers</a> </li> </ul> </li> <li class='section find-us'> <p class='section-heading'> Find Us </p> <ul class='social-media-list'> <li class='option twitter-badge group'> <a rel="nofollow noopener noreferrer" target="_blank" class="option-link" href="https://twitter.com/Brainscape"><img data-src="/pks/images/shared/twitterx-af917e8b474ed7c95a19.svg" alt="twitter badge" class="lazy-load" src="/pks/images/shared/placeholder-2f8e0834f3c4456dc1cc.jpg" width="24" height="24" /></a> </li> <li class='option linkedin-badge group'> <a rel="nofollow noopener noreferrer" target="_blank" class="option-link" href="https://www.linkedin.com/company/brainscape/"><img data-src="/pks/images/shared/linkedin-2f15819658f768056cef.svg" alt="linkedin badge" class="lazy-load" src="/pks/images/shared/placeholder-2f8e0834f3c4456dc1cc.jpg" width="24" height="24" /></a> </li> <li class='option facebook-badge group'> <a rel="nofollow noopener noreferrer" target="_blank" class="option-link" href="https://www.facebook.com/Brainscape"><img data-src="/pks/images/shared/facebook-1598a44227eabc411188.svg" alt="facebook badge" class="lazy-load" src="/pks/images/shared/placeholder-2f8e0834f3c4456dc1cc.jpg" width="24" height="24" /></a> </li> <li class='option youtube-badge group'> <a rel="nofollow noopener noreferrer" target="_blank" class="option-link" href="https://www.youtube.com/c/BrainscapeNY"><img data-src="/pks/images/shared/youtube-7f2994b2dc1891582524.svg" alt="youtube badge" class="lazy-load" src="/pks/images/shared/placeholder-2f8e0834f3c4456dc1cc.jpg" width="24" height="24" /></a> </li> <li class='option pinterest-badge group'> <a rel="nofollow noopener noreferrer" target="_blank" class="option-link" href="https://www.pinterest.com/brainscape/"><img data-src="/pks/images/shared/pinterest-04f51aa292161075437b.svg" alt="pinterest badge" class="lazy-load" src="/pks/images/shared/placeholder-2f8e0834f3c4456dc1cc.jpg" width="24" height="24" /></a> </li> <li class='option tiktok-badge group'> <a rel="nofollow noopener noreferrer" target="_blank" class="option-link" href="https://www.tiktok.com/@brainscapeu"><img data-src="/pks/images/shared/tiktok-644cf4608bd73fbbb24f.svg" alt="tiktok badge" class="lazy-load" src="/pks/images/shared/placeholder-2f8e0834f3c4456dc1cc.jpg" width="24" height="24" /></a> </li> <li class='option insta-badge group'> <a rel="nofollow noopener noreferrer" target="_blank" class="option-link" href="https://www.instagram.com/brainscape/"><img data-src="/pks/images/shared/insta-210cc2d059ae807961d2.svg" alt="insta badge" class="lazy-load" src="/pks/images/shared/placeholder-2f8e0834f3c4456dc1cc.jpg" width="24" height="24" /></a> </li> </ul> <div class='get-the-app'> <div class='qr-code'> <img data-src="https://www.brainscape.com/assets/cms/public-views/shared/shortio-from-homepage.png" alt="QR code" class="lazy-load" src="/pks/images/shared/placeholder-2f8e0834f3c4456dc1cc.jpg" width="130" height="130" /> </div> <div class='app-badges'> <div class='badge apple-badge'> <a rel="nofollow noopener noreferrer" target="_blank" class="option-link" href="https://apps.apple.com/us/app/brainscape-smart-flashcards/id442415567"><img data-src="/pks/images/shared/apple-badge-b6e4f380fb879821d601.svg" alt="apple badge" class="lazy-load" src="/pks/images/shared/placeholder-2f8e0834f3c4456dc1cc.jpg" width="124" height="50" /></a> </div> <div class='badge android-badge'> <a rel="nofollow noopener noreferrer" target="_blank" class="option-link" href="https://play.google.com/store/apps/details?id=com.brainscape.mobile.portal&utm_source=global_co&utm_medium=prtnr&utm_content=Mar2515&utm_campaign=PartBadge&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1"><img data-src="/pks/images/shared/android-badge-a2251833dc7f6ca8879c.svg" alt="android badge" class="lazy-load" src="/pks/images/shared/placeholder-2f8e0834f3c4456dc1cc.jpg" width="124" height="50" /></a> </div> </div> </div> </li> </ul> </div> <div class='footer-blurb'> Brainscape helps you reach your goals faster, through stronger study habits. <br> © 2025 Bold Learning Solutions. <a class="option-link" href="/terms">Terms and Conditions</a> </div> </div> <script> if (typeof window.__REACT_DEVTOOLS_GLOBAL_HOOK__ === 'object') { __REACT_DEVTOOLS_GLOBAL_HOOK__.inject = function() {}; } </script> <script> window.addEventListener('load', () => { setTimeout(() => { const script = document.createElement('script'); script.src = "/pks/js/public-flashcards-page-9140413b5150ce9700f9.js"; script.defer = true; document.body.appendChild(script); }, 0); }); </script> <script src="https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js" defer="defer"></script> <script> document.addEventListener("mainSharedready", () => { GaHelper.setGaDimension("dimension1","No"); }); </script> <script type='application/ld+json'> {"@context":"https://schema.org/","@type":"Quiz","about":{"@type":"Thing","name":"Theory of Computation"},"hasPart":[{"@context":"https://schema.org/","@type":"Question","eduQuestionType":"Flashcard","text":"What is Abstraction?","acceptedAnswer":{"@type":"Answer","text":"Abstraction is the name given to the process of omitting unnecessary details from a problem."}},{"@context":"https://schema.org/","@type":"Question","eduQuestionType":"Flashcard","text":"Representational abstraction","acceptedAnswer":{"@type":"Answer","text":"A representation of a problem arrived at by removing unnecessary details from the problem."}},{"@context":"https://schema.org/","@type":"Question","eduQuestionType":"Flashcard","text":"Abstraction by generalisation / categorisation","acceptedAnswer":{"@type":"Answer","text":"Grouping by common characteristics to form a hierarchical relationships e.g. “is a kind of”"}},{"@context":"https://schema.org/","@type":"Question","eduQuestionType":"Flashcard","text":"What is information hiding","acceptedAnswer":{"@type":"Answer","text":"Hiding all non-essential details of an object that doesn't affect its essential characteristics."}},{"@context":"https://schema.org/","@type":"Question","eduQuestionType":"Flashcard","text":"What is procedure abstraction?","acceptedAnswer":{"@type":"Answer","text":"Breaking down a problem into reuseable procedures, abstraction specific values."}},{"@context":"https://schema.org/","@type":"Question","eduQuestionType":"Flashcard","text":"What is functional abstraction?","acceptedAnswer":{"@type":"Answer","text":"Hiding the specific computation method and only focusing on the input/output of the function"}},{"@context":"https://schema.org/","@type":"Question","eduQuestionType":"Flashcard","text":"What is data abstraction?","acceptedAnswer":{"@type":"Answer","text":"Hiding details of data representation, allowing creation of new abstract data types."}},{"@context":"https://schema.org/","@type":"Question","eduQuestionType":"Flashcard","text":"What is problem abstraction/reduction?","acceptedAnswer":{"@type":"Answer","text":"Simplifying a problem by removing details until it's similar to a previously solved problem."}},{"@context":"https://schema.org/","@type":"Question","eduQuestionType":"Flashcard","text":"What is decomposition?","acceptedAnswer":{"@type":"Answer","text":"Dividing a complex problem into smaller, more manageable sub-problems."}},{"@context":"https://schema.org/","@type":"Question","eduQuestionType":"Flashcard","text":"What is composition?","acceptedAnswer":{"@type":"Answer","text":"Combining simple procedures or data types to build more complex ones (e.g. tree structure)."}},{"@context":"https://schema.org/","@type":"Question","eduQuestionType":"Flashcard","text":"What is automation in computer science?","acceptedAnswer":{"@type":"Answer","text":"Executing abstract models using algorithms, program code, and data structures."}},{"@context":"https://schema.org/","@type":"Question","eduQuestionType":"Flashcard","text":"What are the main steps to achieve automation?","acceptedAnswer":{"@type":"Answer","text":" Create models Design algorithms Implement in code Use data structures Execute the code"}},{"@context":"https://schema.org/","@type":"Question","eduQuestionType":"Flashcard","text":"What are the four constructs used in pseudocode?","acceptedAnswer":{"@type":"Answer","text":"Sequence, Assignment, Selection, Iteration"}},{"@context":"https://schema.org/","@type":"Question","eduQuestionType":"Flashcard","text":"What does sequence mean in pseudocode?","acceptedAnswer":{"@type":"Answer","text":"Instructions are carried out one after the other, in order."}},{"@context":"https://schema.org/","@type":"Question","eduQuestionType":"Flashcard","text":"What is assignment in pseudocode?","acceptedAnswer":{"@type":"Answer","text":"Giving a value to a variable (e.g. x ← 5)."}},{"@context":"https://schema.org/","@type":"Question","eduQuestionType":"Flashcard","text":"What is selection in pseudocode?","acceptedAnswer":{"@type":"Answer","text":"Choosing between actions based on conditions (IF, ELSE, etc.)."}},{"@context":"https://schema.org/","@type":"Question","eduQuestionType":"Flashcard","text":"What is iteration in pseudocode?","acceptedAnswer":{"@type":"Answer","text":"Repeating actions using FOR or WHILE loops."}},{"@context":"https://schema.org/","@type":"Question","eduQuestionType":"Flashcard","text":"What is hand-tracing an algorithm?","acceptedAnswer":{"@type":"Answer","text":"Manually running through an algorithm step-by-step with test data to verify correctness."}},{"@context":"https://schema.org/","@type":"Question","eduQuestionType":"Flashcard","text":"How do you argue for the correctness of a program?","acceptedAnswer":{"@type":"Answer","text":"Use logical reasoning, test data, and user feedback."}},{"@context":"https://schema.org/","@type":"Question","eduQuestionType":"Flashcard","text":"What is a Finite State Machine (FSM)?","acceptedAnswer":{"@type":"Answer","text":"A computational model with a finite number of states, transitions between states based on inputs, and optional outputs (Mealy machines)."}},{"@context":"https://schema.org/","@type":"Question","eduQuestionType":"Flashcard","text":"What is the difference between an FSM with and without output?","acceptedAnswer":{"@type":"Answer","text":" Without output: Only tracks state transitions. With output (Mealy): Produces an output on each transition (e.g., 1 a)."}},{"@context":"https://schema.org/","@type":"Question","eduQuestionType":"Flashcard","text":"How do you represent an FSM?","acceptedAnswer":{"@type":"Answer","text":"Using a state transition diagram (circles for states, arrows for transitions) or a state transition table."}},{"@context":"https://schema.org/","@type":"Question","eduQuestionType":"Flashcard","text":"What happens if an FSM reaches a non-final state with no valid transitions?","acceptedAnswer":{"@type":"Answer","text":"The input is rejected."}},{"@context":"https://schema.org/","@type":"Question","eduQuestionType":"Flashcard","text":"What is a set?","acceptedAnswer":{"@type":"Answer","text":"An unordered collection of unique elements (e.g., {1, 2, 3})."}}],"educationalAlignment":[{"@type":"AlignmentObject","alignmentType":"educationalSubject","targetName":"Theory of Computation"}]} </script> </body> </html>