A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

Variables in Logic

Middle & High School Depth 56 in the knowledge graph I know this Set as goal
9,558topics build on this
274prerequisites beneath it
See this on the map →
What Is an Argument?Variable ExpressionsConditional Statements (If-Then Formal)Introduction to Propositional Logic+2 more
variables propositions abstraction logic

Core Idea

Just as algebra uses letters like x and y to stand for unknown numbers, logic uses letters like P and Q to stand for statements that can be true or false. Writing "If P, then Q" lets you study the structure of an argument without specifying what P and Q actually say. This abstraction is what makes logic powerful — a rule about "If P, then Q" applies to every argument with that shape, whether P means "it rains" or "the number is even." Variables in logic separate the form of reasoning from its content.

How It's Best Learned

Begin with a concrete argument: "If it is raining, then the ground is wet." Label the parts: let P = "it is raining" and Q = "the ground is wet." Then show the same structure in a different context: P = "you study," Q = "you pass." The identical form "If P, then Q" captures both. Have students translate five different arguments into P-Q form and recognize they share a structure. Connect to algebraic variables: in algebra, x + x = 2x works for any number; in logic, "If P, then Q" works for any statements.

Common Misconceptions

Explainer

In algebra, you learned to write x + 5 = 12 and solve for x. The letter x stands for an unknown number. Logic does something similar but with a different kind of object: instead of numbers, logical variables stand for statements. When you write P to mean "the sun is shining" or Q to mean "I will go for a walk," you are creating placeholders that let you talk about the structure of reasoning without getting caught up in the details.

Why bother? Because logical structure is what determines whether reasoning is valid. The argument "If it is raining, then the ground is wet; it is raining; therefore the ground is wet" has exactly the same structure as "If the number is even, then it is divisible by 2; the number is even; therefore it is divisible by 2." Both are instances of "If P, then Q; P; therefore Q." By working with variables, you study all arguments of this form simultaneously rather than analyzing each one individually.

The key difference from algebraic variables: in algebra, x represents a number and can take values like 3 or -7.5. In logic, P represents a complete statement and can take exactly two values — true or false. There is no "partially true" or "somewhat false" in classical logic. When you substitute a specific statement for P, that statement is either true or false, and the logical structure tells you what follows.

The letters you choose are arbitrary. P and Q are traditional, but you could use A and B, or S₁ and S₂, or any other labels. What matters is consistency: once you define P as "it is raining," you must use P for that same statement throughout the argument. This is the same discipline as algebra — once you say x = 3, you cannot later treat x as 5 within the same problem.

This abstraction is what turns logic from a collection of specific arguments into a general science of reasoning. Every rule you will learn — about conditionals, contrapositives, truth tables, and proofs — will be stated in terms of variables, and will therefore apply to every possible argument with the matching structure.

Practice Questions 3 questions

Prerequisite Chain

Understanding ZeroThe Number ZeroCounting to FiveCounting to 10Counting to 20Counting a Set of Objects Up to 20Cardinality: The Last Number CountedMatching Numerals to QuantitiesSubitizing Small QuantitiesAddition Within 10Making 10 as an Addition StrategyAddition Within 20Doubles and Near DoublesDoubles Facts Within 10Near Doubles Facts Within 20Mental Math Strategies for AdditionMental Math: Adding and Subtracting TensAddition Within 100Repeated Addition as MultiplicationMultiplication as Equal GroupsMultiplication: ArraysBasic Multiplication Facts Through 10Multiplication Facts Within 100Division as Equal SharingDivision as Grouping (Measurement Division)Division: Grouping (Repeated Subtraction) ModelDivision: Fair Sharing ModelDivision as Equal SharingDivision as GroupingBasic Division FactsDivision Facts Within 100Multiplication and Division Fact FamiliesRelationship Between Multiplication and DivisionDivision Facts as Inverse of MultiplicationRemainders and Quotients in DivisionDivision Word ProblemsMulti-Step Word ProblemsSolving Multi-Step Word ProblemsMultiplication Word ProblemsDivision Word ProblemsIntroduction to Long DivisionFactors and MultiplesPrime and Composite NumbersEquivalent FractionsRelating Fractions and DecimalsDecimal Place ValueIntegers and the Number LineOpposites and Additive InversesAbsolute ValueAdding IntegersSubtracting IntegersMultiplying IntegersIntroduction to ExponentsOrder of OperationsInteger Order of OperationsVariable ExpressionsVariables in Logic

Longest path: 57 steps · 274 total prerequisite topics

Prerequisites (2)

Leads To (4)