{{page>Templates:Science}} Inclusion, or "inclusivity" in [[logic]] and [[computer science]] broadly refers to a quality inherent to certain expressions. Specifically, an expression is inclusive if a proposed range of an expression includes the start and end point of that range. Take this expression as an example: ====== Computer Science ====== X = //greater than// 5 AND //smaller than// 10\\ In a strict sense, 5 is not greater than 5. A number greater than 5 would be 5.00001, but not 5. Whether an application still counts 5 as being within the range of the original expression depends on how it is built.\\ \\ For example, number ranges: What are the numbers from 5 to 10? That would be 5, 6, 7, 8, 9 and 10. But one could also say, depending on how they interpret it, 5, 6, 7, 8 and 9.\\ Both are correct, but one is inclusive, the other exclusive. ====== Logic ====== In logic, inclusivity describes whether an expression includes itself. Follow through //this// example: [[logic operator#and|AND]] is a [[logic operator|logical operator]] that returns true if TWO conditions are met at the same time. A kid can have:\\ (Ice Cream) AND (Candy)\\ It gets both. [[logic operator#or|OR]], on the other hand, returns true if at least one of the conditions is met. What does the kid hold in its hands?\\ (Ice Cream) OR (Candy)\\ Imagine you are asked "does it hold candy or ice cream?", you look at the kid and find that it holds both, but you can only respond with "yes" or "no", you would say "yes". [[logic operator#xor|XOR]] is an //exclusive// or. It returns true only when one, and only one condition is met.\\ (Ice Cream) XOR (Candy)\\ The child can have ice cream XOR candy - ie. one or the other, but not both.((It was really hard to find a real world example use case for XOR, I gave up, googled for it and went with [[https://stackoverflow.com/a/18944879|this]] one. While real world analogies for XOR are hard to imagine, they have important use cases in [[programming]].))