<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Moritz Angermann on Medium]]></title>
        <description><![CDATA[Stories by Moritz Angermann on Medium]]></description>
        <link>https://medium.com/@angerman?source=rss-139a587d8383------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*k-xVYmW3FfCeL_Dsc24fuA.jpeg</url>
            <title>Stories by Moritz Angermann on Medium</title>
            <link>https://medium.com/@angerman?source=rss-139a587d8383------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 22:55:34 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@angerman/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Two things I wish Medium already had]]></title>
            <link>https://medium.com/@angerman/two-things-i-wish-medium-already-had-ac4cc5b98d4c?source=rss-139a587d8383------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac4cc5b98d4c</guid>
            <dc:creator><![CDATA[Moritz Angermann]]></dc:creator>
            <pubDate>Sat, 11 Apr 2015 12:59:26 GMT</pubDate>
            <atom:updated>2015-04-11T12:59:26.521Z</atom:updated>
            <content:encoded><![CDATA[<p>So the second post on medium will be a complaint already? Yes! In which I ask for better Mathematics and Computer Science support.</p><h4>The Good</h4><p>I think mediums simple approach to writing is an awesome way to get started writing. While I can appreciate the simplified ascii nature of editing markdown, reStructuredText and alike, Medium has build a great platform for discovery, together with a convenient what-you-see-is-what-you-get editor. This makes writing and publishing very easy. This allows us to focus on writing and editing, not fiddling with css, web rankings, buggy blogging software, server handling, etc. I love this hassle free approach. Medium is lacking two distinct features I would love to see. The Maths and Computer Science communities do have some blogging software that does support mathematical notation as well as syntax highlighted source code listings. In all fairness, Medium does support code snippet embedding through <a href="https://gist.github.com/">GitHub gists</a>.</p><h4>The Bad</h4><p>If you want to share code snippets on medium, you are left with a colorless code block,</p><pre>powerset :: [a] -&gt; [[a]]<br>powerset [] = [[]]<br>powerset [x] = [[],[x]]<br>powerset (x:xs) = map (x:) (powerset xs) ++ powerset xs</pre><p>or a gist.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ca8aa7134bba296e1917f6807d3d0f9c/href">https://medium.com/media/ca8aa7134bba296e1917f6807d3d0f9c/href</a></iframe><p>While the gist looks nice, has line numbers and highlighting, it doesn’t fit with the rest of the text. Whereas the code block does fit nicely with the rest of the text, but lacks highlighting. The gist has a lot of advantages, you can fork it, download it, etc. But it does feel alien to the rest of the text to me.</p><h4>The Ugly</h4><p>Mathematical notation is not supported at all. This makes me sad. We do have great tools for mathematical notation and it can carry a lot of information quite densely and express ideas that are just plain hard to express without the notation. Am I the only one complaining, certainly not!</p><p><a href="https://medium.com/p/a06f016eba0d">Writing on Medium and solving for x: are we there yet?</a></p><p>In the meantime we will have to wait and keep writing formulas embedded in plaintext with no formatting help. The following short story on medium would benefit a lot from math notation. Not only would the inline notation be more pretty and clear, it would also prevent the abuse of pre-formatted text blocks for maths.</p><p><a href="https://medium.com/p/1df9684db52a">Powersets in Haskell</a></p><p>These days, I think <a href="https://www.mathjax.org/">MathJax</a> is the solution that gives us mathematical notation on the web, and I would really love to see this come to Medium and in return bring in many more stories which require math notation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac4cc5b98d4c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Powersets in Haskell]]></title>
            <link>https://medium.com/@angerman/powersets-in-haskell-1df9684db52a?source=rss-139a587d8383------2</link>
            <guid isPermaLink="false">https://medium.com/p/1df9684db52a</guid>
            <category><![CDATA[haskell]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[mathematics]]></category>
            <dc:creator><![CDATA[Moritz Angermann]]></dc:creator>
            <pubDate>Sat, 11 Apr 2015 12:13:00 GMT</pubDate>
            <atom:updated>2015-04-14T07:52:24.336Z</atom:updated>
            <content:encoded><![CDATA[<p>There are always occasions that are fun when you are tasked to come up with a solution you think you should know but fail to produce. This is then about the powerset of a finite set and an algorithm to generate the superset.</p><h4>Powersets</h4><p>Mathematically speaking a finite set is a set of only a finite number of elements. A <strong>powerset</strong> is then the set of all subsets of the initial set.</p><p>Here are a few examples for set of cardinality one to three.</p><pre>{1} =&gt; {{},{1}}<br>{1,2} =&gt; {{},{1},{2},{1,2}}<br>{1,2,3} =&gt; {{}<br>           ,{1},{2},{3}<br>           ,{1,2},{1,3},{2,3}<br>           ,{1,2,3}}<br>{1,2,3,4} =&gt; {{}<br>             ,{1},{2},{3},{4}<br>             ,{1,2},{1,3},{1,4},{2,3},{2,4},{3,4}<br>             ,{1,2,3},{1,2,4},{1,3,4},{2,3,4}<br>             ,{1,2,3,4}}</pre><p>Two simple observations are: the powerset of a set of cardinality n always has the cardinality 2^n as well as the structure following pascals triangle.</p><h4>Deriving an Algorithm</h4><p>To see a little more about the underlying structure, we are taking a look at the differences. We will denote the set with cardinatliy n as S_n and assume that the elements will be the natural numbers from 1 up to n.</p><pre>S_1 \ S_0 = {{1}}<br>S_2 \ S_1 = {{2}, {1,2}}<br>S_3 \ S_2 = {{3}, {1,3}, {2,3}, {1,2,3}}</pre><p>From this we can deduct a recursion: the powerset of S_n is the powerset of S_(n-1) together element in S_(n-1) combined with {n}. The single element {n} will be produced by the empty set {} combined with {n}.</p><h4>Implementing it in Haskell</h4><p>We will model sets as lists.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ca8aa7134bba296e1917f6807d3d0f9c/href">https://medium.com/media/ca8aa7134bba296e1917f6807d3d0f9c/href</a></iframe><p>This to me shows some of the elegance and beauty of Haskell. Once you have gained the insight into the algorithm, it is often just a matter of writing it down and making sure the edge cases are cought.</p><h4>Update</h4><p>Initially the code above contained a line matching [x]. But as [x] and x:[] are identical, that line is not needed. The initial case was like the following:</p><pre>powerset [x] = [[x],[]]</pre><p>The equality proof is below:</p><pre>  powerset [x]<br>= powerset (x:[])<br>= map (x:) (powerset []) ++ powerset []<br>= map (x:) [[]] ++ [[]]<br>= [x:[]] ++ [[]]<br>= [[x]] ++ [[]]<br>= [[x],[]]</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1df9684db52a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>