DeMorgan Theorem & Excel Formula

  • Context: High School 
  • Thread starter Thread starter Newtonian_gravity21
  • Start date Start date
  • Tags Tags
    Excel Formula Theorem
Click For Summary
SUMMARY

The discussion centers on the application of DeMorgan's Theorem in programming logic, particularly in the context of Excel formulas and loop conditions. DeMorgan's Theorem allows for the transformation of logical expressions, specifically converting AND operations to OR operations and vice versa through the use of NOTs. The example provided illustrates how a WHILE loop's condition can be rephrased into a REPEAT loop using DeMorgan's principles, demonstrating the theorem's practical utility in programming logic.

PREREQUISITES
  • Understanding of DeMorgan's Theorem in logic
  • Familiarity with Excel formulas, specifically the IF function
  • Basic knowledge of programming loops (WHILE and REPEAT)
  • Concept of logical operators (AND, OR, NOT)
NEXT STEPS
  • Study the application of DeMorgan's Theorem in digital logic design
  • Learn advanced Excel functions for logical operations
  • Explore conditional statements in programming languages like Python or Java
  • Investigate the use of logical expressions in database queries (e.g., SQL WHERE clause)
USEFUL FOR

Programmers, data analysts, and anyone interested in applying logical principles in Excel and programming environments will benefit from this discussion.

Newtonian_gravity21
Messages
3
Reaction score
0
=IF (C1>1,"yes","No") I think that's right :rolleyes:

Does Demorgan Theorem use a simular logic when doing calculations for logic gates, using true and false properities?
 
Mathematics news on Phys.org
Demorgan Theorem states that you can change the AND to OR and vise versa by using NOTs. Such as:
A AND B = NOT (NOT A OR NOT B)
A OR B = NOT (NOT A AND NOT B)

Where does this come from? I see it when using loops in programming. A WHILE loop needs a condition to continue looping whilst a REPEAT loop needs a condition to stop looping. They use opposite logic. Now the problem comes when you want to use a different loop which has a compound condition.

EG WHILE (end of file not reached) and (user did not press esc) read file

Now which is the equivalent expression to make a REPEAT loop?

REPEAT read file UNTIL (end of file reached) OR (user pressed esc)

See? We used DeMorgans except that we did not use the outer NOT because other wise it would have returned the same result as with the first loop. Simple huh?
 

Similar threads

  • · Replies 42 ·
2
Replies
42
Views
6K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 3 ·
Replies
3
Views
8K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 22 ·
Replies
22
Views
3K
  • · Replies 41 ·
2
Replies
41
Views
6K
  • · Replies 4 ·
Replies
4
Views
3K