\input{../../common}

\begin{document}
  %<*content>
	% Default drawing color
	\providecommand{\tikzcolor}{black}

	% Set the overall layout of the tree
	\tikzstyle{level 1}=[level distance=3.5cm, sibling distance=3.5cm]
	\tikzstyle{level 2}=[level distance=3.5cm, sibling distance=2cm]

	% Define styles for bags and leafs
	\tikzstyle{bag} = [text width=4em, text centered]
	\tikzstyle{end} = [circle, minimum width=3pt,fill, inner sep=0pt]

	% The sloped option gives rotated edge labels. Personally
	% I find sloped labels a bit difficult to read. Remove the sloped options
	% to get horizontal labels.
	\begin{tikzpicture}[grow=right, sloped, draw=\tikzcolor, text=\tikzcolor, fill=\tikzcolor]
		\node[bag] {$\Omega$}
		child {
			node[bag] {$\bar{A}$}
			child {
				node[end, label=right:
				{$\bar{B} \quad P(\bar{A} \cap \bar{B}) = \frac{4}{7} \times \frac{4}{9}$}] {}
				edge from parent
				node[above] {$P_{\bar{A}}(\bar{B})$}
				node[below]  {$\frac{4}{9}$}
			}
			child {
				node[end, label=right:
				{$B \quad P(\bar{A} \cap B) = \frac{4}{7} \times \frac{5}{9}$}] {}
				edge from parent
				node[above] {$P_{\bar{A}}(B)$}
				node[below]  {$\frac{5}{9}$}
			}
			edge from parent
			node[above] {$P(\bar{A})$}
			node[below]  {$\frac{4}{7}$}
		}
		child {
			node[bag] {$A$}
			child {
				node[end, label=right:
				{$\bar{B} \quad P(A \cap \bar{B}) = \frac{3}{7} \times \frac{3}{4}$}] {}
				edge from parent
				node[above] {$P_{A}(\bar{B})$}
				node[below]  {$\frac{3}{4}$}
			}
			child {
				node[end, label=right:
				{$B \quad P(A \cap B) = \frac{3}{7} \times \frac{1}{4}$}] {}
				edge from parent
				node[above] {$P_{A}(B)$}
				node[below]  {$\frac{1}{4}$}
			}
			edge from parent
			node[above] {$P(A)$}
			node[below]  {$\frac{3}{7}$}
		};
	\end{tikzpicture}
	%</content>
\end{document}
