Skip to content

Instantly share code, notes, and snippets.

@weidagang
Created April 2, 2013 12:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weidagang/5291910 to your computer and use it in GitHub Desktop.
Save weidagang/5291910 to your computer and use it in GitHub Desktop.
graphviz probability tree
# Generate image by: dot -Tpng -o probability_tree.png probability_tree.dot
digraph probability_tree {
s [label=""]
male [label="男"]
female [label="女"]
y1 [label="穿凉鞋"]
y2 [label="穿凉鞋"]
n1 [label="不穿凉鞋"]
n2 [label="不穿凉鞋"]
s -> male [label="2/3"];
s -> female [label="1/3"];
male -> y1 [label="1/2"];
male -> n1 [label="1/2"];
female -> y2 [label="2/3"];
female -> n2 [label="1/3"];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment