Send Close Add comments: (status displays here)
Got it!  This site uses cookies. You consent to this by clicking on "Got it!" or by continuing to use this website.nbsp; Note: This appears on each machine/browser from which this site is accessed.
C: Boolean conditions


1. C: Boolean conditions
In C, or any programming language, what does it mean for a condition to be true? What does it mean for a condition to be false?

2. Truth types
Borromean RingsWhat does it mean to say that something is "true"?

3. Types of truth
Levels of truthFor the present purposes, the following are considered categories of truth. These areas can overlap but the distinction is, nonetheless, useful.

4. Logical truth
Logical truth: symbol manipulation involving integer values, which is exact but may involve paradoxes. This includes coded information, programming languages, digital computers, etc.

Mathematics is concerned with logical without any connection to reality. (Mathematicians such as Hilbert made this decision in the early 1900's).

5. David Hilbert
In the 1920's, Hilbert (1928) proposed finding a consistent mathematical system that will allow all possible truths
to be decided. This would allow the automatic, or mechanical, proving of all possible truths.

6. Hilbert curve
Hilbert curve animationHilbert invented/discovered the Hilbert curve, a monster curve that was not fully understood until the introduction of fractals a half-century later. Logical truth involves mathematical and computer/information logic using two discrete logic values (e.g., true and false, 1 and 0) and symbol manipulation using rules to determine which claims are "true" or "false".

Computer logic and programming involves logical truth.

Hilbert and his problems and the separation of math with reality and philosophy.

Note that generalizations of logical truth can involve paradoxes, incompleteness, undecidability, etc.

7. Reality truth
Reality truth: approximations using all math values, probability and statistics, etc., which may use logical truth. Traditional science involves reality truth.

Reality truth involves what exactly is real, or reality. Reality truth involves probability, statistics, approximations, unknowns, etc. The traditional scientific method involves reality truth. So does, to some extent, the traditional legal process.

8. Opinion truth
Opinion truth: all other types of truth, which may or may not use logical and reality truth, but need not do so.

Human truth can be whatever one or more humans decide it is. Thus, there are no precise rules for defining human truth other than it is not necessarily logical truth or statistical truth.

9. The table
Table illusion 2Advice/adage:

10. Computer science
In a programming languages course, one is primarily concerned with logical truth. There may or may not be any connection of logical truth with reality truth and/or human truth.

Thus, a Boolean condition that is either true or false may or may have no connection to "reality".

11. Two-valued logic: Introduction

12. Infinite valued logic
InfinityArithmetic operations (addition, subtraction, etc.) involve a potentially infinite number of integer values. Note: In math, integers are infinite. In computers, integers are of finite size.

13. Two valued logic
Only two values are needed for two-value logic, so it must be easier than integer arithmetic.

Often, 1 is used for true and 0 is used for false.

Thus, truth table logic using two values must be simpler than arithmetic operations and logic.

14. George Boole
Logical operations, sometimes called Boolean operations after George Boole (Founder of Boolean logic) (1820-1898), are operations that involve two values, true and false.

15. Two values
Two values are needed for two value logic. Here are some examples.

16. Double-edged swords
Double-edged swords have a true edge (very sharp) and a false edge (not so sharp).

Get the point? It might give you an edge.

17. Happy
Smiley face

18. Sad
Frowny face

19. Magnets
Magnets have opposite polarities, called poles.

20. Magnetic disks
Magnetic media, such as fixed/floppy disks, use one polarity for 1 and the other for 0.

Can magnets have a nice appearance?

21. CDs and DVDs
Optical media, such as CD-ROM's, use high or low reflectivity as two values.

22. Electrical values
The high or low current or voltage can be used as 0 and 1.

What can you say about electrical engineers?

23. Literal values
The literal names true and false are the simplest form of what are called logical expressions.

A literal literally expresses a value and cannot be simplified. In this case, the expression true expresses the value true and the expression false expresses the value false.

Be aware that mathematicians often call an expression a formula while computer scientists often call a formula an expression.

24. Relating values
Yin Yang orbitsSince we have two distinct values,

25. C programming
The C programming language does not directly support Boolean values except as conditions (for if, while, etc.).

Even in other languages, it is often best to use 0 for false, 1 for true, and allow for additional integer values for additional states.

26. End of page

27. Multiple choice questions for this page