I am teaching Discrete Math this semester (our intro-to-proof course). One of the topics is functions. Not surprisingly my students and I have to draw “bubble diagrams” for functions between finite sets—and we have to include them in LaTeX documents. Rather than simply sketching them in Adobe Illustrator and importing them as graphics, I decided to try creating them in TikZ. After a lot of tinkering I came up with something pretty nice (see below). Moreover, I set it up so that all the complicated TikZ and LaTeX commands are in the header of the document. So my students and I can easily generate new bubble diagrams.
I’ve put a sample document on WriteLatex. If you click on this link you can get an editable copy of the document. You can edit it and it won’t change my copy—so go wild with it! (This cool feature of WriteLatex is described on their WriteLatex for Education page.)