CS636 – Formal Methods: Midterm Important MCQs (161 Solved Questions)
Computer Science • Read every solved MCQ with its verified answer key directly on this page. Free, no login required.
All 664 Midterm Packs · CS636 Course Page · CS636 Subjective Pack (28 Q&As)
-
SDLC stands for:
Topic: Introduction to Formal Methods
- Software Development Life Cycle ✓ Correct answer
- Software Design Life Cycle
- System Development Logic Cycle
- Software Deployment Life Cycle
-
What is the correct sequence of the SDLC phases?
Topic: Introduction to Formal Methods
- Design, Requirement Specification, Coding, Deployment
- Requirement Specification, Design, Coding, Deployment ✓ Correct answer
- Coding, Design, Requirement Specification, Deployment
- Deployment, Coding, Design, Requirement Specification
-
An error in software means that:
Topic: Introduction to Formal Methods
- The software is too large
- The software is written in a formal language
- The software does not provide the intended behavior ✓ Correct answer
- The software was not tested
-
Errors in software lead to:
Topic: Introduction to Formal Methods
- Failure ✓ Correct answer
- Better performance
- Formal specification
- Deployment
-
High reliability software cannot tolerate:
Topic: Introduction to Formal Methods
- Documentation
- Testing
- Diagrams
- Errors ✓ Correct answer
-
Specifications written in natural language and diagrammatic notations (such as UML) are generally:
Topic: Introduction to Formal Methods
- Always complete
- Ambiguous, incomplete and inconsistent ✓ Correct answer
- Mathematically precise
- Checked by a computer
-
In the BankAccount 'Withdraw' example, one of the ambiguities in the specification was whether:
Topic: Introduction to Formal Methods
- The bank charges a fee for withdrawal
- The account is a joint account
- A minimum balance must be maintained in the account ✓ Correct answer
- The withdrawal is made in dollars
-
Testing can uncover errors, but it does not guarantee:
Topic: Introduction to Formal Methods
- The location of errors
- The absence of errors ✓ Correct answer
- The cost of errors
- The specification of errors
-
Testing cannot take place until:
Topic: Introduction to Formal Methods
- The specification is formalized
- All errors are removed
- The proof of correctness is complete
- Some implementation is available ✓ Correct answer
-
Notations that have a fixed, unambiguous semantics are known as:
Topic: Introduction to Formal Methods
- Formal notations (formal languages) ✓ Correct answer
- Natural notations
- Diagrammatic notations
- Informal notations
-
A fixed semantics is achieved by defining a language in a completely unambiguous way using:
Topic: Introduction to Formal Methods
- A natural language
- A mathematical framework ✓ Correct answer
- A programming language
- A UML diagram
-
Formal methods are methods that use:
Topic: Introduction to Formal Methods
- Diagrams
- Test cases
- Formulas ✓ Correct answer
- Natural language
-
A good working definition of a 'formula' is:
Topic: Introduction to Formal Methods
- Anything written in English
- Anything drawn as a diagram
- Any equation with numbers only
- Anything whose appearance or syntax can be checked by a computer ✓ Correct answer
-
Formal methods constitute a branch of software engineering that incorporates the use of:
Topic: Introduction to Formal Methods
- Mathematics for software development ✓ Correct answer
- Testing for software development
- Marketing for software development
- Hardware for software development
-
Which of the following is an advantage of formal methods?
Topic: Introduction to Formal Methods
- Testing becomes completely unnecessary
- Formal specifications can help considerably in generating suitable test cases ✓ Correct answer
- Specifications are no longer needed
- The size of the software is reduced
-
Formal methods may not be needed for:
Topic: Introduction to Formal Methods
- Novel projects
- Difficult projects
- Critical projects
- Simple and routine jobs ✓ Correct answer
-
In critical projects, so much is at stake, including:
Topic: Introduction to Formal Methods
- Money only
- Money, security and safety ✓ Correct answer
- Time only
- Documentation only
-
A model in formal methods is:
Topic: Introduction to Formal Methods
- The final implemented product
- A test suite for the product
- A simplified representation of the product behavior that may skip irrelevant properties ✓ Correct answer
- A user manual of the product
-
A mathematical model that represents the intended behavior of a program can be used as:
Topic: Introduction to Formal Methods
- A formal specification ✓ Correct answer
- A test case
- A programming language
- A deployment plan
-
Verification means checking that:
Topic: Introduction to Formal Methods
- The code is well documented
- The code does what it is intended for ✓ Correct answer
- The code runs fast
- The code has no comments
-
A convincing product of verification is a:
Topic: Introduction to Formal Methods
- Proof ✓ Correct answer
- Diagram
- Test report
- Model
-
Which of the following provides greater confidence than testing?
Topic: Introduction to Formal Methods
- Proof ✓ Correct answer
- Documentation
- Deployment
- Specification in natural language
-
The symbol ℕ denotes:
Topic: Mathematical Notations
- Integers
- Natural Numbers ✓ Correct answer
- Real Numbers
- Rational Numbers
-
The symbol ℤ denotes:
Topic: Mathematical Notations
- Natural Numbers
- Complex Numbers
- Integers ✓ Correct answer
- Positive Numbers
-
The symbol ∀ means:
Topic: Mathematical Notations
- There exists
- There does not exist
- For all ✓ Correct answer
- Logical OR
-
The symbol ∃ means:
Topic: Mathematical Notations
- There exists ✓ Correct answer
- For all
- There does not exist
- Logical AND
-
The symbol ∄ means:
Topic: Mathematical Notations
- There exists
- For all
- Logical OR
- There does not exist ✓ Correct answer
-
Petri nets were introduced by Carl Adam Petri in:
Topic: Petri Nets
- 1952
- 1982
- 1972
- 1962 ✓ Correct answer
-
Petri nets are a diagrammatic tool used to model:
Topic: Petri Nets
- Sequential algorithms
- Database schemas
- Concurrency and synchronization ✓ Correct answer
- User interfaces
-
In a Petri net, a place represents a condition or state and is denoted by:
Topic: Petri Nets
- A circle ✓ Correct answer
- A rectangle
- A directed arrow
- A filled dot
-
In a Petri net, a transition represents:
Topic: Petri Nets
- Conditions
- States
- Tokens
- Events ✓ Correct answer
-
A transition in a Petri net is denoted by:
Topic: Petri Nets
- A circle
- A rectangle or vertical bar ✓ Correct answer
- A directed arrow
- A diamond
-
In a Petri net, arcs connect transitions and places and are denoted by:
Topic: Petri Nets
- Filled circles
- Rectangles
- Directed arrows ✓ Correct answer
- Dashed lines
-
In a Petri net, tokens represent:
Topic: Petri Nets
- The state at time t, denoted by a filled circle ✓ Correct answer
- Events, denoted by a rectangle
- Conditions, denoted by an arrow
- Outputs, denoted by a bar
-
The input place of a transition is also called its:
Topic: Petri Nets
- Post-condition
- Marking
- Pre-condition ✓ Correct answer
- Firing sequence
-
The output place of a transition is also called its:
Topic: Petri Nets
- Pre-condition
- Post-condition ✓ Correct answer
- Token
- Arc
-
A transition in a Petri net can fire when:
Topic: Petri Nets
- All of its output places are empty
- No other transition is enabled
- All places in the net hold a token
- There is at least one token at each of its input places ✓ Correct answer
-
When a transition fires in a Petri net:
Topic: Petri Nets
- One token is added to each input place
- All tokens are removed from the net
- One token is removed from each of its input places and one token is produced on each of its output places ✓ Correct answer
- Tokens move from output places to input places
-
A transition that is able to fire is said to be:
Topic: Petri Nets
- Live
- Bounded
- Reachable
- Enabled ✓ Correct answer
-
A transition that is not able to fire is said to be:
Topic: Petri Nets
- Disabled ✓ Correct answer
- Deadlocked
- Bounded
- Marked
-
If more than one transition is enabled in a Petri net, then:
Topic: Petri Nets
- All of them must fire together
- Any one of the enabled transitions may be the next one to fire ✓ Correct answer
- None of them can fire
- The net is deadlocked
-
The formal definition of a Petri net is PN = (P, T, I, O), where I and O stand for:
Topic: Petri Nets
- Initial and Output states
- Internal and External places
- Inputs and Outputs ✓ Correct answer
- Integers and Objects
-
In a Petri net, the marking M represents:
Topic: Petri Nets
- The number of transitions
- The firing sequence
- The set of input places
- The state of the Petri net ✓ Correct answer
-
A marking Mi is reachable from M0 if:
Topic: Petri Nets
- Mi contains more tokens than M0
- Mi is the initial marking
- All transitions are enabled in Mi
- There exists a firing sequence that transforms M0 to Mi ✓ Correct answer
-
A Petri net is K-bounded if:
Topic: Petri Nets
- It has at most K places
- It has at most K transitions
- The number of tokens in any place does not exceed K for any marking reachable from M0 ✓ Correct answer
- Exactly K tokens are present in the initial marking
-
A Petri net with initial marking M0 is live if:
Topic: Petri Nets
- For any marking after M0, we can still fire a transition ✓ Correct answer
- All places always contain tokens
- No transition can ever fire
- It has an infinite number of tokens
-
If a Petri net is live, then it is:
Topic: Petri Nets
- Unbounded
- Deadlock safe ✓ Correct answer
- K-bounded
- Disabled
-
In the Producer-Consumer problem modeled by a Petri net, the producer and consumer share the:
Topic: Petri Nets
- Transition
- Buffer ✓ Correct answer
- Token
- Arc
-
Automata are:
Topic: Automata, Languages and Regular Expressions
- Programming languages for machines
- Sets of input symbols
- Diagrams used to model concurrency
- Abstract mathematical models of machines that perform computations on an input by moving through a series of states ✓ Correct answer
-
The language L of strings of odd length, defined over Σ = {a}, is written as:
Topic: Automata, Languages and Regular Expressions
- L = {aa, aaaa, aaaaaa, ...}
- L = {Λ, a, aa, aaa, ...}
- L = {a, aaa, aaaaa, ...} ✓ Correct answer
- L = {a, aa, aaaa, ...}
-
The Kleene Star Closure Σ* of an alphabet Σ is:
Topic: Automata, Languages and Regular Expressions
- The collection of all strings defined over Σ, including Λ ✓ Correct answer
- The collection of all strings of length one over Σ
- The set of all alphabets
- The collection of strings without the null string
-
If Σ = {x}, then Σ* is:
Topic: Automata, Languages and Regular Expressions
- {x, xx, xxx, ...}
- {Λ}
- {Λ, x}
- {Λ, x, xx, xxx, xxxx, ...} ✓ Correct answer
-
The Plus operation differs from the Kleene Star Closure because it does not generate:
Topic: Automata, Languages and Regular Expressions
- Strings of length two
- Λ (the null string) ✓ Correct answer
- Repeated symbols
- The alphabet itself
-
If Σ = {0, 1}, then Σ+ is:
Topic: Automata, Languages and Regular Expressions
- {Λ, 0, 1, 00, 01, 10, 11, ...}
- {0, 1, 00, 01, 10, 11, ...} ✓ Correct answer
- {0, 1}
- {Λ, 0, 1}
-
The regular expression a* expresses the language:
Topic: Automata, Languages and Regular Expressions
- {a, aa, aaa, ...}
- {Λ, a}
- {Λ, a, aa, aaa, ...} ✓ Correct answer
- {aa, aaaa, ...}
-
The regular expression a+ expresses the language:
Topic: Automata, Languages and Regular Expressions
- {a, aa, aaa, aaaa, ...} ✓ Correct answer
- {Λ, a, aa, aaa, ...}
- {Λ}
- {a}
-
Which of the following is true about regular expressions?
Topic: Automata, Languages and Regular Expressions
- Only letters of Σ are regular expressions
- Λ is not a regular expression
- Regular expressions cannot be combined
- Every letter of Σ including Λ is a regular expression ✓ Correct answer
-
If r1 and r2 are regular expressions, then which of the following is also a regular expression?
Topic: Automata, Languages and Regular Expressions
- r1 r2
- r1 + r2
- r1*
- All of these ✓ Correct answer
-
The regular expression for the language of strings over Σ = {a, b} containing double a is:
Topic: Automata, Languages and Regular Expressions
- (a+b)*aa(a+b)* ✓ Correct answer
- aa(a+b)*
- (a+b)*aa
- a(a+b)*a
-
The regular expression for the EVEN-EVEN language over Σ = {a, b} is:
Topic: Automata, Languages and Regular Expressions
- (a+b)*
- (aa+bb+(ab+ba)(aa+bb)*(ab+ba))* ✓ Correct answer
- a*b*
- (aa+bb)*
-
A finite automaton accepts a string if:
Topic: DFA and NFA
- The string is empty
- It uses every input symbol twice
- It returns to the initial state
- It reaches a final state ✓ Correct answer
-
A DFA is a 5-tuple (S, Σ, T, s, A). How many components does a DFA have?
Topic: DFA and NFA
- Three
- Four
- Five ✓ Correct answer
- Six
-
In the DFA 5-tuple (S, Σ, T, s, A), the first component S stands for:
Topic: DFA and NFA
- The finite set of states ✓ Correct answer
- The set of input symbols
- The initial state
- The set of transitions
-
In the DFA 5-tuple (S, Σ, T, s, A), Σ represents:
Topic: DFA and NFA
- The set of final states
- The set of transitions
- The initial state
- The set of input symbols ✓ Correct answer
-
In the DFA 5-tuple (S, Σ, T, s, A), the fourth component s stands for:
Topic: DFA and NFA
- The set of states
- The initial state, where s ∈ S ✓ Correct answer
- The final state
- The input alphabet
-
In the DFA 5-tuple (S, Σ, T, s, A), A represents:
Topic: DFA and NFA
- The final (accept) state ✓ Correct answer
- The set of input symbols
- The set of transitions
- The initial state
-
Consider a DFA with S = {a, b, c}, Σ = {0, 1}, initial state a, where from a on 0 the machine goes to b, from a on 1 it stays at a, from b on 0 it goes to a and from b on 1 it goes to c. Starting from a, the string 01 ends in state:
Topic: DFA and NFA
- a
- b
- c ✓ Correct answer
- The string is rejected at the first symbol
-
For the same DFA (from a: 0→b, 1→a; from b: 0→a, 1→c; final state c), the string 10 starting from a ends in state:
Topic: DFA and NFA
- b ✓ Correct answer
- c
- a
- The machine halts
-
In an NFA with S = {a, b, c} and Σ = {0, 1}, from state a on input 0 the machine can move to both a and b. This shows that in an NFA:
Topic: DFA and NFA
- A state can have more than one next state for the same input symbol ✓ Correct answer
- Every state is a final state
- The input alphabet has one symbol
- The machine has no initial state
-
In the vending machine DFA example, the machine allows the user to select a soda once it has received:
Topic: DFA and NFA
- $0.25
- $1.00
- $1.50
- $1.25 ✓ Correct answer
-
In the vending machine DFA example, the start state is:
Topic: DFA and NFA
- $1.25
- $0.00 ✓ Correct answer
- $0.25
- $2.00
-
In the vending machine DFA example, a self-loop represents:
Topic: DFA and NFA
- An accepted string
- A final state
- Ignored input ✓ Correct answer
- A rejected coin
-
Model-based verification techniques are based on models describing the possible system behavior in a:
Topic: System Verification and Model Checking
- Mathematically precise and unambiguous manner ✓ Correct answer
- Natural and informal manner
- Graphical and approximate manner
- Ambiguous manner
-
The accurate modeling of systems often leads to the discovery of:
Topic: System Verification and Model Checking
- New programming languages
- Faster hardware
- Incompleteness, ambiguities and inconsistencies in informal system specifications ✓ Correct answer
- New test cases only
-
Model checking is an automated technique that, given a finite-state model of a system and a formal property:
Topic: System Verification and Model Checking
- Generates test cases for the system
- Systematically checks whether the property holds for that model ✓ Correct answer
- Translates the model into code
- Simulates a few states of the model
-
Model checking explores the system states:
Topic: System Verification and Model Checking
- Randomly
- By sampling a few states
- Only in the initial state
- All possible system states in a brute-force manner ✓ Correct answer
-
'Can the system reach a deadlock situation?' is an example of:
Topic: System Verification and Model Checking
- A qualitative property ✓ Correct answer
- A timing property
- A quantitative property
- A modeling property
-
'Is a response always received within 8 minutes?' is an example of:
Topic: System Verification and Model Checking
- A qualitative property
- A timing property ✓ Correct answer
- An informal property
- A modeling property
-
The model-checking process consists of the phases:
Topic: System Verification and Model Checking
- Design, Coding, Testing
- Specification, Implementation, Deployment
- Modeling phase, Running phase, Analysis phase ✓ Correct answer
- Modeling, Coding, Analysis
-
In the modeling phase of model checking, the property to be checked is formalized using:
Topic: System Verification and Model Checking
- The property specification language ✓ Correct answer
- A programming language
- Natural language
- A truth table
-
In the modeling phase, as a first sanity check and quick assessment of the model, one should:
Topic: System Verification and Model Checking
- Write the code
- Perform some simulations ✓ Correct answer
- Generate a counterexample
- Reduce the model
-
In the analysis phase, if a property is violated, the model checker provides:
Topic: System Verification and Model Checking
- A corrected model
- A proof
- A counterexample, which is analyzed by simulation ✓ Correct answer
- A new property
-
In the analysis phase, if the model checker runs out of memory, one should:
Topic: System Verification and Model Checking
- Abandon the verification
- Check the next property
- Restart the computer
- Try to reduce the model and try again ✓ Correct answer
-
Which of the following is a strength of model checking?
Topic: System Verification and Model Checking
- It supports partial verification ✓ Correct answer
- It verifies the actual product itself
- It checks unstated requirements as well
- It needs no expertise
-
Which of the following is a weakness of model checking?
Topic: System Verification and Model Checking
- It provides no diagnostic information
- It cannot be integrated in existing development cycles
- It verifies a system model, and not the actual system itself ✓ Correct answer
- It has no mathematical underpinning
-
Model checking is mainly appropriate for:
Topic: System Verification and Model Checking
- Data-intensive applications
- Control-intensive applications ✓ Correct answer
- Documentation tasks
- Marketing systems
-
In a transition system, the nodes of the directed graph represent:
Topic: Transition Systems
- Transitions
- Actions
- States ✓ Correct answer
- Propositions
-
In a transition system, the edges of the graph model:
Topic: Transition Systems
- States
- Initial states
- Labels
- Transitions, i.e., state changes ✓ Correct answer
-
A transition system TS is a tuple (S, Act, →, I, AP, L). In this tuple, AP is:
Topic: Transition Systems
- The set of actions
- The set of initial states
- The labeling function
- The set of atomic propositions ✓ Correct answer
-
In the transition system tuple (S, Act, →, I, AP, L), L is:
Topic: Transition Systems
- The labeling function L : S → 2^AP ✓ Correct answer
- The set of states
- The transition relation
- The set of actions
-
In the transition system tuple, I ⊆ S is:
Topic: Transition Systems
- The set of atomic propositions
- The set of terminal states
- The set of actions
- The set of initial states ✓ Correct answer
-
A state s in a transition system TS is called terminal if and only if:
Topic: Transition Systems
- s is an initial state
- Pre(s) = ∅
- Post(s) = ∅ ✓ Correct answer
- L(s) = ∅
-
A transition system TS is called action-deterministic if:
Topic: Transition Systems
- |I| ≤ 1 and |Post(s, α)| ≤ 1 for all states s and actions α ✓ Correct answer
- Every state is reachable
- Post(s) = ∅ for all states
- |I| ≥ 1 and every state has a successor
-
An execution fragment of a transition system is:
Topic: Transition Systems
- A single state
- A set of actions only
- A set of atomic propositions
- An alternating sequence of states and actions ending with a state ✓ Correct answer
-
A maximal execution fragment is:
Topic: Transition Systems
- The shortest execution fragment
- Either a finite execution fragment that ends in a terminal state, or an infinite execution fragment ✓ Correct answer
- An execution fragment with no actions
- A fragment that starts in a terminal state
-
An execution fragment is called initial if:
Topic: Transition Systems
- It starts in an initial state ✓ Correct answer
- It is infinite
- It ends in a terminal state
- It contains all states
-
A state s is called reachable in a transition system TS if:
Topic: Transition Systems
- There exists an initial, finite execution fragment ending in s ✓ Correct answer
- s is a terminal state
- Every action is enabled in s
- s appears in every execution
-
In the beverage vending machine transition system example with AP = {paid, drink}, the labeling of the state 'select' is:
Topic: Transition Systems
- L(select) = ∅
- L(select) = {paid, drink}
- L(select) = {drink}
- L(select) = {paid} ✓ Correct answer
-
In the vending machine example, the proposition 'paid' characterizes exactly those states in which:
Topic: Transition Systems
- The user has obtained a beverage
- The user has already paid but not yet obtained a beverage ✓ Correct answer
- The machine is switched off
- The user has inserted a coin twice
-
In data-dependent systems, the labels of conditional transitions are of the form g : α, where g is:
Topic: Data-Dependent Systems, Program Graphs and Interleaving
- An action
- A state
- A variable name
- A Boolean condition called a guard ✓ Correct answer
-
Let α denote the action x := y + 5, and let η be an evaluation with η(x) = 17 and η(y) = −2. Then Effect(α, η)(x) is:
Topic: Data-Dependent Systems, Program Graphs and Interleaving
- 3 ✓ Correct answer
- −2
- 22
- 17
-
In the program graph example of the beverage machine, Effect(sget, η) is:
Topic: Data-Dependent Systems, Program Graphs and Interleaving
- η[nsoda := nsoda − 1] ✓ Correct answer
- η[nbeer := nbeer − 1]
- η
- η[nsoda := max]
-
Interleaving is a paradigm for parallel systems in which:
Topic: Data-Dependent Systems, Program Graphs and Interleaving
- All actions execute at exactly the same instant
- Only one component ever executes
- Components never interact
- Actions of an independent component are merged (weaved) with actions from other components ✓ Correct answer
-
The effect of concurrently executed, independent actions α and β is identical to the effect of:
Topic: Data-Dependent Systems, Program Graphs and Interleaving
- Executing α only
- Executing neither α nor β
- Executing β only
- Executing α and β successively in arbitrary order ✓ Correct answer
-
The (global) states of the interleaving TS1 ||| TS2 are:
Topic: Data-Dependent Systems, Program Graphs and Interleaving
- Single local states
- Pairs ⟨s1, s2⟩ consisting of the local states of the components ✓ Correct answer
- Sets of actions
- Sets of atomic propositions
-
The interleaving of transition systems assumes that:
Topic: Data-Dependent Systems, Program Graphs and Interleaving
- No communication and no contentions on shared variables occur at all ✓ Correct answer
- Contentions on shared variables occur frequently
- Components communicate through shared variables
- All components share one state
-
A model or diagram is well-formed if:
Topic: Well-Formedness, Consistency and Completeness
- It is complete in all respects
- Its structure satisfies the syntactic rules, and its elements are type compatible ✓ Correct answer
- It contains no diagrams
- It is drawn correctly
-
A consistency constraint C is a predicate defined on models such that C(M) = true means:
Topic: Well-Formedness, Consistency and Completeness
- The model is complete
- The model is well-formed
- The model is consistent with respect to the constraint ✓ Correct answer
- The model has one diagram
-
A consistency constraint defined on a specific type of diagram of the model is called:
Topic: Well-Formedness, Consistency and Completeness
- An intra-diagram consistency constraint ✓ Correct answer
- An inter-diagram consistency constraint
- An inter-model consistency constraint
- A completeness constraint
-
A consistency constraint defined on two or more diagrams is called:
Topic: Well-Formedness, Consistency and Completeness
- An intra-diagram consistency constraint
- A completeness constraint
- An inter-model consistency constraint
- An inter-diagram consistency constraint ✓ Correct answer
-
A consistency constraint defined on diagrams of more than one type is called:
Topic: Well-Formedness, Consistency and Completeness
- An inter-model consistency constraint ✓ Correct answer
- An inter-diagram consistency constraint
- An intra-diagram consistency constraint
- A syntactic constraint
-
A completeness constraint restricts the construction of models so that:
Topic: Well-Formedness, Consistency and Completeness
- Diagrams become type compatible
- Constraints become predicates
- Models contain more diagrams
- Certain errors due to lack of information can be prevented and detected ✓ Correct answer
-
Formal reasoning is:
Topic: Propositions and Compound Propositions
- A process of thinking, logically arguing and drawing conclusions ✓ Correct answer
- A method of testing software
- A diagrammatic modeling tool
- A programming technique
-
Logic is:
Topic: Propositions and Compound Propositions
- A branch of software testing
- A set of programming rules
- A formal system of principles and rules that govern correct or valid reasoning ✓ Correct answer
- A natural language
-
A proposition is a statement that is:
Topic: Propositions and Compound Propositions
- Always true
- An instruction
- A question
- Either TRUE or FALSE ✓ Correct answer
-
Which of the following propositions evaluates to TRUE?
Topic: Propositions and Compound Propositions
- The angles of a triangle add up to 360 degrees
- London is the capital of France
- 2 − 4 = 7
- 2 + 4 = 6 ✓ Correct answer
-
Which of the following propositions evaluates to FALSE?
Topic: Propositions and Compound Propositions
- There are seven days in a week
- Lahore is the capital of Pakistan ✓ Correct answer
- There are 12 months in a year
- 3 + 6 = 9
-
In mathematics, a proposition is often represented symbolically by:
Topic: Propositions and Compound Propositions
- A variable name such as P or Q ✓ Correct answer
- A number
- A diagram
- A Greek letter only
-
A primitive proposition is one that:
Topic: Propositions and Compound Propositions
- Is always false
- Is composed of many subpropositions
- Cannot be broken down into simpler propositions ✓ Correct answer
- Contains connectives
-
A compound proposition is:
Topic: Propositions and Compound Propositions
- A proposition that is always true
- Composed of subpropositions and various connectives ✓ Correct answer
- A proposition without a truth value
- A primitive proposition
-
The truth value of a compound proposition is completely determined by:
Topic: Propositions and Compound Propositions
- The number of its subpropositions
- Its length
- The truth values of its subpropositions together with the way in which they are connected ✓ Correct answer
- The person evaluating it
-
The conjunction p ∧ q corresponds to the English word 'and' and is true:
Topic: Propositions and Compound Propositions
- When both p and q are true; otherwise it is false ✓ Correct answer
- When at least one of p and q is true
- When both p and q are false
- When p is false and q is true
-
The disjunction p ∨ q corresponds to the English word 'or' and is false:
Topic: Propositions and Compound Propositions
- When p is true
- When q is true
- When both p and q are true
- Only when both p and q are false; otherwise it is true ✓ Correct answer
-
The negation of a proposition p is symbolized as:
Topic: Propositions and Compound Propositions
- p ∧ q
- p ⇒ q
- p ∨ q
- ¬p ✓ Correct answer
-
If p is false, then its negation ¬p is:
Topic: Propositions and Compound Propositions
- False
- Undefined
- True ✓ Correct answer
- Both true and false
-
Consider the statements: (1) 'Ice floats in water and 2 + 2 = 4' and (2) 'Ice floats in water and 2 + 2 = 5'. Which is true?
Topic: Propositions and Compound Propositions
- Only statement (1) is true; statement (2) is false because at least one of its sub-statements is false ✓ Correct answer
- Both statements are true
- Only statement (2) is true
- Both statements are false
-
The statement 'China is in Europe or 2 + 2 = 4' is:
Topic: Propositions and Compound Propositions
- False, because both sub-statements are false
- True, because at least one of its sub-statements is true ✓ Correct answer
- False, because one sub-statement is false
- Undefined
-
A truth table for a proposition with n variables requires:
Topic: Truth Tables, Logical Equivalence and Laws
- n rows
- 2n rows
- 2^n rows ✓ Correct answer
- n^2 rows
-
For a proposition with 3 variables, the number of rows required in its truth table is:
Topic: Truth Tables, Logical Equivalence and Laws
- 3
- 6
- 9
- 8 ✓ Correct answer
-
Two propositions P(p, q, ...) and Q(p, q, ...) are said to be logically equivalent if:
Topic: Truth Tables, Logical Equivalence and Laws
- They have identical truth tables ✓ Correct answer
- They use the same connectives
- They have the same number of variables
- They are both tautologies
-
Logical equivalence between two propositions is denoted by:
Topic: Truth Tables, Logical Equivalence and Laws
- ⇒
- ≡ ✓ Correct answer
- ⊕
- ∧
-
The proposition ¬(p ∧ q) is logically equivalent to:
Topic: Truth Tables, Logical Equivalence and Laws
- ¬p ∧ ¬q
- p ∨ q
- ¬p ∨ ¬q ✓ Correct answer
- ¬p ∧ q
-
According to De Morgan's laws, ¬(p ∨ q) is equivalent to:
Topic: Truth Tables, Logical Equivalence and Laws
- ¬p ∨ ¬q
- ¬p ∧ ¬q ✓ Correct answer
- p ∧ q
- ¬p ∨ q
-
The involution law of the algebra of propositions states that:
Topic: Truth Tables, Logical Equivalence and Laws
- ¬¬p ≡ p ✓ Correct answer
- p ∨ p ≡ p
- p ∧ T ≡ p
- p ∨ ¬p ≡ T
-
Which of the following is an idempotent law?
Topic: Truth Tables, Logical Equivalence and Laws
- p ∨ ¬p ≡ T
- ¬¬p ≡ p
- p ∨ F ≡ p
- p ∨ p ≡ p ✓ Correct answer
-
Which of the following is a complement law?
Topic: Truth Tables, Logical Equivalence and Laws
- p ∧ p ≡ p
- p ∨ ¬p ≡ T ✓ Correct answer
- p ∨ q ≡ q ∨ p
- (p ∨ q) ∨ r ≡ p ∨ (q ∨ r)
-
If p is TRUE and q is TRUE, then the proposition ¬(p ∧ ¬q) evaluates to:
Topic: Truth Tables, Logical Equivalence and Laws
- FALSE
- TRUE ✓ Correct answer
- UNDEFINED
- Both TRUE and FALSE
-
The implication operator is represented by the symbol:
Topic: Implication, Equivalence, Tautologies and Arguments
- ⇔
- ⊕
- ⇒ ✓ Correct answer
- ≡
-
The statement 'P implies Q', written P ⇒ Q, can alternatively be expressed as:
Topic: Implication, Equivalence, Tautologies and Arguments
- P and Q
- If P then Q ✓ Correct answer
- P or Q
- Not P
-
The implication p ⇒ q is FALSE only when:
Topic: Implication, Equivalence, Tautologies and Arguments
- p is FALSE and q is TRUE
- p is FALSE and q is FALSE
- p is TRUE and q is TRUE
- p is TRUE and q is FALSE ✓ Correct answer
-
The equivalence operator is represented by the symbol:
Topic: Implication, Equivalence, Tautologies and Arguments
- ⇔ ✓ Correct answer
- ⇒
- ¬
- ∨
-
The exclusive or operator (xor) is represented by the symbol:
Topic: Implication, Equivalence, Tautologies and Arguments
- ∧
- ⊕ ✓ Correct answer
- ⇒
- ≡
-
The exclusive or p ⊕ q evaluates to TRUE when:
Topic: Implication, Equivalence, Tautologies and Arguments
- Both p and q are true
- Both p and q are false
- Exactly one of p and q is true ✓ Correct answer
- At least one of p and q is true
-
The (inclusive) 'or' operator evaluates to TRUE if:
Topic: Implication, Equivalence, Tautologies and Arguments
- Either p or q or both are true ✓ Correct answer
- Exactly one of p and q is true
- Both p and q are false
- Neither p nor q is true
-
A proposition that is true for any truth values of its variables (contains only T in its evaluation) is called:
Topic: Implication, Equivalence, Tautologies and Arguments
- A contradiction
- A fallacy
- An argument
- A tautology ✓ Correct answer
-
A proposition that is false for any truth values of its variables is called:
Topic: Implication, Equivalence, Tautologies and Arguments
- A tautology
- A contradiction ✓ Correct answer
- A compound proposition
- A primitive proposition
-
An argument P1, P2, ..., Pn ⊢ Q is said to be valid if:
Topic: Implication, Equivalence, Tautologies and Arguments
- Q is TRUE whenever all the premises P1, P2, ..., Pn are true ✓ Correct answer
- All the premises are false
- Q is always false
- The premises are tautologies
-
The argument p, p → q ⊢ q is an example of:
Topic: Implication, Equivalence, Tautologies and Arguments
- A fallacy
- A contradiction
- A valid argument ✓ Correct answer
- A tautology
-
An argument that is not valid is called:
Topic: Implication, Equivalence, Tautologies and Arguments
- A tautology
- A fallacy ✓ Correct answer
- A contradiction
- An equivalence
-
The argument p → q, q ⊢ p is an example of:
Topic: Implication, Equivalence, Tautologies and Arguments
- A valid argument
- A tautology
- A fallacy ✓ Correct answer
- An equivalence
-
Three-valued logic allows a proposition to take the value:
Topic: Three-Valued Logic
- Only TRUE
- TRUE, FALSE or UNDEFINED ✓ Correct answer
- TRUE or UNDEFINED only
- A numerical value
-
Which of the following is given as an example of an undefined expression?
Topic: Three-Valued Logic
- 2 + 4
- 0/0 ✓ Correct answer
- 7 days in a week
- 2 + 2 = 4
-
Undefined terms commonly arise in programming situations, for example when:
Topic: Three-Valued Logic
- A variable is first declared and has not yet been assigned a value ✓ Correct answer
- A program terminates normally
- A variable is printed
- Two variables are compared
-
In three-valued logic, FALSE ∧ UNDEFINED evaluates to:
Topic: Three-Valued Logic
- UNDEFINED
- TRUE
- FALSE ✓ Correct answer
- Both TRUE and FALSE
-
In three-valued logic, TRUE ∧ UNDEFINED evaluates to:
Topic: Three-Valued Logic
- TRUE
- FALSE
- UNDEFINED ✓ Correct answer
- 0
-
In three-valued logic, FALSE ∨ UNDEFINED evaluates to:
Topic: Three-Valued Logic
- TRUE
- UNDEFINED ✓ Correct answer
- FALSE
- 1
-
In three-valued logic, TRUE ∨ UNDEFINED evaluates to:
Topic: Three-Valued Logic
- TRUE ✓ Correct answer
- FALSE
- UNDEFINED
- Both
-
In three-valued logic, the negation of UNDEFINED is:
Topic: Three-Valued Logic
- TRUE
- FALSE
- UNDEFINED ✓ Correct answer
- 0/0
-
In three-valued logic, UNDEFINED ⇒ FALSE evaluates to:
Topic: Three-Valued Logic
- TRUE
- FALSE
- UNDEFINED ✓ Correct answer
- 1
-
In three-valued logic, FALSE ⇒ UNDEFINED evaluates to:
Topic: Three-Valued Logic
- TRUE ✓ Correct answer
- FALSE
- UNDEFINED
- 0
-
In three-valued logic, if either operand of the exclusive or operator ⊕ is UNDEFINED, the result is:
Topic: Three-Valued Logic
- TRUE
- FALSE
- The other operand
- UNDEFINED ✓ Correct answer