nomeata’s mind shareshttp://www.joachim-breitner.de//blog
Joachim Breitners Denkblogadehttp://joachim-breitner.de/avatars/avatar_128.pngnomeata’s mind shareshttp://www.joachim-breitner.de//blog
128128When to reroll a sixhttp://www.joachim-breitner.de/blog/700-When_to_reroll_a_six
http://www.joachim-breitner.de/blog/700-When_to_reroll_a_sixhttp://www.joachim-breitner.de/blog/700-When_to_reroll_a_six#commentsmail@joachim-breitner.de (Joachim Breitner)<p>This is a story about counter-intuitive probabilities and how a small bit of doubt turned out to be very justified.</p>
<p>It begins with the game “<a href="https://en.wikipedia.org/wiki/To_Court_the_King">To Court the King</a>” (German: „<a href="https://de.wikipedia.org/wiki/Um_Krone_und_Kragen">Um Krone und Kragen</a>“). It is a nice game with dice and cards, where you start with a few dice, and use your dice rolls to buy additional cards, which give you extra dice or special powers to modify the dice that you rolled. You can actually roll your dice many times, but every time, you have to set aside at least one die, which you can no longer change or reroll, until eventually all dice have been set aside.</p>
<p>A few years ago, I have played this game a lot, both online (on <a href="http://www.yucata.de/de/GameInfo/ToCourtTheKing">yucata.de</a>) as well as in real life. It soon became apparent that it is almost always better to go for the cards that give you an extra die, instead of those that let you modify the dice. Intuitively, this is because every additional die allows you to re-roll your dice once more.</p>
<p>I concluded that if I have a certain number of dice (say, <span class="math inline"><em>n</em></span>), and I want to have a sum as high as possible at the end, then it may make sense to reroll as many dice as possible, setting aside only those showing a 6 (because that is the best you can get) or, if there is no dice showing a 6, then a single die with the best score. Besides for small number of dice (2 or 3), where even a 4 or 5 is worth keeping, this seemed to be a simple, obvious and correct strategy to maximize the expected outcome of this simplified game.</p>
<p>It is definitely simple and obvious. But some doubt that it was correct remained. Having one more die still in the game (i.e. not set aside) definitely improves your expected score, because you can reroll the dice more often. How large is this advantage? What if it ever exceeds 6 – then it would make sense to reroll a 6. The thought was strange, but I could not dismiss it.</p>
<p>So I did what one does these days if one has a question: I <a href="http://math.stackexchange.com/q/1118263/53195">posed it on the mathematics site of StackExchange</a>. That was January 2015, and nothing happened.</p>
<p>I tried to answer it myself a month later, or at least work towards at an answer, and did that by brute force. Using a <a href="https://hackage.haskell.org/package/probability/docs/Numeric-Probability-Example-Dice.html">library for probabilistic calculations for Haskell</a> I could write <a href="http://math.stackexchange.com/a/1132424/53195">some code</a> that simply calculated the various expected values of <span class="math inline"><em>n</em></span> dice for up to <span class="math inline"><em>n</em> = 9</span> (beyond that, my unoptimized code would take too long):</p>
<pre><code>1: 3.50000 (+3.50000)
2: 8.23611 (+4.73611)
3: 13.42490 (+5.18879)
4: 18.84364 (+5.41874)
5: 24.43605 (+5.59241)
6: 30.15198 (+5.71592)
7: 35.95216 (+5.80018)
8: 41.80969 (+5.85753)
9: 47.70676 (+5.89707)</code></pre>
<p>Note that this calculation, although printed as floating point numbers, is performed using fractions of unbounded integers, so there are no rounding issues that could skew the result.</p>
<p>The result supported the hypothesis that there is no point in rolling a 6 again: The value of an additional die grows and approaches 6 from beyond, but – judging from these number – is never going to reach it.</p>
<p>Then again nothing happened. Until 14 month later, when some <a href="http://math.stackexchange.com/users/940/byron-schmuland">Byron Schmuland</a> came along, found this an interesting puzzle, and set out a 500 point bounty to whoever solved this problem. This attracted a bit attention, and a few not very successful attempts at solving this. Eventually it reached twitter, where <a href="https://twitter.com/shebang/status/730359690828369920">Roman Cheplyaka</a> linked to it.</p>
<p>Coincidally a day later some <a href="http://math.stackexchange.com/users/6622/joriki">joriki</a> came along, and he had a very good idea: Why not make our life easier and think about dice with less sides, and look at 3 instead of 6. This way, and using a more efficient implementation (but still properly using rationals), he could do a similar calculation for up to 50 dice. And it was very lucky that he went to 50, and not just 25, because up to 27, the results were very much as expected, approaching value of +3 from below. But then it surpassed +3 and became +3.000000008463403.</p>
<p>In other words: If you have roll 28 dice, and you have exactly two dice showing a 3, then it gives you better expected score if you set aside only one 3, and not both of them. The advantage is minuscule, but that does not matter – it is there.</p>
<p>From then on, the results behaved strangely. Between 28 and 34, the additional value was larger than 3. Then, from 35 on again lower than 2. It oscillated. Something similar could be observed when the game is played with coins.</p>
<p>Eventually, joriki improved his code and applied enough tricks so that he could <a href="http://math.stackexchange.com/a/1782692/53195">solve it</a> also for the 6-sided die: The difference of the expected value of 198 dice and having 199 dice is larger than 6 (by <span class="math inline">10<sup>−21</sup></span>...)!</p>
<p>The optimizations that allowed him to calculate these numbers in a reasonable amount of time unfortunately was to assume that my original hypothesis (never rerolling a 6 is optimal), which held until <span class="math inline"><em>n</em> &lt; 199</span>. But this meant that for <span class="math inline"><em>n</em> > 199</span>, the code did not yield correct results.</p>
<p>What is the rationale of the story? Don’t trust common sense when it comes to statistics; don’t judge a sequence just from a few initial numbers; if you have an interesting question, post it online and wait for 16 months.</p>Fri, 01 Jul 2016 21:47:18 +0200Incredible Proof Machine put to the testhttp://www.joachim-breitner.de/blog/683-Incredible_Proof_Machine_put_to_the_test
http://www.joachim-breitner.de/blog/683-Incredible_Proof_Machine_put_to_the_testhttp://www.joachim-breitner.de/blog/683-Incredible_Proof_Machine_put_to_the_test#commentsmail@joachim-breitner.de (Joachim Breitner)<p>I’m currently on the way home, returning from a four-day workshop for high school students; ages 13 to 20, grade 9 to 13. My goal was to teach them something about proofs and logic, in a ambitiously formal and abstract way. For this workshop, I created a computer program called “<a href="http://incredible.nomeata.de/">The Incredible Proof Machine</a>” that allows the kids to explore creating a proof, by placing blocks on a canvas and drawing connections between them (see <a href="//www.joachim-breitner.de/blog/682-incredible-proof-machine">my previous blog post</a> for an introduction).</p>
<p>Subtracting time spent on on breaks, organizational stuff, the time the student needed to prepare a final presentation, I think we were working for a total of 14 hours, during which we covered propositional logic. I generally let the students explore and try to solve the tasks of one session mostly on their own, followed by a common discussion of what they have just done, what it means why it makes sense etc. The sessions were: assumptions and conclusions in general, with conjunction; implication; disjunction; falsum and <em>tertium non datur</em>. We also briefly discussed “paper proofs” with the student: how they look, and how they relate to the Proof Machine proofs. We had some lecture notes that we handed out pice-wise after each session.</p>
<p>The sections were mildly<a href="#fn1" class="footnoteRef" id="fnref1"><sup>1</sup></a> password-protected to avoid that the quicker students would work ahead, thus keeping the group together. One or two of the 13 students were doing very well and eventually, I gave them the passwords to the predicate logic section and let them work them on them on their own. The quickest managed to solve almost all of these as well, but (as far I as I can tell) without a deeper understanding of the quantifiers, and more a mechanical intuition.</p>
<p>As expected, the students were able to solve most of the exercises, even when a proper understanding of the logical semantics was not yet fully developed. This was by design: I believe that this way it was more motivating and encouraging, as they could “make it work”, compared to a more traditional approach of first throwing a lot of theory at them and then expecting them to apply it. This was confirmed by their feedback after the workshop.</p>
<p>I was happy with my implementation. The students immediately could work with it with very few hick-ups, and only one minor bug occurred<a href="#fn2" class="footnoteRef" id="fnref2"><sup>2</sup></a>, which I could fix on the spot. Having everything run on in the browser was a big plus, given that we had no stable internet connection for everyone: Once the Incredible Proof Machine was loaded, the student could continue to work offline.</p>
<p>Personally, I find that the UI is occasionally too sluggish, especially on the weaker laptops, but it seems that the students did not seem to mind. Some students tried to connect outputs with outputs or inputs with inputs and the visualization did make it clearly visible that such a link is not actually connected to the block. The predicate logic part is a bit less convincing, with e.g. scoping of local constants not easily understood. I would say that this part would work better if some explanation is given before the students start working on the more involved rules.</p>
<p>Our room was equipped with a smartboard, and I was delighted when I found out, mostly by accident, that I could actually use my finger to drag the blocks of the proof and to draw connections. This not only gave me a “Minority Report”-like feeling, but also meant that it was much easier for the students to follow my explanations when they could just watch my hand, instead of trying to locate the mouse pointer on a regular projector. I’m generally doubtful whether such fancy technological toys are useful in the class room, but in this case at least I liked it. The ability to scribble anywhere on the screen was occasionally a plus as well.</p>
<p>All in all I believe the Proof Machine was a useful tool, and I am sure that without it, it would have been tricky to have students voluntarily spend 14 hours on such a relatively dry and abstract topic. Given the amount of work that went into the development, I hope that this will not be the last occasion where it is put to good use. So if you have to teach formal logic and natural deduction-style proofs, you are welcome to use the Incredible Proof Machine to get your students excited. It is purely static, i.e. needs no special server-side infrastructure, and you can define your own logic (i.e. proof rules), sessions and tasks.</p>
<p>Also, there are a few interesting way in which the Proof Machine could be extended. In particular, I’d like it to be able to generate a “normal”, natural-language proof from a given proof – even if it will sound a bit mechanical – and then use hover-highlight effects to relate the formulas and sentences in the text proof to the connections and blocks in the graphical proof. Contributions are welcome!</p>
<div class="footnotes">
<hr/>
<ol>
<li id="fn1"><p>JavaScript based with no crypto or even obfuscation in the code.<a href="#fnref1">↩</a></p></li>
<li id="fn2"><p>Due to differences between the task specification as given in the code, and the task specification when normalizing the syntax of the terms, the proofs that the students created were lost when they re-loaded the page.<a href="#fnref2">↩</a></p></li>
</ol>
</div>Mon, 12 Oct 2015 22:16:35 +0200The Incredible Proof Machinehttp://www.joachim-breitner.de/blog/682-The_Incredible_Proof_Machine
http://www.joachim-breitner.de/blog/682-The_Incredible_Proof_Machinehttp://www.joachim-breitner.de/blog/682-The_Incredible_Proof_Machine#commentsmail@joachim-breitner.de (Joachim Breitner)<p>In a few weeks, I will have the opportunity to offer a weekend workshop to selected and motivated high school students<a href="#fn1" class="footnoteRef" id="fnref1"><sup>1</sup></a> to a topic of my choice. My idea is to tell them something about logic, proofs, and the joy of searching and finding proofs, and the gratification of irrevocable truths.</p>
<p>While proving things on paper is already quite nice, it is much more fun to use an interactive theorem prover, such as <a href="http://isabelle.in.tum.de/">Isabelle</a>, <a href="https://coq.inria.fr/">Coq</a> or <a href="http://wiki.portal.chalmers.se/agda">Agda</a>: You get immediate feedback, you can experiment and play around if you are stuck, and you get lots of small successes. Someone<a href="#fn2" class="footnoteRef" id="fnref2"><sup>2</sup></a> once called interactive theorem proving “the worlds most geekiest videogame”.</p>
<p>Unfortunately, I don’t think one can get high school students without any prior knowledge in logic, or programming, or fancy mathematical symbols, to do something meaningful with a system like Isabelle, so I need something that is (much) easier to use. I always had this idea in the back of my head that proving is not so much about writing text (as in “normally written” proofs) or programs (as in Agda) or labeled statements (as in Hilbert-style proofs), but rather something involving facts that I have proven so far floating around freely, and way to combine these facts to new facts, without the need to name them, or put them in a particular order or sequence. In a way, I’m looking for labVIEW wrestled through the Curry-Horward-isomorphism. Something like this:</p>
<div class="figure">
<img src="//www.joachim-breitner.de/various/incredibe-proof.png" alt="A proof of implication currying"/>
<p class="caption">A proof of implication currying</p>
</div>
<p>So I set out, rounded up <a href="https://github.com/nomeata/incredible/graphs/contributors">a few contributors</a> (Thanks!), implemented this, and now I proudly present: <a href="http://incredible.nomeata.de/"><strong>The Incredible Proof Machine</strong></a><a href="#fn3" class="footnoteRef" id="fnref3"><sup>3</sup></a></p>
<p>This interactive theorem prover allows you to do perform proofs purely by dragging blocks (representing proof steps) onto the paper and connecting them properly. There is no need to learn syntax, and hence no frustration about getting that wrong. Furthermore, it comes with a number of example tasks to experiment with, so you can simply see it as a challenging computer came and work through them one by one, learning something about the logical connectives and how they work as you go.</p>
<p>For the actual workshop, my plan is to let the students <em>first</em> try to solve the tasks of one session on their own, let them draw their own conclusions and come up with an idea of what they just did, and <em>then</em> deliver an explanation of the logical meaning of what they did.</p>
<p>The implementation is heavily influenced by Isabelle: The software does not know anything about, say, conjunction (∧) and implication (→). To the core, everything is but an untyped lambda expression, and when two blocks are connected, it does unification<a href="#fn4" class="footnoteRef" id="fnref4"><sup>4</sup></a> of the proposition present on either side. This general framework is then instantiated by specifying the basic rules (or axioms) <a href="https://github.com/nomeata/incredible/blob/master/examples/logics/predicate.yaml">in a descriptive manner</a>. It is quite feasible to implement other logics or formal systems on top of this as well.</p>
<p>Another influence of Isabelle is the non-linear editing: You neither have to create the proof in a particular order nor have to manually manage a “proof focus”. Instead, you can edit any bit of the proof at any time, and the system checks all of it continuously.</p>
<p>As always, I am keen on feedback. Also, if you want to use this for your own teaching or experimenting needs, let me know. We have a <a href="https://lists.nomeata.de/mailman/listinfo/incredible">mailing list</a> for the project, the <a href="https://github.com/nomeata/incredible">code is on GitHub</a>, where you can also file <a href="https://github.com/nomeata/incredible/issues">bug reports and feature requests</a>. Contributions are welcome! All aspects of the logic are implemented in Haskell and compiled to JavaScript using <a href="https://github.com/ghcjs/ghcjs">GHCJS</a>, the UI is plain hand-written and messy JavaScript code, using <a href="http://jointjs.com/">JointJS</a> to handle the graph interaction.</p>
<p>Obviously, there is still plenty that can be done to improve the machine. In particular, the ability to create your own proof blocks, such as proof by contradiction, prove them to be valid and then use them in further proofs, is currently being worked on. And while the page will store your current progress, including all proofs you create, in your browser, it needs better ways to save, load and share tasks, blocks and proofs. Also, we’d like to add some gamification, i.e. achievements (“First proof by contradiction”, “50 theorems proven”), statistics, maybe a “share theorem on twitter” button. As the UI becomes more complicated, I’d like to investigating moving more of it into Haskell world and use Functional Reactive Programming, i.e. <a href="https://github.com/ryantrinkle/reflex">Ryan Trickle’s reflex</a>, to stay sane.</p>
<p>Customers who liked <strong>The Incredible Proof Machine</strong> might also like these artifacts, that I found while looking whether something like this exists:</p>
<ul>
<li><a href="http://easyprove.ii.uni.wroc.pl/wiki">Easyprove</a>, an interactive tool to create textual proofs by clicking on rules.</li>
<li><a href="http://www.winterdrache.de/freeware/domino/index.html">Domino On Acid</a> represents natural deduction rules in propositional logic with → and ⊥ as a game of dominoes.</li>
<li><a href="http://proofscape.org/">Proofscape</a> visualizes the dependencies between proofs as graphs, i.e. it operates on a higher level than <strong>The Incredible Proof Machine</strong>.</li>
<li><a href="http://proofscape.org/">Proofmood</a> is a nice interactive interface to conduct proofs in Fitch-style.</li>
<li><a href="http://cseweb.ucsd.edu/~lerner/proof-game/">Polymorphic Blocks</a> represents proofs trees in a sequent calculus with boxes with different shapes that have to match.</li>
<li><a href="http://japeforall.org.uk/">JAPE</a> is an editor for proofs in a number of traditional proof styles. (Thanks to Alfio Martini for the pointer.)</li>
<li><a href="http://logitext.mit.edu/main">Logitext</a>, written by Edward Z. Yang, is an online tool to create proof trees in sequent style, with a slick interface, and is even backed by Coq! (Thanks to Lev Lamberov for the pointer.)</li>
<li><a href="http://gleachkr.github.io/Carnap/">Carnap</a> is similar in implementation to <strong>The Incredible Proof Machine</strong> (logical core in Haskell, generic unification-based solver). It currently lets you edit proof trees, but there are <a href="https://github.com/gleachkr/Carnap/issues/13">plans</a> to create something more visual.</li>
<li><a href="http://selier.net/ndapp/">Clickable Proofs</a> is a (non-free) iOS app that incorporates quite a few of the ideas that are behind <strong>The Incredible Proof Machine</strong>. It came out of a Bachelor’s thesis of Tim Selier and covers propositional logic.</li>
<li><a href="http://euclidthegame.com/">Euclid the game</a> by Kasper Peulen is a nice game to play with geometric constructions.</li>
<li><a href="http://globular.science/">Globular</a>, a web-base proof assistent for “finitely-presented semistrict globular higher categories”.</li>
<li><a href="https://github.com/wandernauta/viskell">Viskell</a> is not about proofs, but rather about functional programs, but according to Horward-Curry, that’s the same thing, and their graphs look quite similar.</li>
</ul>
<div class="footnotes">
<hr/>
<ol>
<li id="fn1"><p>Students with migration background supported by the <a href="https://www.start-stiftung.de/stipendium.html">START scholarship</a><a href="#fnref1">↩</a></p></li>
<li id="fn2"><p>Does anyone know the reference?<a href="#fnref2">↩</a></p></li>
<li id="fn3"><p>We almost named it “Proofcraft”, which would be a name our current Minecraft-wild youth would appreciate, but it is alreay taken by <a href="http://proofcraft.org/">Gerwin Kleins blog</a>. Also, the irony of a theorem prover being in-credible is worth something.<a href="#fnref3">↩</a></p></li>
<li id="fn4"><p>Luckily, two decades ago, Tobias Nipkow <a href="http://www21.in.tum.de/~nipkow/pubs/lics93.html">published a nice implementation of higher order pattern unification</a> as ML code, which I transliterated to Haskell for this project.<a href="#fnref4">↩</a></p></li>
</ol>
</div>Thu, 24 Sep 2015 14:14:34 +0200Heidelberg Laureates Forum 2013http://www.joachim-breitner.de/blog/612-Heidelberg_Laureates_Forum_2013
http://www.joachim-breitner.de/blog/612-Heidelberg_Laureates_Forum_2013http://www.joachim-breitner.de/blog/612-Heidelberg_Laureates_Forum_2013#commentsmail@joachim-breitner.de (Joachim Breitner)
<p>During the last week I was attending the first <a href="http://www.heidelberg-laureate-forum.org/">Heidelberg Laureates Forum</a> as one of the lucky 200 accepted young scientists. The HFL is a (from now on hopefully yearly) event that brings together <a href="https://en.wikipedia.org/wiki/Fields_medal">Fields Medal</a>ists, <a href="https://en.wikipedia.org/wiki/Abel_prize">Abel Prize</a> laureates and <a href="https://en.wikipedia.org/wiki/Turing_Award">Turing Award</a> winners with young scientists (undergraduates, Ph.D. students and postdocs) from both fields in the city of Heidelberg. The extremely well organized week consisted of lectures from the laureates, some workshops held by postdocs, excursions and plenty of good food. <a href="http://www.heidelberg-laureate-forum.org/event_2013/">Videos of the lectures</a> are available (but don’t work on Linux, at least not for me ☹), and I have shot <a href="http://www.joachim-breitner.de/bilder/pages/201313_1.html">a few pictures </a>of the event as well. I believe that my favourite lectures where Michael Atiyah’s “Advice to a Young Mathematician”, Vladimir Voevodsky’s “Univalent Foundations of Mathematics”, William Morton Kahan’s “Desperately Needed Remedies for the Undebuggability of Large-Scale Floating-Point Computations in Science and Engineering” and Alan Kay’s “Putting Turing to Work”.</p>
<h3>Where are all the functional programmers?</h3>
<p>During that event, one gets to talk to many other math and computer scientists researchers; sometimes just “Where are you from?” and “What do you do?”, sometimes long discussions. Unfortunately, I hardly found one who is into functional programming language research – is that only because the event was parallel to <a href="http://icfpconference.org/icfp2013/index.html">ICFP</a> (which I really would have liked to attend as well), or is functional programming really just about 1% of all computer science?</p>
<h3>What is a proof?</h3>
<p>My other research interest lies in interactive theorem proving, especially using <a href="http://isabelle.in.tum.de/">Isabelle</a>. Of course that is a topic that one can discuss with almost everyone at that event, including the mathematicians. The reactions were rather mixed: On the one end of the spectrum, some mathematicians seriously doubt that they would ever trust a computer to check proofs and that it would ever be efficient enough to use. Others would not mind having “a button that tells whether their paper written in LaTeX is correct”, but were not keen to invest time or thought into making the proof readable by the computer. And then there were some (but very few!) who had not heard of theorem proving before and were very excited by the prospect of being able to obtain certainty about their proofs immediately and without having to bother other scientists with it.</p>
<p>During the mathematician’s panel discussions, where I posed the question “Do you see value in – or even a need for – machine-checked proofs in mathematics.”, Efim Zelmanov (Fields Medal 1994) said “a proof is what other mathematicians see as a proof”. I found this attitude a bit surprising – for me, a proof has always been a rigorous derivation within a formal system (say, ZFC set theory), and what we write in papers is a (less formal) description of the actual proof, whose existence we believe in. Therefore I was very happy to see Vladimir Voevodsky give a very committed talk about <a href="https://en.wikipedia.org/wiki/Homotopy_type_theory">Univalent Foundations</a> and how using that as the language for mathematics will allow more of mathematics to be cast in a formal, machine-checked form.</p>
<p>I got the chance to discuss this with him in person, as I wanted to hear his option on Isabelle, and especially on the usefulness of the style of structured proof that Isar provides, and which is closer to the style of proofs that mathematicians use in papers. He said that he enjoyed writing his proof in the style required in Type Theory and in Coq, and that maybe mathematicians should and will adjust to the language of the system, while I believe that a structured proof languages like Isar, independent of the underlying logic (HOL in this case; which is insufficient to form a base for all of abstract mathematics), is a very useful feature and that proof assistants should adjust to the mathematicians.<br/></p>
<p>We also briefly discussed the idea of mine to work with theorem provers already with motivated students in high schools, e.g. in math clubs, and found that simple proofs about arithmetic of natural numbers could be feasible here, without being too trivial.</p>
<p>All in all a very rewarding and special week, and I can only recommend to try to attend one of the next forums, if possible.<br/></p>
Sun, 29 Sep 2013 10:04:51 ZSomewhere in Israel, someone printed 50 copieshttp://www.joachim-breitner.de/blog/569-Somewhere_in_Israel%2C_someone_printed_50_copies
http://www.joachim-breitner.de/blog/569-Somewhere_in_Israel%2C_someone_printed_50_copieshttp://www.joachim-breitner.de/blog/569-Somewhere_in_Israel%2C_someone_printed_50_copies#commentsmail@joachim-breitner.de (Joachim Breitner)
<p>Today, a small
package was waiting for me at my door step, containing 52 printed and
stapled copies of <a href="http://link.springer.com/article/10.1007/s11856-011-0213-3">a paper</a> that I wrote a while ago. To be more precise, two years ago, when I submitted the main results of my <a href="http://www.joachim-breitner.de/blog/archives/376-Diploma-Thesis-Finished.html">math Diploma Thesis</a> to the <a href="http://www.ma.huji.ac.il/~ijmath/">Israel Journal of Mathematics</a>. Next year at christmas eve, <a href="http://www.joachim-breitner.de/blog/archives/542-First-academic-publication.html">it was accepted</a> and published online. And now, it seems, it finally went into print. So my paper now has page numbers and I have this pile of printouts that outnumbers the set of possibly interested readers by four dozens or more, and they would probably just download the online version instead of asking for this print out. This seems all very anachronistic to me.<br/></p>
Mon, 05 Nov 2012 18:39:52 ZFirst (academic) publicationhttp://www.joachim-breitner.de/blog/542-First_%28academic%29_publication
http://www.joachim-breitner.de/blog/542-First_%28academic%29_publicationhttp://www.joachim-breitner.de/blog/542-First_%28academic%29_publication#commentsmail@joachim-breitner.de (Joachim Breitner)
<p>Nice christmas present: I just got message that the paper “Loop subgroups of F<sub>r</sub> and the image of their stabilizer subgroups in GL<sub>r</sub>(ℤ)” that I extracted from my <a href="http://www.joachim-breitner.de/blog/archives/376-Diploma-Thesis-Finished.html">Diploma thesis</a> in Mathematics, and which I submitted to the <a href="http://www.ma.huji.ac.il/~ijmath/">Israel Journal of Mathematics</a> in November 2010 was finally published today, in “Online First“ form and under the doi <a href="http://dx.doi.org/10.1007/s11856-011-0213-3">10.1007/s11856-011-0213-3</a>.</p>
Sat, 24 Dec 2011 10:47:23 ZPoetry in the problem classhttp://www.joachim-breitner.de/blog/535-Poetry_in_the_problem_class
http://www.joachim-breitner.de/blog/535-Poetry_in_the_problem_classhttp://www.joachim-breitner.de/blog/535-Poetry_in_the_problem_class#commentsmail@joachim-breitner.de (Joachim Breitner)
<p>I’m currently running the problem class for the <a href="http://www.math.kit.edu/iag/lehre/graphtheo2011w/">graph theory course at the Karlsruhe Institute of Technology</a>, held by Prof. Maria Axenovich. On one problem sheet, I felt like setting the question in verse, and indeed, two students submitted their solution is in verse form as well. I have assembled <a href="http://www.joachim-breitner.de/various/graph_theory_poem.pdf">the problem and both solution</a> – enjoy!</p>
Thu, 01 Dec 2011 17:11:30 ZLinux-Magazin-Programmierwettbewerbhttp://www.joachim-breitner.de/blog/489-Linux-Magazin-Programmierwettbewerb
http://www.joachim-breitner.de/blog/489-Linux-Magazin-Programmierwettbewerbhttp://www.joachim-breitner.de/blog/489-Linux-Magazin-Programmierwettbewerb#commentsmail@joachim-breitner.de (Joachim Breitner)
<p>Der <a href="http://wettbewerb.linux-magazin.de/">Würfelspiel-Programmier-Wettbewerb</a> des Linux-Magazins ist schon bald ein Jahr her. Inzwischen ist <a href="http://www.joachim-breitner.de/various/wubbel-artikel.pdf">ein Artikel</a> (für hier auf A4 neu formatiert) von mir im <a href="http://www.fsmi.uni-karlsruhe.de/Angebote/Publikationen/Eulenspiegel/">Eulenspiegel</a>, dem Magazin der Mathe- und Informatikfachschaft des KIT, erschienen, in dem ich Rebeccas und meine mathematische Herangehensweise and das Problem erläutere und unsere Implementierung vorstelle. <br/></p>
<p>Unser Code ist in gewissen Sinne am stärksten, da keine Strategie gegen unsere eine Gewinnwahrscheinlichkeit >50% hat. Dass wir trotzdem nicht den Wettbewerb gewinnen war absehbar, da die Anzahl der gesamten Spiele entscheidend ist, man also um zu Gewinnen gegen die vielen nicht-optimalen Bots möglichst viele Siege herausholen muss – genaueres dazu im Text.<br/></p>
Sun, 22 May 2011 19:41:56 ZA talk on Church’s result about the Entscheidungsproblemhttp://www.joachim-breitner.de/blog/488-A_talk_on_Church%E2%80%99s_result_about_the_Entscheidungsproblem
http://www.joachim-breitner.de/blog/488-A_talk_on_Church%E2%80%99s_result_about_the_Entscheidungsproblemhttp://www.joachim-breitner.de/blog/488-A_talk_on_Church%E2%80%99s_result_about_the_Entscheidungsproblem#commentsmail@joachim-breitner.de (Joachim Breitner)
<p>A newly founded Logic Group in Mumbai, which seems to be a private thing but some professors from the IIT Bombay are taking part, has approached me and asked if I can give a talk about Church’s lambda calculus and how he used it to show that Hilbert’s <a href="http://en.wikipedia.org/wiki/Entscheidungsproblem">Entscheidungsproblem</a> is not solvable. They are starting a series of talk on logic on the occasion of Turing’s 100th birth year and because I am finally leaving the IIT campus in two days, my talk turned out to be the opening talk for the series. Roughly guessed about fifty people attended, some professors but most of them students from fields other than mathematics and computer science – I hope that they were not too confused by distinguishing truth and provability, expressability and computability, of which I did not give a proper explanation.<br/></p>
<p>I started with a historical exposition of the state of logic in the beginning 20th century, then gave an introduction to lambda calculus, encoding of natural numbers in then, Gödel encoding. Finally I sketched the proof of the unsolvability of the question whether a lambda term has a normal form and then concluded by showing how this implies that the Entscheidungsproblem is not solvable.<br/></p>
<p>I have before hand written out the talk in full, and again I ended up saying completely different things – or at least said things completely different. Nevertheless, I am sharing the (planned) <a href="http://www.joachim-breitner.de/various/ChurchTalk2011.pdf">text of my talk</a>, including the timeline that I draw on the whiteboard.<br/></p>
Thu, 21 Apr 2011 15:20:44 ZVizing’s theorem proved using Event-B and Rodinhttp://www.joachim-breitner.de/blog/486-Vizing%E2%80%99s_theorem_proved_using_Event-B_and_Rodin
http://www.joachim-breitner.de/blog/486-Vizing%E2%80%99s_theorem_proved_using_Event-B_and_Rodinhttp://www.joachim-breitner.de/blog/486-Vizing%E2%80%99s_theorem_proved_using_Event-B_and_Rodin#commentsmail@joachim-breitner.de (Joachim Breitner)
<p>As the project for the course “System specification and implementation”, which introduced the Event-B formalism to us, I modeled the algorithm given in <a href="http://www.cs.utexas.edu/users/psp/vizing.pdf">one of the constructive proofs</a> of Vizing’s theorem and showed it to be correct, using the Event-B tool <a href="http://www.event-b.org/">Rodin</a>. Vizing’s theorem states</p>
<blockquote>For a finite undirected graph without autoloops and without multiple edges, at any vertex of which no more than <em>N</em> edges meet, <em>N+1</em> colors suffice for an edge coloring such that edges incident on the same vertex are of different color.</blockquote>
<p>You can find more details about my approach and my conclusions about Event-B and Rodin in the <a href="http://www.joachim-breitner.de/publications/VizingsTheorem/VizingTheoremEventB.pdf">project report</a> and you can download my <a href="http://www.joachim-breitner.de/publications/VizingsTheorem/VizingTheorem.zip">Rodin model</a>.</p>
<p>I was asked in the comments about my conclusions, so I’ll reply here. The proof looks unweidly, but I do think that refinement based proofs, where possible, increase clarity, as more, but smaller steps have to be looked at. Also note that I had no prior exposure to Rodin, so some thing could have been done quicker and easier with more experience. But Rodin itself is not the theorem proving tool of my choice. More detail in the report, shortly put: Its math is too weak and not expressive enough, individual proofs are WORN (write-once-read-never) and can easily be lost when changing the models and there is too little emphasis on correctness, e.g. no trusted core base approach known from dedicated theorem provers. So I would use a different tool for proving mathematical statements, nevertheless the idea of refinements, and trying to find those small-steps-refinements, can also help coming up with better proofs in those tools.<br/></p>
Fri, 15 Apr 2011 06:01:26 ZThe general triangle, formallyhttp://www.joachim-breitner.de/blog/482-The_general_triangle%2C_formally
http://www.joachim-breitner.de/blog/482-The_general_triangle%2C_formallyhttp://www.joachim-breitner.de/blog/482-The_general_triangle%2C_formally#commentsmail@joachim-breitner.de (Joachim Breitner)
<p>My third submission to the <a href="http://afp.sourceforge.net/">Archive of Formal Proof</a> has been published yesterday: A proof that <a href="http://afp.sourceforge.net/entries/General-Triangle.shtml">there exists exactly one general triangle</a>. Given that yesterday was the first of April, this is obviously not meant too be taken too serious; nevertheless it is not a prank either: The math is sound and now even formally verified using <a href="http://isabelle.in.tum.de/">Isabelle</a>.<br/></p>
Sat, 02 Apr 2011 03:51:40 ZA Mistake in Church’s Paperhttp://www.joachim-breitner.de/blog/462-A_Mistake_in_Church%E2%80%99s_Paper
http://www.joachim-breitner.de/blog/462-A_Mistake_in_Church%E2%80%99s_Paperhttp://www.joachim-breitner.de/blog/462-A_Mistake_in_Church%E2%80%99s_Paper#commentsmail@joachim-breitner.de (Joachim Breitner)
<p>For a course at the IIT Bombay on functional programing, I was preparing a presentation on Alonzo Church’s theorem, based on his original 1936 paper “<a href="http://www.jstor.org/stable/2371045">An Unsolvable Problem of Elementary Number Theory</a>” where he first showed that the Entscheidungsproblem is not solvable. In that paper, he states a theorem (Theorem II) “If a formula has a normal form […] any sequence of reductions of the formula must (if continued) terminate in the normal form”. This seems to be wrong. Consider the lambda expression KIΩ, where K=(λxy.x), I=(λx.x) and Ω=(λx.xx)(λx.xx). This has a normal form I. But because Ω reduces to Ω, there is a non-terminating sequence KIΩ → KIΩ → ⋯, in contradiction to Church’s claim. The same example contradicts his Theorem III: “If a formula has a normal form, every well-formed part of it has a normal form.”, which is used in the very proof of his main result, Theorem XVIII.</p>
<p>There is no proof for Theorem II in this paper. He cites it from the then forthcoming paper “<a href="http://www.jstor.org/stable/1989762">Some properties of Conversion</a>” by him and J. B. Rosser. There, proofs are given (see Theorem 2 and its Corollary) but they are quite impenetrable to me. So I was searching for some correction paper, or any other discussion of this issue, but could not find any. Does any reader of this blog know more? What happened in that times when a paper had an error in some proof? What would happen now? Or is this not an error after all, but just a subtle difference between the definitions of λ-calculus as we know and as they introduced it?</p>
<p>Unrelated to this question: The professor asked me to write down a summary of (my interpretation of) the importance and impact of Church’s paper with regard to Gödel and Hilbert’s program, and how that relates to Böhm’s theorem. In the spirit of sharing, I have uploaded my <a href="http://joachim-breitner.de/various/ThoughtsOnChurch.pdf">thoughts on Church and Böhm</a>, comments are welcome.</p>
<p><strong>Update</strong>: Christian von Essen solved the riddle in a comment to this post: Church only considers lambda abstractions as well-formed when the bound variable actually occurs (freely) in the abstracted term. This does not allow for the K combinator and thus there is no problem.<br/></p>
Sun, 23 Jan 2011 03:44:45 ZFree Groups Formalizedhttp://www.joachim-breitner.de/blog/404-Free_Groups_Formalized
http://www.joachim-breitner.de/blog/404-Free_Groups_Formalizedhttp://www.joachim-breitner.de/blog/404-Free_Groups_Formalized#commentsmail@joachim-breitner.de (Joachim Breitner)
<p>Since a few months, I have been playing around with <a href="http://isabelle.in.tum.de/">Isabelle</a>, a theorem prover system. I find it very intriguing to have proofs of mathematical statements checked by something as pendantic and comprehensive as a machine. Mathematicians always claim that their statements are true in all eternity, but the proofs are just checked by error-prone human beings. Especially with complex, large proofs that are only read by a handful of people, I doubt that these are always fully correct. Note that this does not imply that I doubt that the results are correct. They probably are. But a bit of doubt remains. A computer-checked proof, in contrast, can not accidentially omit corner cases, leave out seemingly “trivial” assumtions of used theorems or be misled by slightly differing definition from different sources.</p>
<p>I was hoping to check at least parts of my <a href="http://www.joachim-breitner.de/blog/archives/376-Diploma-Thesis-Finished.html">diploma thesis</a> using Isabelle, but it turns out that the <a href="http://isabelle.in.tum.de/library/HOL/HOL-Algebra/index.html">standard algebra library</a> shipped with Isabelle is not complete enough. Even <a href="http://en.wikipedia.org/wiki/Free_group">free groups</a> were missing. This was motivation enough to try to formalize them and prove the universal property and some isomorphisms (The free group over the empty set is the unit group, the free group over one generator is the additive group of integers and free groups over sets of same cardinality are isomophic). I submitted the resulting theory to the <a href="http://afp.sourceforge.net/">Archive of Formal Proofs</a> and it was <a href="http://afp.sourceforge.net/entries/Free-Groups.shtml">accepted</a>. You can view the <a href="http://afp.sourceforge.net/browser_info/current/HOL/Free-Groups/document.pdf">complete document</a> or the <a href="http://afp.sourceforge.net/browser_info/current/HOL/Free-Groups/outline.pdf">document without proofs</a>.</p>
<p>I did not formalize the fact that isomorphic free groups have bases of same cardinality. As far as I know there is no simple argument that works directly with free groups. The proofs I have seen pass to the abelianization of the free group, i.e. the free module over ℤ and apply the well known proof from the analogous statement about vector spaces. But if someone knows an elementary proof of this fact, I’d like to hear about it.<br/></p>
Sat, 03 Jul 2010 10:44:22 ZA mathematician’s status symbolhttp://www.joachim-breitner.de/blog/395-A_mathematician%E2%80%99s_status_symbol
http://www.joachim-breitner.de/blog/395-A_mathematician%E2%80%99s_status_symbolhttp://www.joachim-breitner.de/blog/395-A_mathematician%E2%80%99s_status_symbol#commentsmail@joachim-breitner.de (Joachim Breitner)
<p>While writing my diploma thesis, I often wished I had a blackboard in my room: A place to quickly scribble some ideas on, somewhere where I can easily erease and replace stuff. Also, somewhere where you can literally (and not just <a href="http://xkcd.com/725/">figuratively</a>) step back from and look at from the distance.</p>
<p>For my 25<sup>th</sup> birthday, my parents organized a discharged part of a blackboard from my old scool, and yesterday, we installed it in my room in Karlsruhe:</p>
<div align="center"><img width="1000" height="750" src="http://www.joachim-breitner.de/various/blackboard.jpg" alt="A blackboard in my room"/></div>
<p>Although my <a href="http://www.joachim-breitner.de/blog/archives/376-Diploma-Thesis-Finished.html">diploma thesis is finished</a>, I’m sure it will be a nice and useful piece of furniture, and if only to draw funny things on (as my girlfriend did on this picture).</p>
Thu, 15 Apr 2010 10:16:30 ZDiploma Thesis Finishedhttp://www.joachim-breitner.de/blog/376-Diploma_Thesis_Finished
http://www.joachim-breitner.de/blog/376-Diploma_Thesis_Finishedhttp://www.joachim-breitner.de/blog/376-Diploma_Thesis_Finished#commentsmail@joachim-breitner.de (Joachim Breitner)
<p>Earlier today, I went to a local copy shop and had my diploma thesis printed. This afternoon, I will hand it in. The title is “<a href="http://www.joachim-breitner.de/various/DA/LoopSubgroupDiplomaThesis.pdf">Loop subgroups of F<sub>r</sub> and the images of their stabilizer subgroups in GL<sub>r</sub>(ℤ)</a>” and discusses a group-theoretical result. I assume that very few readers care about the content of the thesis, but maybe some are interested in a few assorted LaTeX hints. I’m also publishing the <a href="http://www.joachim-breitner.de/various/DA/LoopSubgroupDiplomaThesis.tex">full TeX source code</a>, maybe someone can make use of it.</p>
<h3>Less chatty varioref</h3>
<p>I’m using the <a href="http://tug.ctan.org/cgi-bin/ctanPackageInformation.py?id=varioref"><code>varioref</code></a> package, in conjunction with the <a href="http://tug.ctan.org/cgi-bin/ctanPackageInformation.py?id=cleveref"><code>cleveref</code></a> package. This provides a command <code>\vref{fig:S3S4l}</code> which will expand to, for example, to “Figure 1 on page 11”. But if the referenced figure is actually on the current page, the next page, the previous page or the facing page (in two-side layouts), it will say so: “Figure 1 on this page.” </p>
<p>This is very nice, but I assume that the reader of my thesis is able to find Figure 1 when it is visible, i.e. on the current or facing page. One can remove the referencing texts with the commands <code>\def\reftextfaceafter{}</code>, <code>\def\reftextfacebefore{}</code> and <code>\def\reftextcurrent{}</code>. But because <code>varioref</code> puts a space between “Figure 1” and this text, we will get a superfluous space – even before punctuation.</p>
<p>The remedy is the command <code>\unskip</code>, which removes this space again. So I use in my preamble:</p>
<pre>\def\reftextfaceafter {\unskip}%
\def\reftextfacebefore{\unskip}%
\def\reftextcurrent {\unskip}%</pre>
<h3>Palatino and extra leading</h3>
<p>I chose the Palatino font for my thesis, using the <a href="http://tug.ctan.org/cgi-bin/ctanPackageInformation.py?id=mathpazo"><code>mathpazo</code></a> package. Various sources (such as the <a href="http://tug.ctan.org/cgi-bin/ctanPackageInformation.py?id=koma-script">KOMA-Script</a> manual) suggest to use 5% extra leading:</p>
<pre>\linespread{1.05}</pre>
<h3>Counting figures independently from chapters</h3>
<p>I don’t have too many figures and tables in my thesis, and I want them to be numbered simple 1, 2, ... By default, LaTeX would say 1.1, 1.2, 2.1, ... This can be fixed using the <a href="http://tug.ctan.org/cgi-bin/ctanPackageInformation.py?id=remreset"><code>remreset</code></a> package and these commands:</p>
<pre>\makeatletter
\@removefromreset{figure}{chapter}
\renewcommand{\thefigure}{\arabic{figure}}
\@removefromreset{table}{chapter}
\renewcommand{\thetable}{\arabic{table}}
\makeatother</pre>
<h3>No widows and club lines</h3>
<p>LaTeX already avoids these, but I wanted to get rid of them completely. This can be done with:</p>
<pre>% Disable single lines at the start of a paragraph (Schusterjungen)
\clubpenalty = 10000
% Disable single lines at the end of a paragraph (Hurenkinder)
\widowpenalty = 10000 \displaywidowpenalty = 1000</pre>
<h3>Struck table lines</h3>
<p> I had to typeset tables with some lines struck, and I could not find a ready command for that. I used the following definition, based on the code for <code>\hline</code>. Note that it probably does not adjust well to other font sizes and needs to be adjusted manually:</p>
<pre>\makeatletter
\def\stline{%
\noalign{\vskip-.7em\vskip-\arrayrulewidth\hrule \@height \arrayrulewidth\vskip.7em}}
\makeatother</pre>
<h3>Title page in one-sided layout</h3>
<p>According to the KOMA manual, the title page as set by LaTeX is not meant to be the cover of a publication, and therefore has to be set with the margins of a right page – i.e. a larger right margin and a smaller left margin. But when printing cheaply, one often just put a transparent sheet on top of the print, so the title page <em>is</em> the cover. You can convince KOMA that you are right by using</p>
<pre>\KOMAoptions{twoside=false}
\begin{titlepage}
...
\end{titlepage}
\KOMAoptions{twoside=true}</pre>
<h3>Not flushing the page for chapter heads</h3>
<p>LaTeX would put the list of algorithms on a new right page. I found this a waste of paper for my few algorithms, and preferred to put the list right after the table of contents. You can override the LaTeX behavior using:</p>
<pre>\tableofcontents
{
\let\cleardoublepage\relax % book
\let\clearpage\relax % report
\let\chapter\section
\listofalgorithms
}</pre>
<p>This code also reduces the size of the heading to that of a section. The same trick also works with <code>\chapter</code>.</p>
<h3>Math in headings vs. PDF bookmarks</h3>
<p>LaTeX with the <a href="http://tug.ctan.org/cgi-bin/ctanPackageInformation.py?id=hyperref"><code>hyperref</code></a> package creates nice PDF bookmarks from your chapter and section titles. Unfortunately, PDF bookmark names can only be plain strings, while the titles in the document might contain some math symbols. You can make both happy with <code>\texorpdfstring</code>:</p>
<pre>\section{Stabilizer subgroups in \texorpdfstring{$\GL_r(\Z/2\Z)$}{GL\_r(Z/2Z)}}</pre>
<h3>Setting lines for the signature</h3>
<p>The diploma thesis contains a small note which I have to sign, saying that I created it on my own etc. Below that, I put two labeled lines for date and signature, using the tabbing environment:</p>
<pre>\begin{tabbing}
\rule{4cm}{.4pt}\hspace{1cm} \= \rule{7cm}{.4pt} \\
Ort, Datum \> Unterschrift
\end{tabbing}</pre>
Thu, 11 Feb 2010 13:11:19 Z