<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/">

<channel>
<title>Lukas's web page</title>
<description>Wanderings</description>
<link>https://lukas.ahrenberg.se</link>
<lastBuildDate> Sat, 22 Aug 2026 19:43:26 -0000 </lastBuildDate>

<item>
    <pubDate> Wed, 04 Feb 2026 21:15:00 +0000 </pubDate>
    <title> Years later, suddenly </title>
    <description> Well. Given that the last thing I wrote was something about the blogs of yore being a system of posts slowly evolving towards a set state on the theme "I'm still here" and "More stuff soon"&hellip; I assume it is just fitting that it is suddenly a bit more than three years since I wrote "more soon".  And that this post goes up long after I drafted it. </description>
    <content:encoded><![CDATA[<article id="content" class="content">
<header>
<h1 class="title">Years later, suddenly</h1>
</header><p>
Well. Given that the last thing I wrote was something about the blogs of yore being a system of posts slowly evolving towards a set state on the theme "I'm still here" and "More stuff soon"&hellip; I assume it is just fitting that it is suddenly a bit more than three years since I wrote "more soon".  And that this post goes up long after I drafted it.
</p>

<p>
Too much happening for me to start expressing what has been going on. A lot of things &ndash; some joyous, others sad.
</p>

<p>
Professional update: I joined the faculty at Aalto University a couple of years ago. Doing a lot of teaching and really liking it. Supervising and advising students. I wrote some things about that. More things that would be nice to clean up and put here.
</p>

<p>
I returned to these dusty pages because one of the fixtures in my orgmode TODO list (one that has been on my it for so many years that I now don't even notice it any more) is to upload the almost-ready-essay called Robots and Rights here. (I mentioned it in my I'm still alive post 3 years ago). I think I started that one before the pandemic, and revisiting it now I realise that, perhaps the world has passed it by. The topic was about how to think about agency and responsibility for those bots and robots that I back then assumed soon would join us online and in the physical world.
</p>

<p>
What I wrote there was that perhaps investigating how we have traditionally extended and debated agency for service animals might offer a clue. Today, when the dominant interface with these is to a high degree <i>natural language</i>, which perhaps makes us more prone to assign intentionally and reasoning, I suspect that argument will need some more work. (Although, there is still no common way to consider how AI agents are held responsible other than through humans, so perhaps something can be said about the accountability that have historically reserved for members of society.)
</p>

<p>
Anyway, thinking about that I then recalled three short story drafts I wrote back in 2010&ndash;2011. At the time, I was taking some creative writing classes and while I focused on non-fiction, I decided to try my hand at fiction too. I never finished those stories. One was about capturing a personality for a digital afterlife &hellip; but that you still had to die. Nothing noteworthy, nothing novel. (That one got worked into two other drafts if I recall: one about some personalities lacking a halting conditions and thus messing up the afterlife, and another, better, one about a kind of inverse handicap in augmented realities.) Reading Greg Egan years later, I realized how it should have been done.
</p>

<p>
However, it is the two other drafts I now wish I could locate, just because they were near future, but now already passé, I'd guess. One, I think, dealt with meme factories. Of course the idea that it would take a generation to get there&hellip; well. Never mind.
</p>

<p>
I can't recall if the other text had a title beyond "Last post" (?), It was about the last day at work for a human person hired to post on a social media network (think twitter, back in those days) in order to keep it from deteriorating. Nobody cares about having humans posting any more and gradually everyone has gotten bots to post for them, but something is missing and the system isn't stable, which is why a few have to be paid to post. To me this was how the little social media I saw felt like back then as well. The basis was that persons bring impressions from outside the system that helps to keep it 'alive'. 
</p>

<p>
Long story short, while looking for them I recalled this little corner of the internet. 
</p>

<p>
Anyway, it does feel like the best before date might have expired on those drafts. I'd still like to find the notebook however to see how much I recall and how much is after-construction. These days when people launches social media sites especially <i>for</i> bots, and the agents are something completely different from what I imagined it would be fun to find it again.
</p>

<p>
All that about things that are not done. But the site has a bit new CSS (that I apparently added at some point) and a better orgmode build system under the hood.
</p>

<p>
.L
</p>
</article>]]></content:encoded>
    <link> https://lukas.ahrenberg.se/blog/2026/years_later_suddenly.html </link>
    </item>
<item>
    <pubDate> Fri, 30 Dec 2022 20:01:00 +0000 </pubDate>
    <title> Oh, right, I have a web page! </title>
    <description> A long time ago, in the blogging ages - that would be ten or twenty years ago, I guess - posts denying one's own demise as a blogger made up something like half all new daily web pages (well, almost). You know, the posts going Hey, long time since I posted, I'm still here, more soon! </description>
    <content:encoded><![CDATA[<article id="content" class="content">
<header>
<h1 class="title">Oh, right, I have a web page!</h1>
</header><p>
A long time ago, in the blogging ages - that would be ten or twenty years ago, I guess - posts denying one's own demise as a blogger made up something like half all new daily web pages (well, almost). You know, the posts going <i>Hey, long time since I posted, I'm still here, more soon!</i>
</p>
<div class="wrap-align-right div" id="org0787301">

<figure id="orgc941d21">
<img src="Oh_right_I_have_a/moss-and-mushroom.webp" alt="Moss growing on an old stump.">

</figure>

</div>

<p>
So, well I am still around, somewhere, and to my mild surprise I have a web page. Well, I know I do; I set it up and wrote some scripts, after all, and I keep it open in a tab (so not that surprised, really). Additionally, I'm have been aware of it annually as my hosting provider ramps up the charges (going to have to make some changes there). Crucially, every time I think of something to write my thoughts go here.
</p>

<p>
Looking back at the log it reads like the pandemic killed my writing web page posts, but consulting my drafts folder, not really. I stopped finishing texts. Well, more so than usual. Looking around I can see a draft from summer 2020 about my predictions for teaching in and after the pandemic. Something about the rights of robots (well, anthromorphised or programs integrated into society, or considered 'alive' in some sense, really) and other stuff that I must have started now and then. Some meant for these pages and some just to get them out of my head (like casting a spell).
</p>


<p>
Anyway, during this autumn I began considering finishing stuff again and perhaps even uploading it here. Not sure what prompted me, boredom perhaps? Perhaps a lot of new thoughts over the last couple of years I haven't done anything else than noting down on paper. I've spent about a year and a half reading research about language models and thinking about computer education, and messing around with courses and quizzes, and recent events reminded me about some stories I tried to write a decade ago, and&hellip; and then at some point I thought <i>could I actually take some of those notes and put it somewhere</i>?
</p>

<p>
Mind you, <i>thinking</i> is not <i>doing</i>, but now over the last couple of days of 2022 that grew strong enough to revisit my web page. I guess not even <i>this</i> text won't go up until 2023, but, well, at least I got started.
</p>

<p>
I'm still around.
</p>

<p>
More soon ?
</p>
</article>]]></content:encoded>
    <link> https://lukas.ahrenberg.se/blog/2022/Oh_right_I_have_a.html </link>
    </item>
<item>
    <pubDate> Mon, 06 Apr 2020 15:00:00 +0000 </pubDate>
    <title> Braess's 'paradox' and a bit of game theory </title>
    <description> I've recently begun revisiting some old course material and putting it online. Some of it regarding basic game theory, e.g. one example on iterated removal of dominated strategies and another on mixed strategies. That made me think of a file where I've kept a few fun puzzles to use as examples. </description>
    <content:encoded><![CDATA[<article id="content" class="content">
<header>
<h1 class="title">Braess's 'paradox' and a bit of game theory</h1>
</header><p>
I've recently begun revisiting some old course material and putting it online. Some of it regarding basic game theory, e.g. one example on <a href="https://lukas.ahrenberg.se/education/Game_Theory_Examples_Iterated_Strict.html">iterated removal of dominated strategies</a> and another on <a href="https://lukas.ahrenberg.se/education/Game_Theory_Examples_Mixed_Strategies.html">mixed strategies.</a> That made me think of a file where I've kept a few fun puzzles to use as examples.
</p>

<p>
One of these is on the so called <a href="https://en.wikipedia.org/wiki/Braess%2527s_paradox">Braess's paradox</a>, which I came across a few years ago while thinking about autonomous vehicles. Indeed Braess originally formulated it while studying traffic flows, though the phenomena is more general, and pops up here and there in different kind of network models. It is worth keeping in mind, especially for AI applications. The 'paradox' can be understood in terms of game theory as well, which is why I had some puzzle notes on it.  I decided to dig up my notes and drop them in this blog post with a bit of extra text. Who knows, perhaps it will be revised further and upgraded to the tutorials section some day?
</p>
<div id="outline-container-org1a55751" class="outline-2">
<h2 id="org1a55751">Set-up</h2>
<div class="outline-text-2" id="text-org1a55751">
<p>
Imagine a large number of cars - \(N\) - going at rush-hour every day from some location \(S\) to \(G\). Assume that these are driven by the usual self-interested and perfectly rational beings of Nash-equilibrium game theory we have seen before. (Also let the cars be either full or that there is no car pooling, if you are nit-picky about details.)
</p>

<p>
So, this is an \(N\) player game. Each driver has a choice of two routes: they can either choose to take the road from \(S\) to point \(a\), and then to \(G\), or they can go from \(S\) to point \(b\) to \(G\). So, there are two strategies: \(SaG\) and \(SbG\). Moreover, for some roads there is congestion so that the cost of commuting (in for example time) is dependent on how many cars are using the road, while for others the cost is constant no matter how many cars are using that particular stretch.
</p>

<p>
Denote the costs associated with some road segment \(uv\) as \(t_{uv}\), and for the segments listed above associate the costs as in <a href="#orgb57c031">Figure 1</a> below. Namely
</p>
\begin{align*}
 &t_{Sa}(x) = \frac{x}{N}\\
 &t_{aG} = 1\\
 &t_{Sb} = 1\\
 &t_{bG}(x) = \frac{x}{N},
\end{align*}
<p>
where \(x \in [0,N]\) is the number of cars on that road.
</p>


<figure id="orgb57c031">
<img src="Braess_paradox_and_game_theory/Braess1_crop.png" alt="Braess1_crop.png">

<figcaption><span class="figure-number">Figure 1: </span>\(N\) vehicles going from \(S\) to \(G\) via either \(a\) or \(b\).</figcaption>
</figure>

<p>
In this case each driver wants to <i>minimize</i> their cost (keep this in mind, as often games are thought of as maximizing reward).
</p>

<p>
Now, the value (= total cost) for strategy \(SaG\) is \(v(SaG) = t_{Sa}(x) + t_{aG} = \frac{x}{N} + 1\), and similarly  \(v(SbG) = t_{Sb} + t_{bG}(x) = 1 + \frac{x}{N}\).
</p>
</div>
</div>
<div id="outline-container-org6f94db3" class="outline-2">
<h2 id="org6f94db3">Question: What is the cost for every player at Nash equilibrium?</h2>
<div class="outline-text-2" id="text-org6f94db3">
<p>
As you probably can guess from the symmetry of the game and the two value functions, each of the \(N\) players will minimize their cost by picking a route randomly and with equal probability. This is because when, \(x_a = \frac{N}{2}\) cars go over \(a\) and \(x_b = \frac{N}{2}\) over \(b\), then \[\left. v(SaG) \right|_{x = x_a} = \left. v(SbG) \right|_{x = x_b} = 1 + \frac{N}{2N} = 1.5.\]
</p>

<p>
If more than \(\frac{N}{2}\) cars take either \(Sa\) or \(bG\) then it is beneficial to change strategy because there will be less cost in going on the opposite. So, the best thing to do is to randomize over the two strategies.
</p>
</div>
</div>
<div id="outline-container-org444142e" class="outline-2">
<h2 id="org444142e">The twist</h2>
<div class="outline-text-2" id="text-org444142e">
<p>
All good this far. But now the traffic authority builds a new super-highway-tunnel from location \(a\) to \(b\). It is really efficient and adds no extra cost to the drivers \(t_{ab} = 0\), as in <a href="#org9c075d3">Figure 2</a>.
</p>

<p>
This means that there is a new strategy available in addition to the previous two: \(SabG\). That is, first drive from \(S\) to \(a\) then to \(b\) and from there to \(G\).
</p>


<figure id="org9c075d3">
<img src="Braess_paradox_and_game_theory/Braess2_crop.png" alt="Braess2_crop.png">

<figcaption><span class="figure-number">Figure 2: </span>A new road from \(a\) to \(b\) with cost 0 is added.</figcaption>
</figure>
</div>
</div>
<div id="outline-container-orga23af01" class="outline-2">
<h2 id="orga23af01">Question: Will this affect the Nash equilibrium? If so, what is the associated cost for each player?</h2>
<div class="outline-text-2" id="text-orga23af01">
<p>
The value function for the new strategy is quite straight forward: \(v(SabG) = \frac{x}{N} + 0 + \frac{x}{N} = \frac{2x}{N}\).
</p>

<p>
And, as you might have expected, the equilibrium shifts now that the game has changed. Assume that we start out as before with \(x_a = \frac{N}{2}\) cars driving route \(Sa\). Well, this means that the remaining \(\frac{N}{2}\) cars go \(Sb\), and thus \(x_b = \frac{N}{2}\). So, the best strategy for the cars over \(a\) is to go to \(b\), because the additional cost of this is merely \(0 + \frac{N}{2N} = \frac{1}{2}\) (and going straight \(aG\) costs 1). But now the players going \(Sb\) wants to change. Their total cost is still \(1.5\), while the other drivers get only a total of \(1\). 
</p>

<p>
So, randomly going either \(Sa\) or \(Sb\) is not a Nash equilibrium any more. More drivers will want to go to \(a\). How many?
</p>

<p>
<b><i>All of them.</i></b>
</p>

<p>
The new equilibrium is simply that every player chooses strategy \(SabG\). The associated cost then \(v(SabG) = \frac{2N}{N} = 2\). You can check this by verifying that no other route will give a lower cost for an individual driver - it will only lower cost for others. There is thus no incentive to change for a perfectly rational driver.
</p>

<p>
Note that even the individual cost in this equilibrium is more than before (2 &gt; 1.5). Still, nobody wants to change.
</p>

<p>
The above is an example of what is called <i>Braess's paradox</i> in the study of road networks and traffic flow. It might seem a bit contrived at first, but examples have been reported in traffic. For instance where <i>closing</i> roads or highway lanes might actually improve traffic flow. In general where more resources does not necessarily lead to better outcomes.
</p>

<p>
It is not quite a 'paradox'. In game theoretic terms it is an example of when the Nash equilibrium does not agree with other types of equilibria. Clearly everyone could be better off by (for example) agreeing not to use the new road, or say by allowing a central route planner to direct which road to use.
</p>
</div>
</div>
<div id="outline-container-org6900d59" class="outline-2">
<h2 id="org6900d59">Question - is there a correlated equilibrium with better outcome than the Nash equilibrium?</h2>
<div class="outline-text-2" id="text-org6900d59">
<p>
You might even ask if there is a correlated equilibrium - where each driver accepts <i>and respects</i> the outcome of some random process assigning new route, leading to an even lower cost over time.
</p>

<p>
So, let's associate \(P(SaG) = p_1, P(SbG) = p_2, P(SabG) = p_3\), and \(p_1 + p_2 + p_3 = 1\). 
Given this distribution, let \(E[X_{Sa}], E[X_{bG}]\) denote the expected number of cars between points \(Sa\), and \(bG\) respectively.
</p>

<p>
Now we can write the expected commuting cost of a player as 
\(\bar{v} = p_1 v(SaG) + p_2 v(SbG) + p_3 v(SabG) =  p_1 (\frac{E[X_{Sa}]}{N} + 1) + p_2 (1 + \frac{E[X_{bG}] + 1}{N}) + p_3 (\frac{E[X_{Sa}]}{N} + 0 + \frac{E[X_{bG}]}{N}).\)
</p>

<p>
Noting that \(\frac{E[X_{Sa}]}{N} = p_1 + p_3\), and similarly for route \(bG\), we can write the above as.
</p>

<p>
\(\bar{v} = p_1 ( p_1 + p_3 + 1) + p_2 (1 + p_2 + p3) + p_3 (p_1+p_3 + p_2+p_3) = (p_3 + p_1)^2 + (p_3 + p_2)^2 + p_1 + p_2.\)
</p>

<p>
Using, e.g. \(p_3 = 1 - p_2 - p_1\), this can be written as \(\bar{v} = 2 + p_1^2 + p_2^2 - p_1 - p_2\), which has a minimum at \(p_1 = p_2 = 0.5\). Thus, the correlated equilibrium is at \(p_1 = 0.5, p_2 = 0.5, p_3 = 0\).
</p>

<p>
That is, the best thing to do is to stop using the new road completely and allowing the traffic authority to randomly assign a route, which coincidentally happens to be exactly the same as letting every driver randomize without the \(ab\) connection.
</p>
</div>
</div>
<div id="outline-container-orgcf8c1e9" class="outline-2">
<h2 id="orgcf8c1e9">In concluding this post</h2>
<div class="outline-text-2" id="text-orgcf8c1e9">
<p>
I think Braess's paradox is a pretty neat example of how the existence of choice or resources can result in less efficiency as a whole for systems of 'rational agents'. 
</p>

<p>
It's related to more complex flow problems on graphs/networks, and to other applications than traffic.
</p>

<p>
That said, I think that this simple example might provide an intuition pump also closer to home, when discussing the future of autonomous vehicles. For it is easy to imagine that many potential instances of this paradox has been dampened by human driver 'irrationality'. Choice of route can be down to scenery, joy of driving, or simply overconfidence in knowing the 'best route', or many other things which makes perfect sense when it isn't thought too much about. But then, if everyone buys a car, wouldn't they want the 'best' car, taking the 'best route', just as all the other cars (and already seen with GPS route planners in many places).
</p>

<p>
But more on that, perhaps, some other time.
</p>
</div>
</div>
</article>]]></content:encoded>
    <link> https://lukas.ahrenberg.se/blog/2020/Braess_paradox_and_game_theory.html </link>
    </item>
<item>
    <pubDate> Thu, 02 Apr 2020 16:06:00 +0000 </pubDate>
    <title> Game Theory Examples (ii) - Mixed Strategy Equilibria </title>
    <description> Sometimes it is not possible to find a Nash equilibrium using pure strategies, e.g. using iterated removal of dominated strategies. But, in these cases there will be an equilibrium where one or more of the players is mixing their strategies (for finite games). </description>
    <content:encoded><![CDATA[<article id="content" class="content">
<header>
<h1 class="title">Game Theory Examples (ii) - Mixed Strategy Equilibria</h1>
</header><div id="outline-container-orgeda84be" class="outline-2">
<h2 id="orgeda84be">Finding a Mixed Strategy Equilibrium</h2>
<div class="outline-text-2" id="text-orgeda84be">
<p>
Sometimes it is not possible to find a Nash equilibrium using pure strategies, e.g. using iterated removal of dominated strategies. But, in these cases there will be an equilibrium where one or more of the players is mixing their strategies (for finite games).
</p>

<p>
To see what I mean, consider the following game where the row player can choose between the strategies <b>U</b> and <b>D</b>, while the column player can choose between <b>L</b> and <b>R</b>:
</p>


<figure id="org46c6e05">
<img src="Game_Theory_Examples/mixed01.png" alt="mixed01.png">

</figure>

<p>
There are no dominating strategies among U and D, neither between L and R. In fact, for any cell in the matrix there is one player who will want to move away from it. (Say the strategy combination U-R is picked first. Well, now the column player is satisfied, but the row player thinks they could do better, changing to D, but then the column player will want to change to L, so then the row player changes to U, and &hellip;)
</p>

<p>
But what if strategies could be mixed in the sense that players pick one at random according to some distribution? Then, if the same game is played over and over the players would want to do well on average, and tune the probability by which they choose between strategies accordingly. 
</p>

<p>
Could the <i>expected</i> utility be such that there's a Nash equilibrium (that is a state where none players would not want to pick another of their strategies)? 
</p>

<p>
The strategies U,D, and L,R are called <i>pure</i> strategies while a combination of them is called <i>mixed</i>. A mixed strategy is essentially a probability distribution over each player's strategies.
</p>

<p>
Let's assume that the row player chooses U with probability \(p\), then they must pick the other, D, with probability \(1-p\). 
</p>

<p>
In the same way, assume that the column player picks L with probability \(q\) and R with probability \(1-q\).
</p>

<p>
Like this:
</p>


<figure id="orgdd8342f">
<img src="Game_Theory_Examples/mixed02.png" alt="mixed02.png">

</figure>

<p>
Our task then is to set up some kind of equation system and solve for \(q\) and \(p\). 
</p>

<p>
The key observation is that <i>for a player to be indifferent to the available strategies, the expected utility those strategies must be equal</i>. Meaning that the row player should determine \(p\) such that their opponent (the column player) expects the same reward from both their available strategies (L and R). 
</p>

<p>
If this isn't the case, then there is always a 'better' choice for the opponent. So, <i>to determine the probability distribution for one player we look at which point the opposing player is indifferent</i>.
</p>

<p>
In this spirit, let's start by determining the probabilities \(q\) and \(1-q\) for the column player strategies. The above means that for the row player the following must hold \[E\left[U\right] = E\left[D\right].\]
</p>

<p>
So, what is \(E\left[U\right]\)? Well, with probability \(q\) the column player chooses L, in which case the utility for the row player will be \(2\), and with probability \(1-q\) the column player chooses R, in which case the utility for the row player will be \(1\). 
</p>

<p>
So, if a game is played over and over the row player can <i>expect</i> the following reward on average from strategy U.
</p>

<p>
\[
E\left[U\right] = 2\times q + 1\times\left(1 - q\right) = q + 1.
\]
</p>

<p>
Using the same reasoning we can see that the row player's expected utility for strategy D is:
</p>

<p>
\[
E\left[D\right] = 1\times q + 4\times\left(1 - q\right) = 4 - 3q.
\]
</p>

<p>
Now, because the row player must be indifferent we know that
\[
q + 1 = 4 - 3q,
\]
and solving it gives \(q = \frac{3}{4}\).
</p>

<p>
And here is our answer then. The probability for strategy L is \(q = \frac{3}{4}\), while the probability for strategy R is \(1-q = 1 - \frac{3}{4} = \frac{1}{4}\).
</p>


<p>
For completeness we then do the same for the row player; calculating \(p\), and \(1-p\). Now we need to see what the expected reward is for the column player.
</p>

<p>
\[
E\left[L\right] = -3\times p + 1\times\left(1 - p\right) = 1 - 4p,
\]
\[
E\left[R\right] = 2\times p + (-1)\times\left(1 - p\right) = 3p -1.
\]
</p>

<p>
Then requiring the column player to be indifferent 
\[E\left[L\right] = E\left[R\right],\]
\[1 - 4p = 3p -1,\]
from which we have \(p = \frac{2}{7}\).
</p>

<p>
So, the row player picks strategy U with probability \(p=\frac{2}{7}\), and strategy D with probability \(1-p = \frac{5}{7}\).
</p>

<p>
That's it. Again, note that the probability for a strategy is computed from the observation that the opposing player must be indifferent.
</p>
</div>
</div>
<div id="outline-container-org599c76a" class="outline-2">
<h2 id="org599c76a">Nota bene</h2>
<div class="outline-text-2" id="text-org599c76a">
<p>
The basis for this document is a game theory exercise session I taught for an AI course. The notes are quite verbose to start with, because I'm trying to explain every step extensively. Moreover some terms are not directly defined even though I try to explain things on a quite basic level. It was assumed that the students had attended an introductory lecture. So the game is on <a href="https://en.wikipedia.org/wiki/Normal-form_game">normal form</a>, 'equilibrium' means <a href="https://en.wikipedia.org/wiki/Nash_equilibrium">Nash equilibrium</a>, and so on. Also please note that in the text I use the terms reward, payoff, and utility interchangeably.
</p>

<p>
Basically, this is an in-depth example, not a formal introduction.
</p>
</div>
</div>
</article>]]></content:encoded>
    <link> https://lukas.ahrenberg.se/education/Game_Theory_Examples_Mixed_Strategies.html </link>
    </item>
<item>
    <pubDate> Mon, 30 Mar 2020 14:34:00 +0000 </pubDate>
    <title> Game Theory Examples (i) - Iterated Removal of Dominated Strategies </title>
    <description> Iterated elimination is about removing strategies which are dominated by other ones. A player's strategy is dominated if all associated utility values (rewards) are strictly less than those of some other strategy (or a mixing of other strategies, but that can be left out for now). </description>
    <content:encoded><![CDATA[<article id="content" class="content">
<header>
<h1 class="title">Game Theory Examples (i) - Iterated Removal of Dominated Strategies</h1>
</header><div id="outline-container-orgc6ac692" class="outline-2">
<h2 id="orgc6ac692">Iterated strict dominance</h2>
<div class="outline-text-2" id="text-orgc6ac692">
<p>
Iterated elimination is about removing strategies which are <b>dominated</b> by other ones. A player's strategy is dominated if all associated utility values (rewards) are <i>strictly less</i> than those of some other strategy (or a mixing of other strategies, but that can be left out for now).
</p>

<p>
Games between two players are often written in a so called game matrix. The first (row) player strategies are written as rows and the second (column) player's as columns. The utility/payoff outcome of each combination of strategies are then written in the cells of the matrix, so that the utility for the row player is the first value, and the utility for the column player is the second one.
</p>

<p>
I've marked it with colours in the example below, where the row player strategies and utilities are marked in blue, while the column player uses black.
</p>



<figure id="orgc2ee6ed">
<img src="Game_Theory_Examples/iterated01.png" alt="iterated01.png">

</figure>


<p>
Here the row player has three choices: A, B, or C, while the column player has three other: X, Y, or Z.
In (basic) game theory the players are often assumed to be perfectly rational and self-interested: they want to do as well as possible for themselves, and don't care for others. Based on that we can ask if it is possible to exclude one or more of the strategies for one or both of the players, and in process simplify the possible outcomes. When one strategy is removed further simplification may become feasible, and so the whole process can be iterated.
</p>
</div>
<div id="outline-container-org4ec6299" class="outline-3">
<h3 id="org4ec6299">Finding dominated strategies</h3>
<div class="outline-text-3" id="text-org4ec6299">
<p>
To find <i>dominated</i> strategies - those which may be removed -  we have to compare the utility values for the strategies for the respective player. Let's do that for the matrix above.
</p>

<p>
<b>The Row player</b> can choose any of the rows, and their utility is the first of each pair of values. First, compare <b>A</b> (values \(8,7,2\)) and <b>B</b> (values \(7,3,1\)): \(8 > 7\), \(7 > 3\), \(2 > 1\). Well, row B is smaller than A in every column. We say that A <i>dominates</i> B: If you think about it, this means that whatever strategy (X, Y, or Z) picked by the Column player, if the Row player has to choose between A and B - <i>it is always better to choose A</i>!
</p>

<p>
So we found one dominated strategy. Let's continue. <b>A</b> vs <b>C</b> : \(8 > 0\), \(7 >0\), \(2 <3\). So here with see that two components of A is greater than C but one is not. Therefore neither does A dominate C, nor does C dominate A.
</p>

<p>
Then <b>B</b> vs <b>C</b>: \(7 > 0, 3 >0, 1<3\) - neither of them dominates the other.
</p>

<p>
<b>The Column player</b> can choose between X,Y, Z. So, now we compare the second values against each other for every column. 
</p>

<p>
<b>X</b> vs <b>Y</b> : \(5>1, 4 > 3, 1 > 0\); so every value of X is greater than the corresponding value of Y. This means that X <i>dominates</i> Y. (Because for the column player it is always better to choose X over Y no matter what the row player does.)
</p>

<p>
<b>X</b> vs <b>Z</b> : \(5 < 7, 4 > 2, 1 < 5\) - no dominance for either strategy. 
</p>

<p>
<b>Y</b> vs <b>Z</b> : \(1 < 7, 3 >2, 0 < 5\) - again no dominance.
</p>
</div>
</div>
<div id="outline-container-orgf70d46e" class="outline-3">
<h3 id="orgf70d46e">Removal of dominated strategies</h3>
<div class="outline-text-3" id="text-orgf70d46e">
<p>
When we have found one or more dominated strategies these can be discarded from the game.
</p>

<p>
As we have found two of them in this iteration you may ask <i>'will it matter which one is removed first?'</i> 
</p>

<p>
The answer is <i>no</i>, as long as there is a <i>strict dominance</i>. That is, the utility values of a dominated strategy must always be <i>strictly less</i> than those of the dominating one. (If all values are only less or equal it is called <i>weak dominance</i> and then the order can matter [so be careful!].) Here, we are only concerned with strict dominance.
</p>

<p>
Anyway, let's just cross out the dominated strategies from the table.
</p>

<p>
First <b>Y</b>:
</p>


<figure id="org0aa6505">
<img src="Game_Theory_Examples/iterated02.png" alt="iterated02.png">

</figure>

<p>
Then <b>B</b>:
</p>



<figure id="org126261e">
<img src="Game_Theory_Examples/iterated03.png" alt="iterated03.png">

</figure>

<p>
Now we are left with a simplified matrix, and can iterate the algorithm comparing the remaining utilities in the same way. 
</p>

<p>
So compare <b>A</b> and <b>C</b> again: \(8 >0, 2 < 3\). Still no dominance here.
</p>

<p>
Then compare <b>X</b> and <b>Z</b>: \(5 < 7, 1 < 5\). Aha, so now Z <i>dominates</i> X. It didn't before, but as the row player has discarded strategy B, the need for that comparison is gone. So, column X can be removed:
</p>



<figure id="org2e5763e">
<img src="Game_Theory_Examples/iterated04.png" alt="iterated04.png">

</figure>

<p>
Next iteration - we are left with in effect a 2x1 matrix. There is no choice left for the column player - it will always be best for them to choose strategy Z, but the row player may still pick either A or C. So, let's take this for another round and compare <b>A</b> and <b>C</b>: \(2 < 3\). So, this time around C <i>dominates</i> A, meaning this too can be removed:
</p>


<figure id="org7f441ef">
<img src="Game_Theory_Examples/iterated05.png" alt="iterated05.png">

</figure>

<p>
We are now left with a single cell, and the knowledge that the optimal strategy for the Row player is <b>C</b> and the optimal strategy for the column player is <b>Z</b>. The associated utility is 3 for the Row player, and 5 for the Column player. 
</p>

<p>
If you look at that reward you can see that no player is able to do better <i>on their own</i>. That is, the Row player would not rather choose A or B (given that the column player has chosen Z) and the column player would not rather choose X or Y (given that the row player has chosen C). (Sure, there are better rewards elsewhere, but that would require both players to agree to change, and once there at least one player can get an ever better reward by choosing something else.)
</p>

<p>
This is iterative elimination which is used to simplify games. Note that this time it took us all the way to a specific combination of strategies which isn't always the case. Often you may be left with multiple strategies per player.
</p>
</div>
</div>
</div>
<div id="outline-container-orgb357010" class="outline-2">
<h2 id="orgb357010">Nota bene</h2>
<div class="outline-text-2" id="text-orgb357010">
<p>
The basis for this document is a game theory exercise session I taught for an AI course. The notes are quite verbose to start with, because I'm trying to explain every step extensively. Moreover some terms are not directly defined even though I try to explain things on a quite basic level. It was assumed that the students had attended an introductory lecture. So the game is on <a href="https://en.wikipedia.org/wiki/Normal-form_game">normal form</a>, 'equilibrium' means <a href="https://en.wikipedia.org/wiki/Nash_equilibrium">Nash equilibrium</a>, and so on. Also please note that in the text I use the terms reward, payoff, and utility interchangeably.
</p>

<p>
Basically, this is an in-depth example, not a formal introduction.
</p>
</div>
</div>
</article>]]></content:encoded>
    <link> https://lukas.ahrenberg.se/education/Game_Theory_Examples_Iterated_Strict.html </link>
    </item>
<item>
    <pubDate> Thu, 05 Dec 2019 16:48:00 +0000 </pubDate>
    <title> nbcorg - jupyter notebook to emacs orgmode exporter </title>
    <description> While updating these pages back last summer, I took a brief detour to write an exporter from jupyter notebooks to Emacs orgmode. I haven't written much about it here before, but jupyter notebook is one of my go-to tools for data analysis and prototyping. </description>
    <content:encoded><![CDATA[<article id="content" class="content">
<header>
<h1 class="title">nbcorg - jupyter notebook to emacs orgmode exporter</h1>
</header><p>
While updating these pages back last summer, I took a brief detour to write an exporter from <a href="https://jupyter.org/">jupyter</a> notebooks to Emacs <a href="https://orgmode.org/">orgmode</a>. I haven't written much about it here before, but jupyter notebook is one of my go-to tools for data analysis and prototyping.
</p>

<p>
At the same time, use orgmode for note taking, journaling, these pages, and so on. Now and then it becomes necessary to convert from jupyter to org. Jupyter notebooks can be exported to org via the fantastic <a href="https://pandoc.org/">pandoc</a> program. However, I wanted to be able to treat code blocks in jupyter as org-babel source, and also be able to choose how to import latex, markdown, and other content to the org-file. This lies outside the scope of pandoc, so I decided to write my own <a href="https://nbconvert.readthedocs.io/en/latest/">nbconvert</a> exporter plugin, called <a href="https://github.com/ahrenberg/nbcorg">nbcorg</a>.
</p>

<p>
You can install it from pypi using <code>pip install nbcorg</code>.
</p>

<p>
After installation there will be new org targets are available under the jupyter export menu option, as well in for the standard jupyter nbconvert command line program.
</p>

<p>
It's still in an early version and has been available on github and pypi since July, but I thought I'd finally mention it here as well.
</p>

<ul class="org-ul">
<li><a href="https://pypi.org/project/nbcorg/">nbcorg on pypi.org</a></li>
<li><a href="https://github.com/ahrenberg/nbcorg">nbcorg on github.com</a></li>
</ul>
</article>]]></content:encoded>
    <link> https://lukas.ahrenberg.se/blog/2019/nbcorg_-_jupyter_notebook_to.html </link>
    </item>
<item>
    <pubDate> Wed, 13 Nov 2019 00:00:00 +0000 </pubDate>
    <title> Algorithm-Human Performance Concerns - Digital Ethics Seminar 2018 Project </title>
    <description> In the darkening Finnish autumn of 2018 I decided to take part in a seminar on Digital Ethics at Aalto University. It proved to be a good decision - as you probably gather from these web pages, human relations with other computational processes is something I am always curious about - the course provided an interesting perspective based on sociology, design, law and ethics. It was also a lot of fun to engage in discussions with the other participants. </description>
    <content:encoded><![CDATA[<article id="content" class="content">
<header>
<h1 class="title">Algorithm-Human Performance Concerns - Digital Ethics Seminar 2018 Project</h1>
</header><object class="m-org-pdfobj" data="DE_Seminar_2018_Project/poster.pdf" type="application/pdf">
</object>
<div id="outline-container-orga3f1d60" class="outline-2">
<h2 id="orga3f1d60">Postscript</h2>
<div class="outline-text-2" id="text-orga3f1d60">
<p>
In the darkening Finnish autumn of 2018 I decided to take part in a seminar on Digital Ethics at Aalto University. It proved to be a good decision - as you probably gather from these web pages, human relations with other computational processes is something I am always curious about - the course provided an interesting perspective based on sociology, design, law and ethics. It was also a lot of fun to engage in discussions with the other participants.
</p>

<p>
One term which kept coming back in the articles I read for the course was "governance". Very broad, clearly, and especially popular in circles discussing super-intelligent AI, but equally applicable to the wider spectrum of digital technology discussed during the seminar. Other terms that kept returning was "accountability", "fairness", "transparency", and so on. Terms related to technology performance, but performance not of a task, but in society.
</p>

<p>
I found that quite interesting, because as a species we humans are very dependent on our tools and technology. On a large scale, governance is about trying to steer that entwined and inseparable dynamic system of matter and though. 
</p>

<p>
On the largest scale it is about playing an infinite game. 
</p>

<p>
But, on the scale of that seminar, of digital ethics, it is about those terms - how to build technology for today, and for next year, which is fair, transparent, accountable, and so on. This is equal portions business and engineering. As much judicial matters as choices of design.
</p>

<p>
So, for my course project I decided to look at governance of such technology intended to supplement or replace human functions (a traditional reason behind new technology). It resulted in a mini-review, where I tried to use proposed approaches to governance to identify concerns of performance, and finally to base a discussion of how performance along those axis may be a basis for how a technology adapts or disrupts society.
</p>

<p>
I presented the poster at the FCAI-days 2018. It has soon been a year since I presented the work which somehow reminded me to put it up here.
</p>
</div>
</div>
</article>]]></content:encoded>
    <link> https://lukas.ahrenberg.se/science/DE_Seminar_2018_Project.html </link>
    </item>
<item>
    <pubDate> Tue, 13 Aug 2019 00:00:00 +0000 </pubDate>
    <title> Web page revamp </title>
    <description> The site has revamped. Including the RSS, I hope I did not break your feeds. </description>
    <content:encoded><![CDATA[<article id="content" class="content">
<header>
<h1 class="title">Web page revamp</h1>
</header><p>
The site has revamped. Including the RSS, I hope I did not break your feeds.
</p>

<p>
I didn't post anything on these pages for a very long time. Couple of years, I think. I might write an update one of these days. 
</p>

<p>
In any case, around mid summer I found myself with an unplanned few weeks of nothing and decided to spend one of them revamping the web pages. The first results is what you see here. Most of the old stuff is till around, but I now rely on static pages (generated from org-mode sources, because that is how I have been taking notes the last few years). 
</p>

<p>
WordPress, which the site ran on previously, worked brilliantly for most things, and I am sure my own quite limited knowledge and skill (not to mention interest, sadly) in web design can never reach some of the aesthetics of the most basic plugins I could just have dropped in under WP. 
</p>

<p>
Still, I had gone around mulling a revamp for a couple of years already. First, my WP login pages got hammered, day and night, by scripts trying to break in. Of course I employed IP blocking, et c, et c, and had a strong password. Nobody ever got it, but it was annoying to see the logs over and over. Second, PHP has always turned me off as a programming language, so instead of fixing some issues I had with the previous page I just felt apathy and ran with it. (Well, not sure I will be saner with Emacs lisp, but at least I feel that I can script-process my static pages, if I really want to.) Third, given that this is just me putting out words in the void, WP was overkill.
</p>

<p>
Yeah, perhaps I'll get famous one of these days and really regret not having a comment section. Feel free to point it out when that happens.
</p>

<p>
.L
</p>
</article>]]></content:encoded>
    <link> https://lukas.ahrenberg.se/blog/2019/Web_page_revamp.html </link>
    </item>
</channel>
</rss>