Ramblings

ULTRACOMFY's personal homepage.

User Tools

Site Tools


inclusion

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
inclusion [2024/03/15 23:31] – created ultracomfyinclusion [2025/04/09 20:13] (current) ultracomfy
Line 1: Line 1:
-<fs xx-large>Inclusion</fs>, 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:+~~Title:Inclusion~~ 
 +<WRAP column right 18%> 
 +{{page>Templates:Science}} 
 +</WRAP>  
 + 
 +<fs xx-large>Inclusion</fs>, 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 ====== ====== Computer Science ======
Line 11: Line 16:
 In logic, inclusivity describes whether an expression includes itself. Follow through //this// example: 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.\\ +[[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:\\ 
-(Ball color = red) AND (Ball size = 12), ie. Is the ball red AND size 12?\\ +(Ice Cream) AND (Candy)\\ 
-Returns true [[iff]] the ball meets both conditions at the same time.+It gets both.
  
  
-[[logic operator#or|OR]], on the other hand, returns true if at least one of the conditions is met.\\ +[[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?\\ 
-(Ball color = red) OR (Ball size = 12), ie. is the ball red OR size 12?\\ +(Ice Cream) OR (Candy)\\ 
-It's like asking "is it at least red? or maybe size 12?", to which you would say yes if at least one applies. In semantics I would call this a "softORin logic I call it "inclusive"Now for contrast:+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.\\ [[logic operator#xor|XOR]] is an //exclusive// or. It returns true only when one, and only one condition is met.\\
-(Ball color = red) XOR (Ball size = 12), is the ball red OR size 12?\\ +(Ice Cream) XOR (Candy)\\ 
-Is it red or size 12?, asked as if you want only one of these to apply. You can have one or the other, but not both. Think of a child - it can have ice cream XOR candy - ie. one or the other, but not both.+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]].))
inclusion.1710541898.txt.gz · Last modified: 2024/03/15 23:31 by ultracomfy

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki