Guest User

Untitled

a guest
Aug 9th, 2022
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.35 KB | None | 0 0
  1. \documentclass{book}
  2.  
  3. \usepackage{newfile}
  4. \usepackage{amsmath}
  5. \usepackage{xifthen}
  6. \usepackage{enumitem}
  7. \usepackage{multicol}
  8. \usepackage{lipsum}
  9. \usepackage{multirow}
  10. \usepackage{blindtext}
  11. \usepackage{amsfonts}
  12. \usepackage{booktabs}
  13. \usepackage{longtable}
  14. \usepackage{makecell}
  15. \usepackage{cancel}
  16. \usepackage{tikz}
  17. \usetikzlibrary{tikzmark,shapes.misc}
  18. \usepackage{venndiagram}
  19. \usetikzlibrary{fit}
  20. \usepackage[left=2.00cm, right=1.00cm, top=3.00cm, bottom=3.00cm]{geometry}
  21. \usepackage{cellspace}
  22. %------------------------------------
  23.  
  24.  
  25. %-----------------------------------
  26.  
  27. \renewcommand\theadfont{\bfseries}
  28.  
  29.  
  30.  
  31.  
  32. \usepackage{verbatim}
  33. %\usepackage[active,tightpage]{preview}
  34. %\PreviewEnvironment{tikzpicture}
  35. %\setlength\PreviewBorder{5pt}%
  36.  
  37. \def\firstcircle{(0,0) circle (1.5cm)}
  38. \def\secondcircle{(0:2cm) circle (1.5cm)}
  39.  
  40. \colorlet{circle edge}{blue!50}
  41. \colorlet{circle area}{blue!20}
  42.  
  43. \tikzset{filled/.style={fill=circle area, draw=circle edge, thick},
  44. outline/.style={draw=circle edge, thick}}
  45.  
  46. \setlength{\parskip}{5mm}
  47.  
  48.  
  49. \begin{document}
  50.  
  51. \chapter{Sets and Venn Diagrams}
  52.  
  53. \section{Sets}
  54.  
  55. A set is a specific group of numbers or items from a list. The items in this set (the list list), are called Elements.\\
  56. Sets can be written in a few different ways - eg the set $A$ can be written as, $A=\{1,8,27,64\}$, $A=\{Cube \: numbers <100\}$ and $A=\{x:x \:is \:a \:cube \:number \:less \:than \:100\}$
  57.  
  58. \section{Set Notiation}
  59.  
  60. If we take the natural numbers, $\mathbb{N} \leq10$
  61.  
  62. \begin{tabular}{|c|c|c|c|}
  63. \hline
  64. Sybmol & Name & Example & Explanation\\
  65. \hline
  66. $\{\}$ & Set & \thead{$A=\{1,3\}$ \\ $B=\{2,3,9\}$ \\ $C=\{3,9\}$} & Collection of objects or items\\
  67. \hline
  68. $\cap$ & intersect & $A \cap B = \{3\}$ & 3 belongs to both sets $A$ and $B$ \\
  69. \hline
  70. $\cup$ & Union & $A \cup B = \{1,2,3,9\}$ & The elements belong to both $A$ and $B$ \\
  71. \hline
  72. $\xi$ & The universal set & $\xi=\{4,5,6,7,8,10\}$ & All the elements not in the sets \\
  73. \hline
  74. $\subset$ & Proper subset & \thead{$\{1\} \cup A$ \\ $C \cup B$} & A set is contained in another set \\
  75. \hline
  76. $\subseteq$ &Subest & $\thead{B \subseteq A \\ \{1,3\}}$ & A set that is contained in or equal to another set\\
  77. \hline
  78. $\not \subseteq$ & Not a proper subset & $\{1,3\}$ & A set the is not contained in another set \\
  79. \hline
  80. $\supset$ & Superset & $B \supset C$ & Set $B$ includes set $C$\\
  81. \hline
  82. $\epsilon$ & is a member of & $3 \epsilon A$ & $3$ is in the set $A$\\
  83. \hline
  84. $\not\epsilon$ & is not a member of & $4 \not\epsilon A $ & $4$ is not in the set $A $\\
  85. \hline
  86.  
  87. \end{tabular}
  88.  
  89.  
  90. %--------------------------Problem code is here------------------%
  91.  
  92. my attempt
  93. \begin{venndiagram3sets}[labelOnlyA={1},labelOnlyB= {2},labelOnlyC={}, labelOnlyAB={},labelOnlyAC={},labelOnlyBC= {9},labelABC={3}, labelNotABC={4,5,6,7,8,10}]
  94. \end{venndiagram3sets} %My Attempt
  95.  
  96. %------------------------------------%
  97.  
  98. First suggestion
  99. \begin{venndiagram3sets}[
  100. labelOnlyA={1},
  101. labelOnlyB={2},
  102. labelOnlyC={},
  103. labelOnlyAB= {},
  104. labelOnlyAC={},
  105. labelOnlyBC={9},
  106. labelABC={3},
  107. labelNotABC={4,5,6,7,8,10},
  108. showframe=false,
  109. ]
  110. \setpostvennhook{
  111. \node[below left] at (venn top right) {\(\mathcal{E}\)};
  112. \node[fit=(venn top right) (venn bottom left) (labelNotABC),draw] {};
  113. }
  114. \end{venndiagram3sets} % second attempt
  115.  
  116. %--------------------------------------------%
  117. Second suggestion
  118. \fbox{\begin{venndiagram3sets}[showframe=false,labelOnlyA= {1},labelOnlyB={2},labelOnlyC={}, labelOnlyAB= {},labelOnlyAC= {},labelOnlyBC={9},labelABC={3}, labelNotABC={$\xi$ \{4,5,6,7,8,10\}}]
  119. \end{venndiagram3sets}} %third attempt
  120.  
  121. %-----------And ends here----------------------------------%
  122.  
  123. %Diagrams
  124.  
  125. \section{diagrams}
  126.  
  127. % Definition of circles
  128.  
  129. \begin{tabular}{cc}
  130. % Set A and B
  131. \begin{tikzpicture}
  132. \begin{scope}
  133. \clip \firstcircle;
  134. \fill[filled] \secondcircle;
  135. \end{scope}
  136. \draw[outline] \firstcircle node {$A$};
  137. \draw[outline] \secondcircle node {$B$};
  138. \node[anchor=south] at (current bounding box.north) {$A \cap B$};
  139. \end{tikzpicture}
  140.  
  141. &
  142. %Set A or B but not (A and B) also known a A xor B
  143. \begin{tikzpicture}
  144. \draw[filled, even odd rule] \firstcircle node {$A$}
  145. \secondcircle node{$B$};
  146. \node[anchor=south] at (current bounding box.north) {$\overline{A \cap B}$};
  147. \end{tikzpicture}
  148.  
  149. % Set A or B
  150. \begin{tikzpicture}
  151. \draw[filled] \firstcircle node {$A$}
  152. \secondcircle node {$B$};
  153. \node[anchor=south] at (current bounding box.north) {$A \cup B$};
  154. \end{tikzpicture}\\
  155.  
  156. % Set A but not B
  157. \begin{tikzpicture}
  158. \begin{scope}
  159. \clip \firstcircle;
  160. \draw[filled, even odd rule] \firstcircle node {$A$}
  161. \secondcircle;
  162. \end{scope}
  163. \draw[outline] \firstcircle
  164. \secondcircle node {$B$};
  165. \node[anchor=south] at (current bounding box.north) {$A - B$};
  166. \end{tikzpicture}
  167.  
  168. &
  169. % Set B but not A
  170. \begin{tikzpicture}
  171. \begin{scope}
  172. \clip \secondcircle;
  173. \draw[filled, even odd rule] \firstcircle
  174. \secondcircle node {$B$};
  175. \end{scope}
  176. \draw[outline] \firstcircle node {$A$}
  177. \secondcircle;
  178. \node[anchor=south] at (current bounding box.north) {$B - A$};
  179. \end{tikzpicture}\\
  180.  
  181. \end{tabular}
  182.  
  183. \end{document}
  184.  
Advertisement
Add Comment
Please, Sign In to add comment