HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →
Live examsInternational live exams are comingTell us which exam you want first. Timed practice papers are open now.See what is coming →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Space Science and Astronomy
  • Earth and Environmental Science
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
  1. Problems
  2. /A lift in an office block moves only when its doors are shut…
HardMathematicsHigh School (11–12)Mathematical ReasoningNumerical

A lift in an office block moves only when its doors are shut…

StemPy LabContributed by StemPy Lab

Try it on paper first. A hint, the key idea and the worked solution are here when you need them.

A lift in an office block moves only when its doors are shut. A safety panel uses four simple statements: ppp, "the doors are shut"; qqq, "button 1 is pressed"; rrr, "button 2 is pressed"; sss, "the alarm is pressed". The rule for moving is MMM: p∧(q∨r∨s)p \wedge (q \vee r \vee s)p∧(q∨r∨s). A second rule for a service mode is NNN: (p∨q)∧(r∨s)(p \vee q) \wedge (r \vee s)(p∨q)∧(r∨s). A truth table for four simple statements has 24=162^4 = 1624=16 rows. In how many rows is MMM true? In how many rows is NNN true? In how many rows are both true?

Check your answer

Work it out on paper, then type your number. The answer itself stays hidden.

Need a reminder? The key ideaShowHide

p∧qp \wedge qp∧q is true only when both parts are true, and p∨qp \vee qp∨q is false only when both are false. The exclusive or is true when exactly one part is true. With nnn simple statements a truth table has 2n2^n2n rows.

The worked solution

Check an answer or open a hint to unlock the worked solution.

Have you tried it?

Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, go through the solution one step at a time, and check each step against your own.

Given. M=p∧(q∨r∨s)M = p \wedge (q \vee r \vee s)M=p∧(q∨r∨s) and N=(p∨q)∧(r∨s)N = (p \vee q) \wedge (r \vee s)N=(p∨q)∧(r∨s) over 161616 rows.

Plan. Count by the structure, then check by listing.

Step 1. Rows for M. ppp must be T: that leaves 888 rows for qqq, rrr, sss. The "or" fails only when all three are F. So MMM is true in 8−1=78 - 1 = 78−1=7 rows.

Step 2. Rows for N. The two brackets use different letters. p∨qp \vee qp∨q is true in 333 of its 444 combinations, and so is r∨sr \vee sr∨s. So NNN is true in 3×3=93 \times 3 = 93×3=9 rows.

Step 3. Both. Both need ppp true. Then p∨qp \vee qp∨q is true, and NNN needs only r∨sr \vee sr∨s. With ppp true, MMM and NNN are both true when r∨sr \vee sr∨s is true: 333 choices of (r,s)(r, s)(r,s) and 222 of qqq. That gives 666 rows. (When rrr and sss are both F, MMM needs qqq, but NNN fails.)

Check. The program in the lesson can list all 161616 rows. It gives the same three counts.

Answer: MMM is true in 777 rows, NNN in 999, and both in 666.

Log in to save this for later
← All Problems
← Let p be "17 is a prime number", let q be "every even number is divisible by 4" and let r be "the…A quiz has three judges. Let p, q and r say that judge 1, judge 2 and judge 3 votes yes… →
More onMathematical Reasoning

Discussion (0)

Log in to join the discussion.

Loading…

Learn it in

  1. Connectives and truth tablesStatements, Connectives and Truth Tables

More on this topic

  1. Prove by cases that for every integer n, n² leaves remainder 0 or 1 when divided by 3…Advanced
  2. Prove by contradiction that there are no integers a and b with 6a + 9b = 100…Advanced
  3. Prove by contradiction that √3 is irrational…Hard
  4. Prove by exhaustion that no perfect square ends in the digit 2, 3, 7 or 8…
Advanced
  • The formula f(n) = n² + n + 41 gives a prime for n = 0, 1, 2, … for a long time…Advanced
  • All problems on this topic →