{"id":836,"date":"2016-12-19T18:55:40","date_gmt":"2016-12-19T18:55:40","guid":{"rendered":"https:\/\/courses.lumenlearning.com\/waymakermath4libarts\/?post_type=chapter&#038;p=836"},"modified":"2019-05-30T16:37:13","modified_gmt":"2019-05-30T16:37:13","slug":"logical-statements-and-truth-tables","status":"publish","type":"chapter","link":"https:\/\/courses.lumenlearning.com\/waymakermath4libarts\/chapter\/logical-statements-and-truth-tables\/","title":{"raw":"Boolean Logic","rendered":"Boolean Logic"},"content":{"raw":"<div class=\"textbox learning-objectives\">\r\n<h3>Learning Outcomes<\/h3>\r\n<ul>\r\n \t<li>Combine sets using Boolean logic, using proper notations<\/li>\r\n \t<li>Use statements and conditionals to write and interpret expressions<\/li>\r\n \t<li>Use a truth table to interpret complex statements or conditionals<\/li>\r\n \t<li>Write truth tables given a logical implication, and it\u2019s related\u00a0statements \u2013 converse, inverse, and contrapositive<\/li>\r\n \t<li>Determine whether two statements are logically equivalent<\/li>\r\n \t<li>Use DeMorgan\u2019s laws to define logical equivalences of a statement<\/li>\r\n<\/ul>\r\n<\/div>\r\nLogic is, basically, the study of valid reasoning. When searching the internet, we use Boolean logic \u2013 terms like \u201cand\u201d and \u201cor\u201d \u2013 to help us find specific web pages that fit in the sets we are interested in. After exploring this form of logic, we will look at logical arguments and how we can determine the validity of a claim.\r\n<h3>Boolean Logic<\/h3>\r\nWe can often classify items as belonging to sets. If you went the library to search for a book and they asked you to express your search using unions, intersections, and complements of sets, that would feel a little strange. Instead, we typically using words like \u201cand,\u201d \u201cor,\" and \u201cnot\u201d to connect our keywords together to form a search. These words, which form the basis of <strong>Boolean logic<\/strong>, are directly related to set operations with the same terminology.\r\n<div class=\"textbox\">\r\n<h3>Boolean Logic<\/h3>\r\nBoolean logic combines multiple statements that are either true or false into an expression that is either true or false.\r\n<ul>\r\n \t<li>In connection to sets, a boolean search is true if the element in question is part of the set being searched.<\/li>\r\n<\/ul>\r\n<\/div>\r\nSuppose <em>M<\/em> is the set of all mystery books, and <em>C<\/em> is the set of all comedy books. If we search for \u201cmystery\u201d, we are looking for all the books that are an element of the set <em>M<\/em>; the search is true for books that are in the set.\r\n\r\nWhen we search for \u201cmystery <em>and<\/em> comedy\u201d we are looking for a book that is an element of both sets, in the intersection. If we were to search for \u201cmystery<em> or<\/em> comedy\u201d we are looking for a book that is a mystery, a comedy, or both, which is the union of the sets. If we searched for \u201c<em>not <\/em>comedy\u201d we are looking for any book in the library that is not a comedy, the complement of the set <em>C<\/em>.\r\n<div class=\"textbox\">\r\n<h3>Connection to Set Operations<\/h3>\r\n<em>A <\/em>and<em> B<\/em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 elements in the intersection <em>A<\/em> \u22c2 <em>B<\/em>\r\n\r\n<em>A<\/em> or <em>B<\/em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 elements in the union <em>A<\/em> \u22c3 <em>B <\/em>\r\n\r\nNot <em>A<\/em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 elements in the complement <em>Ac<\/em>\r\n\r\n<\/div>\r\nNotice here that <em>or<\/em> is not exclusive. This is a difference between the Boolean logic use of the word and common everyday use. When your significant other asks \u201cdo you want to go to the park or the movies?\u201d they usually are proposing an exclusive choice \u2013 one option or the other, but not both. In Boolean logic, the <em>or<\/em> is not exclusive \u2013 more like being asked at a restaurant \u201cwould you like fries or a drink with that?\u201d Answering \u201cboth, please\u201d is an acceptable answer.\r\n\r\nIn the following video, You will see examples of how Boolean operators are used to denote sets.\r\n\r\nhttp:\/\/youtu.be\/ZOLinnoXEAw\r\n<div class=\"textbox exercises\">\r\n<h3>Example<\/h3>\r\nSuppose we are searching a library database for Mexican universities. Express a reasonable search using Boolean logic.\r\n[reveal-answer q=\"912486\"]Show Solution[\/reveal-answer]\r\n[hidden-answer a=\"912486\"]\r\n\r\nWe could start with the search \u201cMexico <em>and <\/em>university\u201d, but would be likely to find results for the U.S. state New Mexico. To account for this, we could revise our search to read:\r\n\r\nMexico <em>and<\/em> university <em>not <\/em>\u201cNew Mexico\u201d\r\n\r\n[\/hidden-answer]\r\n\r\n<\/div>\r\nIn most internet search engines, it is not necessary to include the word <em>and<\/em>; the search engine assumes that if you provide two keywords you are looking for both. In Google\u2019s search, the keyword <em>or<\/em> has be capitalized as OR, and a negative sign in front of a word is used to indicate <em>not<\/em>. Quotes around a phrase indicate that the entire phrase should be looked for. The search from the previous example on Google could be written:\r\n<p style=\"text-align: center;\">Mexico university -\u201cNew Mexico\u201d<\/p>\r\n\r\n<div class=\"textbox exercises\">\r\n<h3>Example<\/h3>\r\nDescribe the numbers that meet the condition:\r\n\r\neven and less than 10 and greater than 0\r\n[reveal-answer q=\"670488\"]Show Solution[\/reveal-answer]\r\n[hidden-answer a=\"670488\"]The numbers that satisfy all three requirements are {2, 4, 6, 8}\r\n\r\n[\/hidden-answer]\r\n\r\n<\/div>\r\n<div class=\"textbox key-takeaways\">\r\n<h3>Try It<\/h3>\r\n<iframe id=\"mom5\" class=\"resizable\" src=\"https:\/\/www.myopenmath.com\/multiembedq.php?id=25592&amp;theme=oea&amp;iframe_resize_id=mom5\" width=\"100%\" height=\"150\"><\/iframe>\r\n\r\n<\/div>\r\n<h3>Which Comes First?<\/h3>\r\nSometimes statements made in English can be ambiguous. For this reason, Boolean logic uses parentheses to show precedent, just like in algebraic order of operations.\r\n\r\nThe English phrase \u201cGo to the store and buy me eggs and bagels or cereal\u201d is ambiguous; it is not clear whether the requestors is asking for eggs always along with either bagels or cereal, or whether they\u2019re asking for either the combination of eggs and bagels, or just cereal.\r\n\r\nFor this reason, using parentheses clarifies the intent:\r\n<table>\r\n<tbody>\r\n<tr>\r\n<td>Eggs and (bagels or cereal) means<\/td>\r\n<td>Option 1: Eggs and bagels, Option 2: Eggs and cereal<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>(Eggs and bagels) or cereal means<\/td>\r\n<td>\u00a0Option 1: Eggs and bagels, Option 2: Cereal<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<div class=\"textbox exercises\">\r\n<h3>Example<\/h3>\r\nDescribe the numbers that meet the condition:\r\n\r\nodd number and less than 20 and greater than 0 and (multiple of 3 or multiple of 5)\r\n[reveal-answer q=\"877489\"]Show Solution[\/reveal-answer]\r\n[hidden-answer a=\"877489\"]\r\n\r\nThe first three conditions limit us to the set {1, 3, 5, 7, 9, 11, 13, 15, 17, 19}\r\n\r\nThe last grouped conditions tell us to find elements of this set that are also either a multiple of 3 or a multiple of 5. This leaves us with the set {3, 5, 9, 15}\r\n\r\nNotice that we would have gotten a very different result if we had written\r\n\r\n(odd number and less than 20 and greater than 0 and multiple of 3) or multiple of 5\r\n\r\nThe first grouped set of conditions would give {3, 9, 15}. When combined with the last condition, though, this set expands without limits:\r\n<p style=\"text-align: center;\">{3, 5, 9, 15, 20, 25, 30, 35, 40, 45, \u2026}<\/p>\r\n[\/hidden-answer]\r\n\r\n<\/div>\r\nBe aware that when a string of conditions is written without grouping symbols, it is often interpreted from the left to right, resulting in the latter interpretation.\r\n<h3>Conditionals<\/h3>\r\nBeyond searching, Boolean logic is commonly used in spreadsheet applications like Excel to do conditional calculations. A <strong>statement<\/strong> is something that is either true or false.\r\n<div class=\"textbox exercises\">\r\n<h3>Example<\/h3>\r\nA statement like 3 &lt; 5 is true; a statement like \u201ca rat is a fish\u201d is false. A statement like \u201cx &lt; 5\u201d is true for some values of <em>x<\/em> and false for others.\r\nWhen an action is taken or not depending on the value of a statement, it forms a <strong>conditional<\/strong>.\r\n\r\n<\/div>\r\n<div class=\"textbox\">\r\n<h3>Statements and Conditionals<\/h3>\r\nA <strong>statement<\/strong> is either true or false.\r\nA <strong>conditional<\/strong> is a compound statement of the form\r\n\u201cif <em>p<\/em> then <em>q\u201d<\/em> \u00a0or \u00a0\u201cif <em>p<\/em> then <em>q<\/em>, else <em>s<\/em>\u201d.\r\n\r\n<\/div>\r\nIn common language, an example of a conditional statement would be \u201cIf it is raining, then we\u2019ll go to the mall. Otherwise we\u2019ll go for a hike.\u201d\r\nThe statement \u201cIf it is raining\u201d is the condition\u2014this may be true or false for any given day. If the condition is true, then we will follow the first course of action, and go to the mall. If the condition is false, then we will use the alternative, and go for a hike.\r\n<div class=\"textbox key-takeaways\">\r\n<h3>Try It<\/h3>\r\n<iframe id=\"mom5\" class=\"resizable\" src=\"https:\/\/www.myopenmath.com\/multiembedq.php?id=108578&amp;theme=oea&amp;iframe_resize_id=mom5\" width=\"100%\" height=\"350\"><\/iframe>\r\n<iframe id=\"mom50\" class=\"resizable\" src=\"https:\/\/www.myopenmath.com\/multiembedq.php?id=108573&amp;theme=oea&amp;iframe_resize_id=mom\" width=\"100%\" height=\"350\"><\/iframe>\r\n\r\n<\/div>\r\n<h3>Excel<\/h3>\r\nConditional statements are commonly used in spreadsheet applications like Excel. In Excel, you can enter an expression like\r\n<p style=\"text-align: center;\">=IF(A1&lt;2000, A1+1, A1*2)<\/p>\r\nNotice that after the IF, there are three parts. The first part is the condition, and the second two are calculations.\r\n\r\nExcel will look at the value in cell A1 and compare it to 2000. If that condition is true, then the first calculation is used, and 1 is added to the value of A1 and the result is stored. If the condition is false, then the second calculation is used, and A1 is multiplied by 2 and the result is stored.\r\n\r\nIn other words, this statement is equivalent to saying \u201cIf the value of A1 is less than 2000, then add 1 to the value in A1. Otherwise, multiple A1 by 2\u201d\r\n<div class=\"textbox exercises\">\r\n<h3>Example<\/h3>\r\nWrite an Excel command that will create the condition \u201cA1 &lt; 3000 and A1 &gt; 100\u201d.\r\n[reveal-answer q=\"870468\"]Show Solution[\/reveal-answer]\r\n[hidden-answer a=\"870468\"]\r\n\r\nEnter \u201cAND(A1&lt;3000, A1&gt;100)\u201d.\u00a0\u00a0 Likewise, for the condition \u201cA1=4 or A1=6\u201d you would enter \u201cOR(A1=4, A1=6)\u201d\r\n\r\n[\/hidden-answer]\r\n\r\n<\/div>\r\n<div class=\"textbox exercises\">\r\n<h3>Example<\/h3>\r\nGiven the Excel expression:\r\n<p style=\"text-align: center;\">IF(A1 &gt; 5, 2*A1, 3*A1)<\/p>\r\nFind the following:\r\n<ol>\r\n \t<li>the result if A1 is 3, and<\/li>\r\n \t<li>the result if A1 is 8<\/li>\r\n<\/ol>\r\n[reveal-answer q=\"488310\"]Show Solution[\/reveal-answer]\r\n[hidden-answer a=\"488310\"]\r\n\r\nThis is equivalent to saying\r\n<p style=\"text-align: center;\">If A1 &gt;5, then calculate 2*A1. Otherwise, calculate 3*A1<\/p>\r\nIf A1 is 3, then the condition is false, since 3 &gt; 5 is not true, so we do the alternate action, and multiple by 3, giving 3*3 = 9\r\nIf A1 is 8, then the condition is true, since 8 &gt; 5, so we multiply the value by 2, giving 2*8=16\r\n[\/hidden-answer]\r\n\r\n<\/div>\r\n<div class=\"textbox key-takeaways\">\r\n<h3>Try It<\/h3>\r\n<iframe id=\"mom9\" class=\"resizable\" src=\"https:\/\/www.myopenmath.com\/multiembedq.php?id=24162&amp;theme=oea&amp;iframe_resize_id=mom9\" width=\"100%\" height=\"200\"><\/iframe>\r\n\r\n<\/div>\r\n&nbsp;\r\n<div class=\"textbox exercises\">\r\n<h3>Example<\/h3>\r\nAn accountant needs to withhold 15% of income for taxes if the income is below $30,000, and 20% of income if the income is $30,000 or more.\u00a0\u00a0 Write an Excel expression that would calculate the amount to withhold.\r\n[reveal-answer q=\"586943\"]Show Solution[\/reveal-answer]\r\n[hidden-answer a=\"586943\"]\r\n\r\nOur conditional needs to compare the value to 30,000. If the income is less than 30,000, we need to calculate 15% of the income: 0.15*income. If the income is more than 30,000, we need to calculate 20% of the income: 0.20*income.\r\n\r\nIn words we could write \u201cIf income &lt; 30,000, then multiply by 0.15, otherwise multiply by 0.20\u201d. In Excel, we would write:\r\n=IF(A1&lt;30000, 0.15*A1, 0.20*A1)\r\n[\/hidden-answer]\r\n\r\n<\/div>\r\n<div class=\"textbox key-takeaways\">\r\n<h3>Try It<\/h3>\r\n<iframe id=\"mom17\" class=\"resizable\" src=\"https:\/\/www.myopenmath.com\/multiembedq.php?id=25462&amp;theme=oea&amp;iframe_resize_id=mom17\" width=\"100%\" height=\"250\"><\/iframe>\r\n\r\n<\/div>\r\nAs we did earlier, we can create more complex conditions by using the operators <em>and<\/em>, <em>or<\/em>, and <em>not<\/em> to join simpler conditions together.\r\n<div class=\"textbox exercises\">\r\n<h3>Example<\/h3>\r\nA parent might say to their child \u201cif you clean your room and take out the garbage, then you can have ice cream.\u201d Under what circumstances will this conditional be true?\r\n[reveal-answer q=\"47615\"]Show Solution[\/reveal-answer]\r\n[hidden-answer a=\"47615\"]\r\n\r\nHere, there are two simpler conditions:\r\n<ol>\r\n \t<li>The child cleaning her room<\/li>\r\n \t<li>The child taking out the garbage<\/li>\r\n<\/ol>\r\nSince these conditions were joined with <em>and<\/em>, then the combined conditional will only be true if both simpler conditions are true; if either chore is not completed then the parent\u2019s condition is not met.\r\n[\/hidden-answer]\r\n\r\n<\/div>\r\nNotice that if the parent had said \u201cif you clean your room <em>or<\/em> take out the garbage, then you can have ice cream\u201d, then the child would only need to complete one chore to meet the condition.\r\n<div class=\"textbox exercises\">\r\n<h3>Example<\/h3>\r\nIn a spreadsheet, cell A1 contains annual income, and A2 contains number of dependents.\r\n\r\nA certain tax credit applies if someone with no dependents earns less than $10,000 and has no dependents, or if someone with dependents earns less than $20,000. Write a rule that describes this.\r\n[reveal-answer q=\"488063\"]Show Solution[\/reveal-answer]\r\n[hidden-answer a=\"488063\"]\r\n\r\nThere are two ways the rule is met:\r\n\r\nincome is less than 10,000 <em>and<\/em> dependents is 0,\u00a0\u00a0 <em>or<\/em>\r\n\r\nincome is less than 20,000 <em>and<\/em> dependents is not 0.\r\n\r\nInformally, we could write these as\r\n\r\n(A1 &lt; 10000 <em>and<\/em> A2 = 0) <em>or<\/em> (A1 &lt; 20000 <em>and<\/em> A2 &gt; 0)\r\n\r\nNotice that the A2 &gt; 0 condition is actually redundant and not necessary, since we\u2019d only be considering that <em>or<\/em> case if the first pair of conditions were not met. So this could be simplified to\r\n\r\n(A1 &lt; 10000 <em>and<\/em> A2 = 0) <em>or<\/em> (A1 &lt; 20000)\r\n\r\nIn Excel\u2019s format, we\u2019d write\r\n\r\n= IF ( OR( AND(A1 &lt; 10000, A2 = 0), A1 &lt; 20000), \u201cyou qualify\u201d, \u201cyou don\u2019t qualify\u201d)\r\n\r\n[\/hidden-answer]\r\n\r\n<\/div>","rendered":"<div class=\"textbox learning-objectives\">\n<h3>Learning Outcomes<\/h3>\n<ul>\n<li>Combine sets using Boolean logic, using proper notations<\/li>\n<li>Use statements and conditionals to write and interpret expressions<\/li>\n<li>Use a truth table to interpret complex statements or conditionals<\/li>\n<li>Write truth tables given a logical implication, and it\u2019s related\u00a0statements \u2013 converse, inverse, and contrapositive<\/li>\n<li>Determine whether two statements are logically equivalent<\/li>\n<li>Use DeMorgan\u2019s laws to define logical equivalences of a statement<\/li>\n<\/ul>\n<\/div>\n<p>Logic is, basically, the study of valid reasoning. When searching the internet, we use Boolean logic \u2013 terms like \u201cand\u201d and \u201cor\u201d \u2013 to help us find specific web pages that fit in the sets we are interested in. After exploring this form of logic, we will look at logical arguments and how we can determine the validity of a claim.<\/p>\n<h3>Boolean Logic<\/h3>\n<p>We can often classify items as belonging to sets. If you went the library to search for a book and they asked you to express your search using unions, intersections, and complements of sets, that would feel a little strange. Instead, we typically using words like \u201cand,\u201d \u201cor,&#8221; and \u201cnot\u201d to connect our keywords together to form a search. These words, which form the basis of <strong>Boolean logic<\/strong>, are directly related to set operations with the same terminology.<\/p>\n<div class=\"textbox\">\n<h3>Boolean Logic<\/h3>\n<p>Boolean logic combines multiple statements that are either true or false into an expression that is either true or false.<\/p>\n<ul>\n<li>In connection to sets, a boolean search is true if the element in question is part of the set being searched.<\/li>\n<\/ul>\n<\/div>\n<p>Suppose <em>M<\/em> is the set of all mystery books, and <em>C<\/em> is the set of all comedy books. If we search for \u201cmystery\u201d, we are looking for all the books that are an element of the set <em>M<\/em>; the search is true for books that are in the set.<\/p>\n<p>When we search for \u201cmystery <em>and<\/em> comedy\u201d we are looking for a book that is an element of both sets, in the intersection. If we were to search for \u201cmystery<em> or<\/em> comedy\u201d we are looking for a book that is a mystery, a comedy, or both, which is the union of the sets. If we searched for \u201c<em>not <\/em>comedy\u201d we are looking for any book in the library that is not a comedy, the complement of the set <em>C<\/em>.<\/p>\n<div class=\"textbox\">\n<h3>Connection to Set Operations<\/h3>\n<p><em>A <\/em>and<em> B<\/em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 elements in the intersection <em>A<\/em> \u22c2 <em>B<\/em><\/p>\n<p><em>A<\/em> or <em>B<\/em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 elements in the union <em>A<\/em> \u22c3 <em>B <\/em><\/p>\n<p>Not <em>A<\/em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 elements in the complement <em>Ac<\/em><\/p>\n<\/div>\n<p>Notice here that <em>or<\/em> is not exclusive. This is a difference between the Boolean logic use of the word and common everyday use. When your significant other asks \u201cdo you want to go to the park or the movies?\u201d they usually are proposing an exclusive choice \u2013 one option or the other, but not both. In Boolean logic, the <em>or<\/em> is not exclusive \u2013 more like being asked at a restaurant \u201cwould you like fries or a drink with that?\u201d Answering \u201cboth, please\u201d is an acceptable answer.<\/p>\n<p>In the following video, You will see examples of how Boolean operators are used to denote sets.<\/p>\n<p><iframe loading=\"lazy\" id=\"oembed-1\" title=\"Boolean Set Operations\" width=\"500\" height=\"375\" src=\"https:\/\/www.youtube.com\/embed\/ZOLinnoXEAw?feature=oembed&#38;rel=0\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<div class=\"textbox exercises\">\n<h3>Example<\/h3>\n<p>Suppose we are searching a library database for Mexican universities. Express a reasonable search using Boolean logic.<\/p>\n<div class=\"qa-wrapper\" style=\"display: block\"><span class=\"show-answer collapsed\" style=\"cursor: pointer\" data-target=\"q912486\">Show Solution<\/span><\/p>\n<div id=\"q912486\" class=\"hidden-answer\" style=\"display: none\">\n<p>We could start with the search \u201cMexico <em>and <\/em>university\u201d, but would be likely to find results for the U.S. state New Mexico. To account for this, we could revise our search to read:<\/p>\n<p>Mexico <em>and<\/em> university <em>not <\/em>\u201cNew Mexico\u201d<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p>In most internet search engines, it is not necessary to include the word <em>and<\/em>; the search engine assumes that if you provide two keywords you are looking for both. In Google\u2019s search, the keyword <em>or<\/em> has be capitalized as OR, and a negative sign in front of a word is used to indicate <em>not<\/em>. Quotes around a phrase indicate that the entire phrase should be looked for. The search from the previous example on Google could be written:<\/p>\n<p style=\"text-align: center;\">Mexico university -\u201cNew Mexico\u201d<\/p>\n<div class=\"textbox exercises\">\n<h3>Example<\/h3>\n<p>Describe the numbers that meet the condition:<\/p>\n<p>even and less than 10 and greater than 0<\/p>\n<div class=\"qa-wrapper\" style=\"display: block\"><span class=\"show-answer collapsed\" style=\"cursor: pointer\" data-target=\"q670488\">Show Solution<\/span><\/p>\n<div id=\"q670488\" class=\"hidden-answer\" style=\"display: none\">The numbers that satisfy all three requirements are {2, 4, 6, 8}<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"textbox key-takeaways\">\n<h3>Try It<\/h3>\n<p><iframe loading=\"lazy\" id=\"mom5\" class=\"resizable\" src=\"https:\/\/www.myopenmath.com\/multiembedq.php?id=25592&amp;theme=oea&amp;iframe_resize_id=mom5\" width=\"100%\" height=\"150\"><\/iframe><\/p>\n<\/div>\n<h3>Which Comes First?<\/h3>\n<p>Sometimes statements made in English can be ambiguous. For this reason, Boolean logic uses parentheses to show precedent, just like in algebraic order of operations.<\/p>\n<p>The English phrase \u201cGo to the store and buy me eggs and bagels or cereal\u201d is ambiguous; it is not clear whether the requestors is asking for eggs always along with either bagels or cereal, or whether they\u2019re asking for either the combination of eggs and bagels, or just cereal.<\/p>\n<p>For this reason, using parentheses clarifies the intent:<\/p>\n<table>\n<tbody>\n<tr>\n<td>Eggs and (bagels or cereal) means<\/td>\n<td>Option 1: Eggs and bagels, Option 2: Eggs and cereal<\/td>\n<\/tr>\n<tr>\n<td>(Eggs and bagels) or cereal means<\/td>\n<td>\u00a0Option 1: Eggs and bagels, Option 2: Cereal<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"textbox exercises\">\n<h3>Example<\/h3>\n<p>Describe the numbers that meet the condition:<\/p>\n<p>odd number and less than 20 and greater than 0 and (multiple of 3 or multiple of 5)<\/p>\n<div class=\"qa-wrapper\" style=\"display: block\"><span class=\"show-answer collapsed\" style=\"cursor: pointer\" data-target=\"q877489\">Show Solution<\/span><\/p>\n<div id=\"q877489\" class=\"hidden-answer\" style=\"display: none\">\n<p>The first three conditions limit us to the set {1, 3, 5, 7, 9, 11, 13, 15, 17, 19}<\/p>\n<p>The last grouped conditions tell us to find elements of this set that are also either a multiple of 3 or a multiple of 5. This leaves us with the set {3, 5, 9, 15}<\/p>\n<p>Notice that we would have gotten a very different result if we had written<\/p>\n<p>(odd number and less than 20 and greater than 0 and multiple of 3) or multiple of 5<\/p>\n<p>The first grouped set of conditions would give {3, 9, 15}. When combined with the last condition, though, this set expands without limits:<\/p>\n<p style=\"text-align: center;\">{3, 5, 9, 15, 20, 25, 30, 35, 40, 45, \u2026}<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p>Be aware that when a string of conditions is written without grouping symbols, it is often interpreted from the left to right, resulting in the latter interpretation.<\/p>\n<h3>Conditionals<\/h3>\n<p>Beyond searching, Boolean logic is commonly used in spreadsheet applications like Excel to do conditional calculations. A <strong>statement<\/strong> is something that is either true or false.<\/p>\n<div class=\"textbox exercises\">\n<h3>Example<\/h3>\n<p>A statement like 3 &lt; 5 is true; a statement like \u201ca rat is a fish\u201d is false. A statement like \u201cx &lt; 5\u201d is true for some values of <em>x<\/em> and false for others.<br \/>\nWhen an action is taken or not depending on the value of a statement, it forms a <strong>conditional<\/strong>.<\/p>\n<\/div>\n<div class=\"textbox\">\n<h3>Statements and Conditionals<\/h3>\n<p>A <strong>statement<\/strong> is either true or false.<br \/>\nA <strong>conditional<\/strong> is a compound statement of the form<br \/>\n\u201cif <em>p<\/em> then <em>q\u201d<\/em> \u00a0or \u00a0\u201cif <em>p<\/em> then <em>q<\/em>, else <em>s<\/em>\u201d.<\/p>\n<\/div>\n<p>In common language, an example of a conditional statement would be \u201cIf it is raining, then we\u2019ll go to the mall. Otherwise we\u2019ll go for a hike.\u201d<br \/>\nThe statement \u201cIf it is raining\u201d is the condition\u2014this may be true or false for any given day. If the condition is true, then we will follow the first course of action, and go to the mall. If the condition is false, then we will use the alternative, and go for a hike.<\/p>\n<div class=\"textbox key-takeaways\">\n<h3>Try It<\/h3>\n<p><iframe loading=\"lazy\" id=\"mom5\" class=\"resizable\" src=\"https:\/\/www.myopenmath.com\/multiembedq.php?id=108578&amp;theme=oea&amp;iframe_resize_id=mom5\" width=\"100%\" height=\"350\"><\/iframe><br \/>\n<iframe loading=\"lazy\" id=\"mom50\" class=\"resizable\" src=\"https:\/\/www.myopenmath.com\/multiembedq.php?id=108573&amp;theme=oea&amp;iframe_resize_id=mom\" width=\"100%\" height=\"350\"><\/iframe><\/p>\n<\/div>\n<h3>Excel<\/h3>\n<p>Conditional statements are commonly used in spreadsheet applications like Excel. In Excel, you can enter an expression like<\/p>\n<p style=\"text-align: center;\">=IF(A1&lt;2000, A1+1, A1*2)<\/p>\n<p>Notice that after the IF, there are three parts. The first part is the condition, and the second two are calculations.<\/p>\n<p>Excel will look at the value in cell A1 and compare it to 2000. If that condition is true, then the first calculation is used, and 1 is added to the value of A1 and the result is stored. If the condition is false, then the second calculation is used, and A1 is multiplied by 2 and the result is stored.<\/p>\n<p>In other words, this statement is equivalent to saying \u201cIf the value of A1 is less than 2000, then add 1 to the value in A1. Otherwise, multiple A1 by 2\u201d<\/p>\n<div class=\"textbox exercises\">\n<h3>Example<\/h3>\n<p>Write an Excel command that will create the condition \u201cA1 &lt; 3000 and A1 &gt; 100\u201d.<\/p>\n<div class=\"qa-wrapper\" style=\"display: block\"><span class=\"show-answer collapsed\" style=\"cursor: pointer\" data-target=\"q870468\">Show Solution<\/span><\/p>\n<div id=\"q870468\" class=\"hidden-answer\" style=\"display: none\">\n<p>Enter \u201cAND(A1&lt;3000, A1&gt;100)\u201d.\u00a0\u00a0 Likewise, for the condition \u201cA1=4 or A1=6\u201d you would enter \u201cOR(A1=4, A1=6)\u201d<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"textbox exercises\">\n<h3>Example<\/h3>\n<p>Given the Excel expression:<\/p>\n<p style=\"text-align: center;\">IF(A1 &gt; 5, 2*A1, 3*A1)<\/p>\n<p>Find the following:<\/p>\n<ol>\n<li>the result if A1 is 3, and<\/li>\n<li>the result if A1 is 8<\/li>\n<\/ol>\n<div class=\"qa-wrapper\" style=\"display: block\"><span class=\"show-answer collapsed\" style=\"cursor: pointer\" data-target=\"q488310\">Show Solution<\/span><\/p>\n<div id=\"q488310\" class=\"hidden-answer\" style=\"display: none\">\n<p>This is equivalent to saying<\/p>\n<p style=\"text-align: center;\">If A1 &gt;5, then calculate 2*A1. Otherwise, calculate 3*A1<\/p>\n<p>If A1 is 3, then the condition is false, since 3 &gt; 5 is not true, so we do the alternate action, and multiple by 3, giving 3*3 = 9<br \/>\nIf A1 is 8, then the condition is true, since 8 &gt; 5, so we multiply the value by 2, giving 2*8=16\n<\/p><\/div>\n<\/div>\n<\/div>\n<div class=\"textbox key-takeaways\">\n<h3>Try It<\/h3>\n<p><iframe loading=\"lazy\" id=\"mom9\" class=\"resizable\" src=\"https:\/\/www.myopenmath.com\/multiembedq.php?id=24162&amp;theme=oea&amp;iframe_resize_id=mom9\" width=\"100%\" height=\"200\"><\/iframe><\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<div class=\"textbox exercises\">\n<h3>Example<\/h3>\n<p>An accountant needs to withhold 15% of income for taxes if the income is below $30,000, and 20% of income if the income is $30,000 or more.\u00a0\u00a0 Write an Excel expression that would calculate the amount to withhold.<\/p>\n<div class=\"qa-wrapper\" style=\"display: block\"><span class=\"show-answer collapsed\" style=\"cursor: pointer\" data-target=\"q586943\">Show Solution<\/span><\/p>\n<div id=\"q586943\" class=\"hidden-answer\" style=\"display: none\">\n<p>Our conditional needs to compare the value to 30,000. If the income is less than 30,000, we need to calculate 15% of the income: 0.15*income. If the income is more than 30,000, we need to calculate 20% of the income: 0.20*income.<\/p>\n<p>In words we could write \u201cIf income &lt; 30,000, then multiply by 0.15, otherwise multiply by 0.20\u201d. In Excel, we would write:<br \/>\n=IF(A1&lt;30000, 0.15*A1, 0.20*A1)\n<\/p><\/div>\n<\/div>\n<\/div>\n<div class=\"textbox key-takeaways\">\n<h3>Try It<\/h3>\n<p><iframe loading=\"lazy\" id=\"mom17\" class=\"resizable\" src=\"https:\/\/www.myopenmath.com\/multiembedq.php?id=25462&amp;theme=oea&amp;iframe_resize_id=mom17\" width=\"100%\" height=\"250\"><\/iframe><\/p>\n<\/div>\n<p>As we did earlier, we can create more complex conditions by using the operators <em>and<\/em>, <em>or<\/em>, and <em>not<\/em> to join simpler conditions together.<\/p>\n<div class=\"textbox exercises\">\n<h3>Example<\/h3>\n<p>A parent might say to their child \u201cif you clean your room and take out the garbage, then you can have ice cream.\u201d Under what circumstances will this conditional be true?<\/p>\n<div class=\"qa-wrapper\" style=\"display: block\"><span class=\"show-answer collapsed\" style=\"cursor: pointer\" data-target=\"q47615\">Show Solution<\/span><\/p>\n<div id=\"q47615\" class=\"hidden-answer\" style=\"display: none\">\n<p>Here, there are two simpler conditions:<\/p>\n<ol>\n<li>The child cleaning her room<\/li>\n<li>The child taking out the garbage<\/li>\n<\/ol>\n<p>Since these conditions were joined with <em>and<\/em>, then the combined conditional will only be true if both simpler conditions are true; if either chore is not completed then the parent\u2019s condition is not met.\n<\/div>\n<\/div>\n<\/div>\n<p>Notice that if the parent had said \u201cif you clean your room <em>or<\/em> take out the garbage, then you can have ice cream\u201d, then the child would only need to complete one chore to meet the condition.<\/p>\n<div class=\"textbox exercises\">\n<h3>Example<\/h3>\n<p>In a spreadsheet, cell A1 contains annual income, and A2 contains number of dependents.<\/p>\n<p>A certain tax credit applies if someone with no dependents earns less than $10,000 and has no dependents, or if someone with dependents earns less than $20,000. Write a rule that describes this.<\/p>\n<div class=\"qa-wrapper\" style=\"display: block\"><span class=\"show-answer collapsed\" style=\"cursor: pointer\" data-target=\"q488063\">Show Solution<\/span><\/p>\n<div id=\"q488063\" class=\"hidden-answer\" style=\"display: none\">\n<p>There are two ways the rule is met:<\/p>\n<p>income is less than 10,000 <em>and<\/em> dependents is 0,\u00a0\u00a0 <em>or<\/em><\/p>\n<p>income is less than 20,000 <em>and<\/em> dependents is not 0.<\/p>\n<p>Informally, we could write these as<\/p>\n<p>(A1 &lt; 10000 <em>and<\/em> A2 = 0) <em>or<\/em> (A1 &lt; 20000 <em>and<\/em> A2 &gt; 0)<\/p>\n<p>Notice that the A2 &gt; 0 condition is actually redundant and not necessary, since we\u2019d only be considering that <em>or<\/em> case if the first pair of conditions were not met. So this could be simplified to<\/p>\n<p>(A1 &lt; 10000 <em>and<\/em> A2 = 0) <em>or<\/em> (A1 &lt; 20000)<\/p>\n<p>In Excel\u2019s format, we\u2019d write<\/p>\n<p>= IF ( OR( AND(A1 &lt; 10000, A2 = 0), A1 &lt; 20000), \u201cyou qualify\u201d, \u201cyou don\u2019t qualify\u201d)<\/p>\n<\/div>\n<\/div>\n<\/div>\n\n\t\t\t <section class=\"citations-section\" role=\"contentinfo\">\n\t\t\t <h3>Candela Citations<\/h3>\n\t\t\t\t\t <div>\n\t\t\t\t\t\t <div id=\"citation-list-836\">\n\t\t\t\t\t\t\t <div class=\"licensing\"><div class=\"license-attribution-dropdown-subheading\">CC licensed content, Original<\/div><ul class=\"citation-list\"><li>Revision and Adaptation. <strong>Provided by<\/strong>: Lumen Learning. <strong>License<\/strong>: <em><a target=\"_blank\" rel=\"license\" href=\"https:\/\/creativecommons.org\/licenses\/by\/4.0\/\">CC BY: Attribution<\/a><\/em><\/li><\/ul><div class=\"license-attribution-dropdown-subheading\">CC licensed content, Shared previously<\/div><ul class=\"citation-list\"><li>Question ID 25462, 25592. <strong>Authored by<\/strong>: Lippman, David. <strong>License<\/strong>: <em><a target=\"_blank\" rel=\"license\" href=\"https:\/\/creativecommons.org\/licenses\/by\/4.0\/\">CC BY: Attribution<\/a><\/em>. <strong>License Terms<\/strong>: IMathAS Community License CC-BY + GPL<\/li><li>Math in Society. <strong>Authored by<\/strong>: Lippman, David. <strong>Located at<\/strong>: <a target=\"_blank\" href=\"http:\/\/www.opentextbookstore.com\/mathinsociety\/\">http:\/\/www.opentextbookstore.com\/mathinsociety\/<\/a>. <strong>License<\/strong>: <em><a target=\"_blank\" rel=\"license\" href=\"https:\/\/creativecommons.org\/licenses\/by\/4.0\/\">CC BY: Attribution<\/a><\/em><\/li><li>Question ID 108578, 108573. <strong>Authored by<\/strong>: Hartley,Josiah. <strong>License<\/strong>: <em><a target=\"_blank\" rel=\"license\" href=\"https:\/\/creativecommons.org\/licenses\/by\/4.0\/\">CC BY: Attribution<\/a><\/em>. <strong>License Terms<\/strong>: IMathAS Community License CC-BY + GPL<\/li><\/ul><\/div>\n\t\t\t\t\t\t <\/div>\n\t\t\t\t\t <\/div>\n\t\t\t <\/section>","protected":false},"author":21,"menu_order":7,"template":"","meta":{"_candela_citation":"[{\"type\":\"cc\",\"description\":\"Question ID 25462, 25592\",\"author\":\"Lippman, David\",\"organization\":\"\",\"url\":\"\",\"project\":\"\",\"license\":\"cc-by\",\"license_terms\":\"IMathAS Community License CC-BY + GPL\"},{\"type\":\"cc\",\"description\":\"Math in Society\",\"author\":\"Lippman, David\",\"organization\":\"\",\"url\":\"http:\/\/www.opentextbookstore.com\/mathinsociety\/\",\"project\":\"\",\"license\":\"cc-by\",\"license_terms\":\"\"},{\"type\":\"original\",\"description\":\"Revision and Adaptation\",\"author\":\"\",\"organization\":\"Lumen Learning\",\"url\":\"\",\"project\":\"\",\"license\":\"cc-by\",\"license_terms\":\"\"},{\"type\":\"cc\",\"description\":\"Question ID 108578, 108573\",\"author\":\"Hartley,Josiah\",\"organization\":\"\",\"url\":\"\",\"project\":\"\",\"license\":\"cc-by\",\"license_terms\":\"IMathAS Community License CC-BY + GPL\"}]","CANDELA_OUTCOMES_GUID":"3272ce56-7979-4f7a-8baf-acae8ee560cb","pb_show_title":"on","pb_short_title":"","pb_subtitle":"","pb_authors":[],"pb_section_license":""},"chapter-type":[],"contributor":[],"license":[],"class_list":["post-836","chapter","type-chapter","status-publish","hentry"],"part":159,"_links":{"self":[{"href":"https:\/\/courses.lumenlearning.com\/waymakermath4libarts\/wp-json\/pressbooks\/v2\/chapters\/836","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/courses.lumenlearning.com\/waymakermath4libarts\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/courses.lumenlearning.com\/waymakermath4libarts\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/waymakermath4libarts\/wp-json\/wp\/v2\/users\/21"}],"version-history":[{"count":27,"href":"https:\/\/courses.lumenlearning.com\/waymakermath4libarts\/wp-json\/pressbooks\/v2\/chapters\/836\/revisions"}],"predecessor-version":[{"id":2984,"href":"https:\/\/courses.lumenlearning.com\/waymakermath4libarts\/wp-json\/pressbooks\/v2\/chapters\/836\/revisions\/2984"}],"part":[{"href":"https:\/\/courses.lumenlearning.com\/waymakermath4libarts\/wp-json\/pressbooks\/v2\/parts\/159"}],"metadata":[{"href":"https:\/\/courses.lumenlearning.com\/waymakermath4libarts\/wp-json\/pressbooks\/v2\/chapters\/836\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/courses.lumenlearning.com\/waymakermath4libarts\/wp-json\/wp\/v2\/media?parent=836"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/waymakermath4libarts\/wp-json\/pressbooks\/v2\/chapter-type?post=836"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/waymakermath4libarts\/wp-json\/wp\/v2\/contributor?post=836"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/waymakermath4libarts\/wp-json\/wp\/v2\/license?post=836"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}