.junk

Icon

Just another WordPress.com weblog

Muddy Children Puzzle graphic using tikz for LaTeX

LaTeX graphic using tikz for a public announcement logic solution to the Muddy Children Puzzle (van Ditmarsch & B. Kooi – Dynamic Epistemic Logic, Springer, 2007, page 94). Use the code below and you’ll obtain something like this:

\documentclass[11pt]{article}

\parindent=.25in

\parskip=2ex

\usepackage{amsthm}

\usepackage{amsbsy}

\usepackage{amssymb}

\usepackage{amsfonts}

\usepackage{amsmath}

\usepackage{setspace} %pt spatiere

\usepackage{graphicx}

\usepackage{pgf}

\usepackage{tikz}

\usetikzlibrary{arrows,automata,positioning}

\usetikzlibrary{matrix,arrows}

\usepackage{verbatim}

\begin{document}
%creat de Alexandru Dragomir

%\pagestyle{empty}

\pagenumbering{arabic}

\pagestyle{plain}

%\maketitle

\newpage

\begin{tikzpicture}[scale=.5, transform shape]

%\tikzstyle{every node} = [circle, fill=gray!30]

\tikzstyle{every node} = [circle, fill=white]

\node (a) at (0, 0) {000};

\node (b) at (5,0) {100};

\node (c) at (2,2) {001};

\node (d) at (7,2) {101};

\node (e) at (0,4.5) {010};

\node (f) at (5,4.5) {\underline{110}};

\node (g) at (2,6.5) {011};

\node (h) at (7,6.5) {111};

\path (a) edge node {$a$} (b);

\path (a) edge node {$b$} (e);

\path (a) edge node {$c$} (c);

\path (e) edge node {$a$} (f);

\path (e) edge node {$c$} (g);

\path (c) edge node {$b$} (g);

\path (c) edge node {$a$} (d);

\path (b) edge node {$c$} (d);

\path (g) edge node {$a$} (h);

\path (h) edge node {$b$} (d);

\path (h) edge node {$c$} (f);

\path (f) edge node {$b$} (b);

\node (p11) at (8,3){};

\node (p12) at (14,3){};

\path[dotted, ->] (p11) edge node{} (p12);

\node (b2) at (20,0) {100};

\node (c2) at (17,2) {001};

\node (d2) at (22,2) {101};

\node (e2) at (15,4.5) {010};

\node (f2) at (20,4.5) {\underline{110}};

\node (g2) at (17,6.5) {011};

\node (h2) at (22,6.5) {111};

\path (e2) edge node {$a$} (f2);

\path (e2) edge node {$c$} (g2);

\path (c2) edge node {$b$} (g2);

\path (c2) edge node {$a$} (d2);

\path (b2) edge node {$c$} (d2);

\path (g2) edge node {$a$} (h2);

\path (h2) edge node {$b$} (d2);

\path (h2) edge node {$c$} (f2);

\path (f2) edge node {$b$} (b2);

\node (p21) at (18,-1){};

\node (p22) at (18,-7){};

\path[dotted, ->](p21) edge node{} (p22);

\node (d3) at (22,-12.5) {101};

\node (f3) at (20,-10.5) {\underline{110}};

\node (g3) at (17,-8) {011};

\node (h3) at (22,-8) {111};

\path (g3) edge node {$a$} (h3);

\path (h3) edge node {$b$} (d3);

\path (h3) edge node {$c$} (f3);

\node (p31) at (8,-9){};

\node (p32) at (14,-9){};

\path[dotted, ->] (p32) edge node{} (p31);

\node (f4) at (5,-10.5) {\underline{110}};

\end{tikzpicture}

\end{document}

Filed under: Geeky Stuff, latex, , ,

One Response

  1. […] Muddy Children Puzzle graphic using tikz for LaTeX « .junkApr 21, 2011 … LaTeX graphic using tikz for a public announcement logic solution to the Muddy Children Puzzle (van Ditmarsch & B. Kooi – Dynamic Epistemic … […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: