Floor and ceiling functions: Difference between revisions

From formulasearchengine
Jump to navigation Jump to search
en>DemocraticLuntz
Reverted 1 good faith edit by 87.65.146.39 using STiki
en>Saqdefaq
Undid revision 641784232 by Saqdefaq (talk)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
In [[set theory]], a '''complement''' of a set ''A'' refers to things not in (that is, things outside of) ''A''. The '''relative complement''' of ''A'' with respect to a set ''B'', is the set of elements in ''B'' but not in ''A''. When all sets under consideration are considered to be subsets of a given set ''U'', the '''absolute complement''' of ''A'' is the set of all elements in ''U'' but not in ''A''.
25 yrs old Jewellery Designer Fletcher from Thornhill, has hobbies such as studying to pilot a plane, sport betting and crocheting. In the recent month or two has made a journey to spots like Historic Villages of Korea: Hahoe and Yangdong.
 
== Relative complement ==
 
<!-- Many links redirect to this section:
[[difference (set theory)]], [[difference of two sets]], [[relative complement]], [[set-theoretic difference]], [[set difference]], [[set minus]], [[set subtraction]], [[set theoretic difference]], [[setminus]] -->
 
If ''A'' and ''B'' are [[set (mathematics)|sets]], then the '''relative complement''' of ''A'' in ''B'',<ref name="H17">Halmos (1960) p.17</ref> also termed the '''set-theoretic difference''' of ''B'' and ''A'',<ref>Devlin (1979) p.6</ref> is the set of elements in ''B'', but not in ''A''.
 
[[File:Venn0010.svg|250px|thumb|The '''relative complement''' of ''A'' (left circle) in ''B'' (right circle):
<math>A^c \cap B~~~~=~~~~B \smallsetminus A</math>]]
 
The relative complement of ''A'' in ''B'' is denoted {{nowrap|''B'' ∖ ''A''}} according to the [[ISO 31-11#Sets|ISO 31-11 standard]] (sometimes written {{nowrap|''B'' – ''A''}}, but this notation is ambiguous, as in some contexts it can be interpreted as the set of all {{nowrap|''b'' – ''a''}}, where ''b'' is taken from ''B'' and ''a'' from ''A'').
 
Formally
 
: <math>B \smallsetminus A = \{ x\in B \, | \, x \notin A \}. </math>
 
Examples:
 
:* {1,2,3}&nbsp;∖&nbsp;{2,3,4}&nbsp;&nbsp;&nbsp;=&nbsp;&nbsp;&nbsp;{1}
:* {2,3,4}&nbsp;∖&nbsp;{1,2,3}&nbsp;&nbsp;&nbsp;=&nbsp;&nbsp;&nbsp;{4}
:* If <math>\mathbb{R}</math> is the set of [[real number]]s and <math>\mathbb{Q}</math> is the set of [[rational number]]s, then <math> \mathbb{R}\smallsetminus\mathbb{Q} = \mathbb{J} </math> is the set of [[irrational number]]s.
 
The following lists some notable properties of relative complements in relation to the set-theoretic [[operation (mathematics)|operations]] of [[union (set theory)|union]] and [[intersection (set theory)|intersection]].
 
If ''A'', ''B'', and ''C'' are sets, then the following [[identity (mathematics)|identities]] hold:
 
:* ''C''&nbsp;∖&nbsp;(''A''&nbsp;∩&nbsp;''B'')&nbsp;&nbsp;=&nbsp;&nbsp;(''C''&nbsp;∖&nbsp;''A'')∪(''C''&nbsp;∖&nbsp;''B'')
:* ''C''&nbsp;∖&nbsp;(''A''&nbsp;∪&nbsp;''B'')&nbsp;&nbsp;=&nbsp;&nbsp;(''C''&nbsp;∖&nbsp;''A'')∩(''C''&nbsp;∖&nbsp;''B'')
:* ''C''&nbsp;∖&nbsp;(''B''&nbsp;∖&nbsp;''A'')&nbsp;&nbsp;=&nbsp;&nbsp;(''C''&nbsp;∩&nbsp;''A'')∪(''C''&nbsp;∖&nbsp;''B'')
 
[&nbsp;Alternately written: ''A''&nbsp;∖&nbsp;(''B''&nbsp;∖&nbsp;''C'')&nbsp;&nbsp;=&nbsp;&nbsp;(''A''&nbsp;∖&nbsp;''B'')∪(''A''&nbsp;∩&nbsp;''C'')&nbsp;]
 
:* (''B''&nbsp;∖&nbsp;''A'')&nbsp;∩&nbsp;''C''&nbsp;&nbsp;=&nbsp;&nbsp;(''B''&nbsp;∩&nbsp;''C'')&nbsp;∖&nbsp;''A''&nbsp;&nbsp;=&nbsp;&nbsp;''B''∩(''C''&nbsp;∖&nbsp;''A'')
:* (''B''&nbsp;∖&nbsp;''A'')&nbsp;∪&nbsp;''C''&nbsp;&nbsp;=&nbsp;&nbsp;(''B''&nbsp;∪&nbsp;''C'')&nbsp;∖&nbsp;(''A''&nbsp;∖&nbsp;''C'')
:* ''A''&nbsp;∖&nbsp;''A''&nbsp;&nbsp;=&nbsp;&nbsp;Ø
:* Ø&nbsp;∖&nbsp;''A''&nbsp;&nbsp;=&nbsp;&nbsp;Ø
:* ''A''&nbsp;∖&nbsp;Ø&nbsp;&nbsp;=&nbsp;&nbsp;''A''
 
==Absolute complement==<!-- This section is linked from [[Bayes' theorem]] and [[absolute set complement]] -->
 
[[File:Venn1010.svg|250px|thumb|The '''absolute complement''' of A in U:
<math>A^c=U \smallsetminus A</math>]]
 
If a [[universe (mathematics)|universe]] '''U''' is defined, then the relative complement of ''A'' in '''U''' is called the '''absolute complement''' (or simply '''complement''') of ''A'', and is denoted by ''A''<sup>c</sup> or sometimes ''A''′, also the same set often{{citation needed|date=August 2012}} is denoted by <MATH>\complement_U A</MATH> or <MATH>\complement A</MATH> if '''U''' is fixed, that is:
 
: ''A''<sup>c</sup>&nbsp;&nbsp;=&nbsp;'''U'''&nbsp;∖&nbsp;''A''.
 
For example, if the universe is the set of [[integer]]s, then the complement of the set of odd numbers is the set of even numbers.
 
The following lists some important properties of absolute complements in relation to the set-theoretic [[operation (mathematics)|operations]] of union and [[intersection (set theory)|intersection]].
 
If ''A'' and ''B'' are subsets of a [[universe (mathematics)|universe]] '''U''', then the following identities hold:
 
: [[De Morgan's laws]]:<ref name="H17" />
::* <math>\left(A \cup B \right)^{c}=A^{c} \cap B^{c} .</math>
::* <math>\left(A \cap B \right)^{c}=A^{c} \cup B^{c} .</math>
: Complement laws:<ref name="H17" />
::* <math>A \cup A^{c} =U .</math>
::* <math>A \cap A^{c} =\empty .</math>
::* <math>\empty ^{c} =U.</math>
::* <math> U^{c} =\empty.</math>
::* <math>\text{If }A\subset B\text{, then }B^{c}\subset A^{c}.</math>
::*: (this follows from the equivalence of a conditional with its [[contrapositive]])
: [[involution (mathematics)|Involution]] or double complement law:
::* <math>\left(A^{c}\right)^{c}=A.</math>
: Relationships between relative and absolute complements:
::* ''A''&nbsp;∖&nbsp;''B'' = ''A''&nbsp;∩&nbsp;''B''<sup>c</sup>
::* (''A''&nbsp;∖&nbsp;''B'')<sup>c</sup> = ''A''<sup>c</sup>&nbsp;∪&nbsp;''B''
 
The first two complement laws above shows that if ''A'' is a non-empty, [[proper subset]] of '''U''', then {''A'', ''A''<sup>c</sup>} is a [[partition of a set|partition]] of '''U'''.
 
== Notation ==
 
In the [[LaTeX]] typesetting language, the command <code>\setminus</code> is usually used for rendering a set difference symbol, which is similar to a [[backslash]] symbol. When rendered the <code>\setminus</code> command looks identical to <code>\backslash</code> except that it has a little more space in front and behind the slash, akin to the LaTeX sequence <code>\mathbin{\backslash}</code>. A variant <code>\smallsetminus</code> is available in the amssymb package.
 
== Complements in various programming languages ==
 
Some programming languages allow for manipulation of [[set (computer science)|sets as data structures]], using these operators or functions to construct the difference of sets <code>a</code> and <code>b</code>:
<!-- please keep in alphabetical order of programming language name -->
 
; [[.NET Framework]]
: <code>a.Except(b);</code>
 
; [[C++]]
: <code>set_difference(a.begin(), a.end(), b.begin(), b.end(), result.begin());</code>
 
; [[Clojure]]
: <code>(clojure.set/difference a b)</code><ref>[http://richhickey.github.com/clojure/clojure.set-api.html#clojure.set/difference] clojure.set API reference</ref>
 
; [[Common Lisp]]
: <code>set-difference, nset-difference</code><ref name="CLHS_set-difference">[http://www.lispworks.com/documentation/HyperSpec/Body/f_set_di.htm Common Lisp HyperSpec, Function set-difference, nset-difference].  Accessed on September 8, 2009.</ref>
 
; [[Haskell (programming language)|Haskell]]
: <code>a \\ b</code> <ref name="Data.Set">[http://haskell.org/ghc/docs/latest/html/libraries/containers/Data-Set.html Data.Set (Haskell)]</ref>
 
; [[Java (programming language)|Java]]
: <code>diff = a.clone();
: diff.removeAll(b);</code><ref name="J2SE_Set">[http://java.sun.com/j2se/1.5.0/docs/api/java/util/Set.html Set (Java 2 Platform SE 5.0)]. ''JavaTM 2 Platform Standard Edition 5.0 API Specification'', updated in 2004. Accessed on February 13, 2008.</ref>
 
; [[Mathematica]]
: <code>Complement</code><ref name="Mathematica_set">[http://reference.wolfram.com/mathematica/ref/Complement.html Complement]. ''Mathematica Documentation Center'' for version 6.0, updated in 2008. Accessed on March 7, 2008.</ref>
 
; [[MATLAB]]
: <code>setdiff</code><ref name="MATLAB_set">[http://www.mathworks.com/access/helpdesk/help/techdoc/ref/setdiff.html Setdiff]. ''MATLAB Function Reference'' for version 7.6, updated in 2008. Accessed on May 19, 2008.</ref>
 
; [[OCaml]]
: <code>Set.S.diff</code><ref name="OCaml_Set_S_diff">[http://caml.inria.fr/pub/docs/manual-ocaml/libref/Set.S.html Set.S (OCaml)].</ref>
 
; [[GNU Octave|Octave]]
: <code>setdiff</code><ref>[http://www.gnu.org/software/octave/doc/interpreter/index.html]. ''GNU Octave Reference Manual''</ref>
 
; [[Pascal (programming language)|Pascal]]
: <code>SetDifference := a - b;</code>
 
; [[Perl 5]]
: <code>#for perl version >= 5.10</code>
: <code>@a = grep {not $_ ~~ @b} @a;</code>
 
; [[Perl 6]]
: <code>$A ∖ $B</code>
: <code>$A (-) $B # texas version</code>
 
; [[PHP]]
: <code>array_diff($a, $b);</code><ref>[http://php.net/manual/en/function.array-diff.php PHP: array_diff], PHP Manual</ref>
 
; [[Prolog]]
: <code>a(X),\+ b(X).</code>
 
; [[Python (programming language)|Python]]
: <code>diff = a.difference(b)</code><ref name="Python_set">[http://docs.python.org/2/library/stdtypes.html?highlight=difference#set.difference]. ''Python v2.7.3 documentation''. Accessed on January 17, 2013.</ref>
: <code>diff = a - b</code><ref name="Python_set" />
 
; [[R (programming language)|R]]
: <code>setdiff</code><ref>[http://cran.r-project.org/doc/manuals/fullrefman.pdf R Reference manual p. 410].</ref>
 
; [[Ruby (programming language)|Ruby]]
: <code>diff = a - b</code><ref>[http://www.ruby-doc.org/core/classes/Array.html Class: Array] Ruby Documentation</ref>
 
; [[Scala (programming language)|Scala]]
: <code>diff = a—b</code><ref name="Scala_set">[http://www.scala-lang.org/api/current scala.collection.Set]. ''Scala Standard Library'' release 2.8.1, Accessed on December 09, 2010.</ref>
 
; [[Smalltalk (Pharo)]]
: <code>a difference: b</code>
 
; [[SQL]]
: <code> SELECT * FROM A
 
MINUS
SELECT * FROM B
 
</code>
 
; [[Unix shell]]
: <code>comm -23 a b</code><ref name="Unix_comm">[http://plan9.bell-labs.com/7thEdMan/ comm(1)], Unix Seventh Edition Manual, 1979.</ref>
: <code>grep -vf b a</code> # less efficient, but works with small unsorted sets
 
== See also ==
 
* [[Algebra of sets]]
* [[Naive set theory]]
* [[Symmetric difference]]
 
== References ==
 
<references/>
 
* {{cite book | last=Halmos | first=Paul R. | authorlink=Paul Halmos | title=Naive set theory | series=The University Series in Undergraduate Mathematics | publisher=van Nostrand Company | year=1960 | zbl=0087.04403 }}
* {{cite book | last=Devlin | first=Keith J. | authorlink=Keith Devlin | title=Fundamentals of contemporary set theory | series=Universitext | publisher=[[Springer-Verlag]] | year=1979 | isbn=0-387-90441-7 | zbl=0407.04003 }}
 
== External links ==
 
* {{MathWorld |title=Complement |id=Complement }}
* {{MathWorld |title=Complement Set |id=ComplementSet }}
 
{{Set theory}}
 
{{DEFAULTSORT:Complement (set theory)}}
 
[[Category:Basic concepts in set theory]]
[[Category:Binary operations]]

Latest revision as of 22:25, 9 January 2015

25 yrs old Jewellery Designer Fletcher from Thornhill, has hobbies such as studying to pilot a plane, sport betting and crocheting. In the recent month or two has made a journey to spots like Historic Villages of Korea: Hahoe and Yangdong.