[This article was first published on Online College Math Teacher, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)


Want to share your content on R-bloggers? click here if you have a blog, or here if you don’t.

Rene Descartes walks into a bar, by Jerry Tuttle

I recently told the old Rene Descartes joke to a math class: Rene Descartes walks into a bar. The bartender asks, “Would you like a beer?” Descartes pauses for a moment and then replies, “I think not.” Then poof – he disappears.

Of course I naively I assumed my students had been exposed to the Descartes quote, “I think, therefore I am.” Philosopher and mathematician Rene Descartes wrote this in French in 1637, and later in Latin as cogito, ergo sum.”

After explaining the Descartes quote, I think the students understood the joke. Well, maybe it’s not that funny.

But perhaps funnier to math people than you realize, is: this joke is logically flawed because the punchline is the inverse to
the original conditional statement, and an inverse is not logically equivalent to the original statement.

Let P and Q be declarative sentences that can be definitively classified as either true or false. Then define:

  • Conditional Statement: If P, then Q.
  • Converse: If Q, then P.
  • Inverse: If not P, then not Q.
  • Contrapositive: If not Q, then not P

Two conditional statements are defined as logically equivalent when their truth values are identical for every possible combination of truth values for their individual declarative sentences.

P Q statement converse inverse contrapositive
TRUE TRUE TRUE TRUE TRUE TRUE
TRUE FALSE FALSE TRUE TRUE FALSE
FALSE TRUE TRUE FALSE FALSE TRUE
FALSE FALSE TRUE TRUE TRUE TRUE

The above table shows statement and contrapositive have the same truth values in columns 3 and 6, and so are logically equivalent. Statement and inverse are not logically equivalent.

The Descartes quote is, “If I think, therefore I am”, or “If P then Q”. The punchline is, “If I don’t think, therefore I am not”, or “If not P, then not Q”. The punchline is the inverse, and is not logically equivalent to the quote. If P is false, then “if P then Q” is true regardless of the value of Q. So Q can be either true or false.

Occasionally on television someone, often a police detective, will make a statement where they confuse a statement with its converse or inverse, and I have been known to yell at the television.

Descartes is known for developing analytic geometry, which uses algebra to describe geometry. Descartes’ rule of signs counts the roots of a polynomial by examining sign changes in its coefficients.

And before someone else feels the need to say this, I will: “Don’t put Descartes before the horse.” This is perhaps the punchline to changing the original joke to “A horse walks into a bar … ”

The following is R code to create truth tables. Logical is a variable type in R. Conditional statements in R are created
using the fact that “If P then Q” is equivalent to “Not P or Q”. I am defining the logic rules for statement, converse, inverse, contrapositive, but I could have defined the rules for more complicated statements as well.

# Define the possible values for P and Q
P <- c(TRUE, TRUE, FALSE, FALSE)
Q <- c(TRUE, FALSE, TRUE, FALSE)

# Calculate the 4 logical rules: statement, converse, inverse, contrapositive
# (Note that “if P then Q” is equivalent to “Not P or Q”.)
P_implies_Q <- !P | Q
Q_implies_P <- !Q | P
not_P_implies_not_Q <- P | !Q
not_Q_implies_not_P <- Q | !P

# expand.grid(P, Q) would also be a good start, but I wanted a specific ordering
# Create a data frame to display the truth table
truth_table <- data.frame(
P = P,
Q = Q,
`P -> Q` = P_implies_Q,
`Q -> P` = Q_implies_P,
`!P -> !Q` = not_P_implies_not_Q,
`!Q -> !P` = not_Q_implies_not_P
)

# Print the truth table
colnames(truth_table) <- c("P", "Q", "statement", "converse", "inverse", "contrapositive")
print(truth_table)

P_variable <- "I think"
Q_variable <- "I am"

colnames(truth_table) <- c(P_variable, Q_variable, "statement", "converse", "inverse", "contrapositive")
print(truth_table)

End

To leave a comment for the author, please follow the link and comment on their blog: Online College Math Teacher.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you’re looking to post or find an R/data-science job.


Want to share your content on R-bloggers? click here if you have a blog, or here if you don’t.

Continue reading: Rene Descartes walks into a bar

Analysis of the Article

The key points in the shared text rotate around the philosophical quote by Rene Descartes, “I think, therefore I am”, and its mathematical interpretation. The author makes an interesting point about the logical inaccuracy of a widely shared joke derived from the famous quote.The author also provides a programmatical approach to creating truth tables to demonstrate the logic of statement, converse, inverse, and contrapositive within the R programming framework.

Long-term Implications and Possible Future Developments

The analysis provided on the interplay between philosophy and mathematical logic reveals many future possibilities. The insights offered by the author could serve as a foundation for developing engaging educational tools that merge different disciplines like philosophy, mathematics and computer programming. By analyzing famous philosophical statement using logic, educators can stimulate critical thinking in students, improve their understanding of logic,and pique their interest in philosophy, mathematics, and programming.

Moreover, the existent codes written in the ‘R’ programming language to create truth tables presents a platform for future development of more complicated logical codes that could be used in advanced logic computations or even in the development of logical-based software.

Actionable Advice

For educators, the incorporation of engaging and unconventional teaching methods similar to those demonstrated in the text could be very beneficial. It could be a unique, effective way to pair entertainment and learning. By merging different disciplines like philosophy, mathematics and programming, they can create multidimensional teaching models that stimulate student’s critical faculties and keep them engaged.

For programmers, the given R code presents an opportunity to explore and create more sophisticated logical computations that could be used in a variety of ways including developing logical-based software.

For students or any individuals intrigued by logic, philosophy, or programming, this text invites them to delve deeper into these fields, offering them a fresh and entertaining perspective to study and understand these disciplines.

Read the original article