Skip to content

Commit

Permalink
Jirka_RA: Solution: Exercise 0.3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
gapry committed Feb 27, 2024
1 parent d376878 commit 5007536
Show file tree
Hide file tree
Showing 2 changed files with 134 additions and 1 deletion.
132 changes: 132 additions & 0 deletions Books/Jirka_RA/Chapter00/Ex0_3/ex07.gapry.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
\subsubsection*{Exercise 0.3.7. (Gapry)}

\begin{flushleft}

\textbf{Part B} \\
\begin{tikzpicture}
\begin{scope}[shift={(-6, 0)}]
\def\firstcircle {(-0.5, -0.5) circle(1)}
\def\secondcircle {( 0.5, 0.5) circle(1)}

\draw (-2,-2) rectangle (2, 2); % Draw the universe set S
\draw \firstcircle; % Draw subset A
\draw \secondcircle; % Draw subset B

\fill[even odd rule, gray] \firstcircle \secondcircle;

\node at (-1.5, 1.5) {$S$}; % Label the universe set
\node at (-0.5, -0.5) {$A$}; % Label subset A
\node at ( 0.5, 0.5) {$B$}; % Label subset A

\node[below] at (0, -2.3) {A $\triangle$ B};
\end{scope}

\node at (-3.5,0) {$=$};

% Figure 2: Venn diagram of A \ B
\begin{scope}[shift={(-1, 0)}]
\def\firstcircle {(-0.5, -0.5) circle(1)}
\def\secondcircle {( 0.5, 0.5) circle(1)}

\draw (-2,-2) rectangle (2, 2); % Draw the universe set S
\draw \firstcircle; % Draw subset A
\draw \secondcircle; % Draw subset B

\begin{scope}
\clip \firstcircle ;
\fill[gray,even odd rule] \firstcircle \secondcircle;
\end{scope}

\node at (-1.5, 1.5) {$S$}; % Label the universe set
\node at (-0.5, -0.5) {$A$}; % Label subset A
\node at ( 0.5, 0.5) {$B$}; % Label subset A
\node[below] at (0,-2.3) {A $\setminus$ B};
\end{scope}

\node at (1.5,0) {$\cup$};

% Figure 3: Venn diagram of B \ A
\begin{scope}[shift={(4, 0)}]
\def\firstcircle {(-0.5, -0.5) circle(1)}
\def\secondcircle {( 0.5, 0.5) circle(1)}

\draw (-2,-2) rectangle (2, 2); % Draw the universe set S
\draw \firstcircle; % Draw subset A
\draw \secondcircle; % Draw subset B

\begin{scope}
\clip \secondcircle;
\fill[gray,even odd rule] \secondcircle \firstcircle;
\end{scope}

\node at (-1.5, 1.5) {$S$}; % Label the universe set
\node at (-0.5, -0.5) {$A$}; % Label subset A
\node at ( 0.5, 0.5) {$B$}; % Label subset A
\node[below] at (0, -2.3) {B $\setminus$ A};
\end{scope}
\end{tikzpicture}

\textbf{Part C} \\
\begin{tikzpicture}
\begin{scope}[shift={(-6, 0)}]
\def\firstcircle {(-0.5, -0.5) circle(1)}
\def\secondcircle {( 0.5, 0.5) circle(1)}

\draw (-2,-2) rectangle (2, 2); % Draw the universe set S
\draw \firstcircle; % Draw subset A
\draw \secondcircle; % Draw subset B

\fill[even odd rule, draw = black, fill = lightgray] \firstcircle \secondcircle;

\node at (-1.5, 1.5) {$S$}; % Label the universe set
\node at (-0.5, -0.5) {$A$}; % Label subset A
\node at ( 0.5, 0.5) {$B$}; % Label subset A

\node[below] at (0, -2.3) {A $\triangle$ B};
\end{scope}

\node at (-3.5,0) {$=$};

% Figure 2: Venn diagram of A union B
\begin{scope}[shift={(-1, 0)}]
\def\firstcircle {(-0.5, -0.5) circle(1)}
\def\secondcircle {( 0.5, 0.5) circle(1)}

\draw (-2,-2) rectangle (2, 2); % Draw the universe set S
\draw \firstcircle; % Draw subset A
\draw \secondcircle; % Draw subset B

\begin{scope}
\filldraw[draw = black, fill = lightgray] \firstcircle \secondcircle;
\end{scope}

\node at (-1.5, 1.5) {$S$}; % Label the universe set
\node at (-0.5, -0.5) {$A$}; % Label subset A
\node at ( 0.5, 0.5) {$B$}; % Label subset A
\node[below] at (0, -2.3) {A $\cup $ B};
\end{scope}

\node at (1.5,0) {$\setminus$};

% Figure 3: Venn diagram of A intersection B
\begin{scope}[shift={(4, 0)}]
\def\firstcircle {(-0.5, -0.5) circle(1)}
\def\secondcircle {( 0.5, 0.5) circle(1)}

\draw (-2,-2) rectangle (2, 2); % Draw the universe set S
\draw \firstcircle; % Draw subset A
\draw \secondcircle; % Draw subset B

\begin{scope}
\clip \firstcircle ;
\fill[draw = black, fill = lightgray] \secondcircle;
\end{scope}

\node at (-1.5, 1.5) {$S$}; % Label the universe set
\node at (-0.5, -0.5) {$A$}; % Label subset A
\node at ( 0.5, 0.5) {$B$}; % Label subset A
\node[below] at (0, -2.3) {A $\cap$ B};
\end{scope}
\end{tikzpicture}

\end{flushleft}
3 changes: 2 additions & 1 deletion Utility/base.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
\usepackage{amsfonts}
\usepackage{pgffor} % sudo apt install texlive-latex-extra
\usepackage{hyperref}
\usepackage{cancel}
\usepackage{cancel}
\usepackage{tikz}

0 comments on commit 5007536

Please sign in to comment.