{"id":1639,"date":"2014-05-21T23:54:17","date_gmt":"2014-05-21T22:54:17","guid":{"rendered":"http:\/\/mathscitech.org\/articles\/?p=1639"},"modified":"2019-01-02T13:49:05","modified_gmt":"2019-01-02T13:49:05","slug":"maths-of-the-duel","status":"publish","type":"post","link":"https:\/\/mathscitech.org\/articles\/maths-of-the-duel","title":{"rendered":"The Mathematics of Duelling"},"content":{"rendered":"<p><!-- Duelling with Pistols: The Mathematics of Settling Controversies by Arms.\nFirst Shooter Advantage\nPosted to G+ 19.May.2014 \nRevised, expanded, edited, improved, and posted to my blog 21.May.2014\n\n\tTo do:\n\tsyntax highlighting for code\n\tsmaller font for code\n--><\/p>\n<p>Duelling with pistols.  If you were the one issuing the challenge, your dilemma was that custom dictated that your adversary be allowed to shoot first.  Only then, if you were still able to shoot, would you be permitted to seek &#8220;satisfaction&#8221;.<\/p>\n<p>How much of an advantage does the first shooter really have?  In this article, we build a simple probability model, and implement a numerical model in a few lines of R code.<\/p>\n<div id=\"attachment_1643\" style=\"width: 133px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/mathscitech.org\/articles\/wp-content\/uploads\/2014\/05\/duel_wikipedia.png\"><img decoding=\"async\" aria-describedby=\"caption-attachment-1643\" loading=\"lazy\" class=\"size-full wp-image-1643\" alt=\"Two gentleman face off in the snow.  Convention dictates the challenged shoots first.\" src=\"https:\/\/mathscitech.org\/articles\/wp-content\/uploads\/2014\/05\/duel_wikipedia.png\" width=\"123\" height=\"93\" \/><\/a><p id=\"caption-attachment-1643\" class=\"wp-caption-text\">Two gentleman face off in the snow. Convention dictates the challenged shoots first.<\/p><\/div>\n<p><!--more--><\/p>\n<hr \/>\n<p><strong>The Mathematics of Duelling &amp; First Shooter Advantage<\/strong><\/p>\n<p>Duelling with pistols has a <a href=\"http:\/\/www.artofmanliness.com\/2010\/03\/05\/man-knowledge-an-affair-of-honor-the-duel\/\">fascinating history<\/a>.  The dilemma facing a would-be challenger was that custom dictated that his adversary be allowed to shoot first.  Once the challenged had fired his shot, then, assuming the challenger was still alive and able to shoot, he would be allowed to seek &#8220;satisfaction&#8221; by firing off a returning shot. Back and forth the volleys would go, turn by turn, though it was considered civilised to declare all satisfaction achieved and full honours restored if both parties remained unharmed after three rounds.<\/p>\n<p>The game theoretic aspects of the first-shooter convention are interesting.  For the one perceiving that a slight has been given, the convention presents an obvious deterrent.  How likely are you to be seriously wounded before you have get the chance to win back your honour?  Or in other words, how much of an advantage does the first shooter really have?  For a professional <em>agents provocateur,<\/em> <sup class='footnote'><a href='#fn-1639-1' id='fnref-1639-1' onclick='return fdfootnote_show(1639)'>1<\/a><\/sup> the opposite question was key.  How much does the skill of a marksman influence first-shooter advantage?  Indeed, how long could a marksman-provocateur expect to live in such a career?<\/p>\n<p>To model this problem, I&#8217;ll use a simple probability model to calculate the &#8220;first-shooter advantage&#8221; (FSA).  It&#8217;s also a good opportunity to illustrate how one can numerically model such problems using just a few lines of code in <a href=\"http:\/\/www.r-project.org\/\">R, an Open-Source Statistical Computing platform.<\/a>  This allows varying the assumptions very quickly and recalculating.<\/p>\n<p><strong>Assumptions<\/strong><br \/>\nTo model the problem, we&#8217;ll assume:<\/p>\n<ul>\n<li> that <a title=\"Wikipedia: Duelling Conditions\" href=\"http:\/\/bit.ly\/1lA4lS5\" target=\"_blank\">as per tradition<\/a> [3], both shooters fire alternating shots\n<li> that this continues back and forth indefinitely until &#8220;satisfaction&#8221; is obtained by one party.\n<li> for simplicity, that both are equally talented shooters, i.e. they share the same single shot probability of success.\n<li> that emotions (anger, fear, or ebulliance at having survived a round) don&#8217;t influence the single shot probabilities.\n<\/ul>\n<p><strong>What do we find?<\/strong><\/p>\n<p>It turns out that the First Shooter Advantage (FSA) is not as high as one might expect. Even if both shooters have a 7 in 10 chance of success on any given shot, victory for the first shooter is by no means assured, standing at a rather uncertain 50-50 odds.<\/p>\n<p>An interesting fact emerges. The most widely accepted duelling code, <a title=\"Code Duello -- The Duelling Code\" href=\"https:\/\/people.howstuffworks.com\/duel2.htm\" target=\"_blank\">The Code Duello <\/a> (1777, Ireland, [1]), appears to deliberately reduce overall mortality by requiring the use of &#8220;smooth-bore barrels as opposed to rifled barrels that cause the bullet to spin and give it greater accuracy and range&#8221;. <a title=\"How Duels Work\" href=\"http:\/\/bit.ly\/1qNLpaG\" target=\"_blank\">How Duels Work<\/a>, [4].<\/p>\n<p>With the marksmanship of combatants deliberately kept low, first shooter advantage also decreases. Indeed, assuming two shooters share a low 1 in 4 (25%) likelihood of a strike, the first shooter&#8217;s advantage is now less than 15%, and declines even faster as shooting accuracy falls further.<\/p>\n<p>There is a theory that the heightened conventions of politeness common in gentlemanly speech were reinforced by the dueling culture.<br \/>\n<a title=\"The Art of Manliness -- Duelling\" href=\"http:\/\/bit.ly\/1p401yg\" target=\"_blank\">The Art of Manliness &#8212; Duelling<\/a> [2].  But looking at the evidence, we can also say that the convention to decrease the accuracy of dueling weapons, by reducing first shooter advantage, kept the dueling culture viable, as there was less risk to being a challenger.<\/p>\n<p>So let&#8217;s turn now to the technical details.<\/p>\n<p><strong>The Mathematics of Duelling &#038; First Shooter Advantage<\/strong><\/p>\n<p>How might one go about calculating first shooter advantage?<\/p>\n<p><em>(Warning: Spoiler ahead.  Stop reading now if you want to work out the problem yourself first.)<\/em><\/p>\n<p><strong>Solution Outline<\/strong><\/p>\n<p>Each shooter engages in a sequence of Bernoulli trials that stops after a first success by either shooter. So for each shooter, we obtain a <a href=\"http:\/\/en.wikipedia.org\/wiki\/Geometric_distribution\">geometric distribution<\/a> which gives the probability of a fixed number of trials to first success.<\/p>\n<p>Then Shooter A wins in k shots if his first success is the kth shot and if Shooter B has missed on all k-1 previous shots.  Shooter B wins on the kth shot if B is successful on shot k and if Shooter A has missed on all k previous shots.  Notice the asymmetry here.<\/p>\n<p>Victory on the kth shot is therefore:<br \/>\n<img loading=\"lazy\" src='https:\/\/s0.wp.com\/latex.php?latex=%5Cdisplaystyle+V_A%28k%29+%3D+%281-p_A%29%5E%7Bk-1%7D%28p_A%29%281-p_B%29%5E%7Bk-1%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\\displaystyle V_A(k) = (1-p_A)^{k-1}(p_A)(1-p_B)^{k-1}' title='\\displaystyle V_A(k) = (1-p_A)^{k-1}(p_A)(1-p_B)^{k-1}' class='latex' \/><\/p>\n<p><img loading=\"lazy\" src='https:\/\/s0.wp.com\/latex.php?latex=%5Cdisplaystyle+V_B%28k%29+%3D+%281-p_B%29%5E%7Bk-1%7D%28p_B%29%281-pA%29%5E%7Bk%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\\displaystyle V_B(k) = (1-p_B)^{k-1}(p_B)(1-pA)^{k}' title='\\displaystyle V_B(k) = (1-p_B)^{k-1}(p_B)(1-pA)^{k}' class='latex' \/><\/p>\n<p>where <img loading=\"lazy\" src='https:\/\/s0.wp.com\/latex.php?latex=p_A%2C+p_B&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='p_A, p_B' title='p_A, p_B' class='latex' \/> are the individual shot sucess probabilities of Shooter A and B respectively.<\/p>\n<p>If we assume that the duel continues to the death then k is unknown and unbounded, so each shooter&#8217;s victory probability must sum over the natural numbers.  If instead, we respect the less severe maximum three rounds convention, then we can restrict the sum to the first three terms of the series.<\/p>\n<p><img loading=\"lazy\" src='https:\/\/s0.wp.com\/latex.php?latex=%5Cdisplaystyle+V_A++%3D+%5Csum_%7Bk%3D1%7D%5E%7B%5Cinfty%7D+%281-p_A%29%5E%7Bk-1%7D%28p_A%29%281-p_B%29%5E%7Bk-1%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\\displaystyle V_A  = \\sum_{k=1}^{\\infty} (1-p_A)^{k-1}(p_A)(1-p_B)^{k-1}' title='\\displaystyle V_A  = \\sum_{k=1}^{\\infty} (1-p_A)^{k-1}(p_A)(1-p_B)^{k-1}' class='latex' \/><\/p>\n<p><img loading=\"lazy\" src='https:\/\/s0.wp.com\/latex.php?latex=%5Cdisplaystyle+V_B+%3D+%5Csum_%7Bk%3D1%7D%5E%7B%5Cinfty%7D+%281-p_B%29%5E%7Bk-1%7D%28p_B%29%281-p_A%29%5E%7Bk%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\\displaystyle V_B = \\sum_{k=1}^{\\infty} (1-p_B)^{k-1}(p_B)(1-p_A)^{k}' title='\\displaystyle V_B = \\sum_{k=1}^{\\infty} (1-p_B)^{k-1}(p_B)(1-p_A)^{k}' class='latex' \/><\/p>\n<p>What is the First Shooter Advantage? It is the difference between the victory probabilities of shooters A and B, i.e. <\/p>\n<p> <img loading=\"lazy\" src='https:\/\/s0.wp.com\/latex.php?latex=%5Cdisplaystyle+FSA+%3D+V_A+-+V_B&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\\displaystyle FSA = V_A - V_B' title='\\displaystyle FSA = V_A - V_B' class='latex' \/><\/p>\n<p>The asymmetry arises from the fact that shots are alternated, starting with Shooter A, and because of the possibility of immediate death.<\/p>\n<p><strong>Numerical Model<\/strong><\/p>\n<p>A little code in R calculates the results quickly, and allows exploration of possibilities by changing the parameters of the model.<\/p>\n<p>First calculate the victory probabilities for A or B winning on shot k, given their individual shot success probabilities pA and pB respectively, as follows:<\/p>\n<pre><code>\r\n     prAfirst &lt;- function(k,pA,pB) { (1-pA)^(k-1) * (pA) * (1-pB)^(k-1) }\r\n     prBfirst &lt;- function(k,pA,pB) { (1-pB)^(k-1) * (pB) * (1-pA)^(k) }\r\n<\/code><\/pre>\n<p>Then calculate a partial sum that, in the limit as N gets arbitrarily large, converges to the First Shooter Advantage (FSA) that shooter A enjoys over shooter B even when both shooters are equally skilled with success probability p=pA=pB.<\/p>\n<pre><code>\r\n     FSA &lt;- function(p,N) {\r\n          sum(prAfirst(seq(1,N),p,p)) - sum(prBfirst(seq(1,100),p,p))\r\n     }\r\n<\/code><\/pre>\n<p>Now use <a href=\"http:\/\/stackoverflow.com\/q\/3505701\">sapply<\/a>, one of R&#8217;s powerful <a href=\"http:\/\/adv-r.had.co.nz\/Functional-programming.html\">functional programming paradigms<\/a>, to iterate FSA over each element of an array of success probabilities.  Each invocation of FSA calculates the first N=100 terms of the partial series, which is adequate in this case to reach acceptable convergence.  The results are gathered into a table fsa_tab, showing for each shot probability p, the advantage that shooter A has over shooter B.<\/p>\n<pre><code>\r\n     options(digits=3)\r\n     fsa_tab &lt;- cbind(seq(0.1,1,0.1), sapply(seq(0.1,1,0.1), FSA, 100))\r\n     colnames(fsa_tab) &lt;- c('p', 'FSA')\r\n     fsa_tab   # show table\r\n<\/code><\/pre>\n<div id=\"attachment_1675\" style=\"width: 172px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/mathscitech.org\/articles\/wp-content\/uploads\/2014\/05\/fsa_table.png\"><img decoding=\"async\" aria-describedby=\"caption-attachment-1675\" loading=\"lazy\" src=\"https:\/\/mathscitech.org\/articles\/wp-content\/uploads\/2014\/05\/fsa_table.png\" alt=\"First Shooter Advantage given both shooters have shot success probability p\" width=\"162\" height=\"197\" class=\"size-full wp-image-1675\" srcset=\"https:\/\/mathscitech.org\/articles\/wp-content\/uploads\/2014\/05\/fsa_table.png 162w, https:\/\/mathscitech.org\/articles\/wp-content\/uploads\/2014\/05\/fsa_table-123x150.png 123w\" sizes=\"auto, (max-width: 162px) 100vw, 162px\" \/><\/a><p id=\"caption-attachment-1675\" class=\"wp-caption-text\">First Shooter Advantage given both shooters have shot success probability p<\/p><\/div>\n<p>Finally, the results can be plotted.  Observe that for a crack marksman approaching 100% success probability p, survival as an <em>agents provocateur<\/em> would be more or less assured.  But given the strict convention of accuracy suppressing equipment (smooth-bore barrels instead of spiral-grooved barrels), success probabilities even for an excellent marksman are likely to have been significantly less than 100%.  In this case, the plot shows that first shooter advantage comes down geometrically (roughly quadratically) with decreasing shot-probability.<\/p>\n<pre><code>\r\n     plot( seq(0.1,1,0.1), fsa_tab, type=\"b\",\r\n          main=\"The Mathematics of Duelling\",\r\n          xlab=\"Probability p of Shot Success\",\r\n          ylab=\"First Shooter Advantage (A over B)\"\r\n     )\r\n<\/code><\/pre>\n<div id=\"attachment_1644\" style=\"width: 572px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/mathscitech.org\/articles\/wp-content\/uploads\/2014\/05\/fsa_plot.png\"><img decoding=\"async\" aria-describedby=\"caption-attachment-1644\" loading=\"lazy\" src=\"https:\/\/mathscitech.org\/articles\/wp-content\/uploads\/2014\/05\/fsa_plot.png\" alt=\"Plot showing First Shooter Advantage\" width=\"562\" height=\"368\" class=\"size-full wp-image-1644\" srcset=\"https:\/\/mathscitech.org\/articles\/wp-content\/uploads\/2014\/05\/fsa_plot.png 562w, https:\/\/mathscitech.org\/articles\/wp-content\/uploads\/2014\/05\/fsa_plot-300x196.png 300w, https:\/\/mathscitech.org\/articles\/wp-content\/uploads\/2014\/05\/fsa_plot-150x98.png 150w, https:\/\/mathscitech.org\/articles\/wp-content\/uploads\/2014\/05\/fsa_plot-400x261.png 400w\" sizes=\"auto, (max-width: 562px) 100vw, 562px\" \/><\/a><p id=\"caption-attachment-1644\" class=\"wp-caption-text\">Plot showing First Shooter Advantage<\/p><\/div>\n<p><strong>Extensions<\/strong><\/p>\n<p>Introduce into the model above the convention of maximum three rounds to a duel.  <\/p>\n<p><strong>Problem<\/strong> How likely is it that both contestants come away unharmed?<\/p>\n<p>I leave this as an exercise to the reader.  Feel free to reply in the comments.<\/p>\n<p><strong>Take-aways<\/strong><\/p>\n<p>So, does this change how we view duelling with pistols?  Or the decisions we would make were we in the last few decades of the 19th century?  <\/p>\n<p>Apart from generally avoiding conflict, you&#8217;d certainly want to hold your peace if your antagonist was a known first-class marksman.  And you&#8217;d definitely want your second to check that his weapon was of the less accurate kind specified in the Duelling Code.  <\/p>\n<p>How likely would it be that you were singled out by an <em>agent provocateur<\/em>?  Most mathematicians know the story of the brilliant young mathematician Evariste Galois who was cut down before his prime in a duel with pistols amidst some suspicious circumstances.  These accounts of Galois&#8217; death attribute the cause of the duel to <em>agent provocateurs<\/em>.  <a href=\"http:\/\/web.archive.org\/web\/20121228021317\/http:\/\/www.physics.princeton.edu:80\/~trothman\/galois.html\">More recent scholarship by Tony Rothman<\/a> has shown most convincingly that such a set-up could not have been further from the truth.<\/p>\n<p>Marksmen aside, in all other cases the first shooter advantage declines quite rapidly with decreasing accuracy. The convention of using less accurate duelling pistols meant that for your average gentleman the custom of deciding controversies by arms was as much dependent on luck as skill.<\/p>\n<p>Ah, the ways of honour!<\/p>\n<hr>\n<p><strong>Further Reading<\/strong><\/p>\n<p>[1] <a title=\"Code Duello -- The Duelling Code\" href=\"https:\/\/people.howstuffworks.com\/duel2.htm\" target=\"_blank\">The Duelling Code &#8212; Code Duello<\/a><\/p>\n<p>[2] <a title=\"The Art of Manliness -- Duelling\" href=\"http:\/\/bit.ly\/1p401yg\" target=\"_blank\">The Art of Manliness &#8212; Duelling<\/a><\/p>\n<p>[3] <a title=\"Wikipedia: Duelling Conditions\" href=\"http:\/\/bit.ly\/1lA4lS5\" target=\"_blank\">Wikipedia &#8212; Duelling Conditions<\/a><\/p>\n<p>[4] <a title=\"How Duels Work\" href=\"http:\/\/bit.ly\/1qNLpaG\" target=\"_blank\">How Stuff Works &#8212; How Duels Work<\/a><\/p>\n<p>[5] <a href=\"http:\/\/web.archive.org\/web\/20121228021317\/http:\/\/www.physics.princeton.edu:80\/~trothman\/galois.html\">Genius and Biographers: The Fictionalization of Evariste Galois<\/a>, American Mathematical Monthly, 89, 84, 1982<\/p>\n<p>[6] <a href=\"http:\/\/en.wikipedia.org\/wiki\/List_of_duels#Historical_duels\">List of Duels in History and Legend, Wikipedia<\/a><\/p>\n<p>[7] <a href=\"http:\/\/www.stat.cmu.edu\/~larry\/all-of-statistics\/\">All of Statistics<\/a>: A Concise Course in Statistical Inference, by Larry Wasserman, Springer, 2004<\/p>\n<p>[8] <a href=\"http:\/\/www.r-project.org\/\">The R Project for Statistical Computing<\/a><\/p>\n<p>There are many excellent references for using R.  I have found the following by Hadley Wickham to be one of the best in flattening out the learning curve in going from basic to advanced R programming<\/p>\n<p>[9] <a href=\"http:\/\/adv-r.had.co.nz\/\">Advanced R<\/a> by Hadley Wickham, Chapman &#038; Hall, forthcoming June 2014<\/p>\n<hr>\n<p><strong>Picture Credits<\/strong><br \/>\nThe picture of two men facing off in the snow is a <a href=\"http:\/\/en.wikipedia.org\/wiki\/File:Yevgeny_Onegin_by_Repin.jpg\">painting by Ilya Repin<\/a>, entitled <em>Eugene Onegin and Vladimir Lensky&#8217;s duel.<\/em>  Courtesy of <a href=\"http:\/\/en.wikipedia.org\/wiki\/File:Yevgeny_Onegin_by_Repin.jpg\">Wikipedia.<\/a><\/p>\n<hr>\n<p><strong>Footnotes<\/strong><\/p>\n<div class='footnotes' id='footnotes-1639'>\n<div class='footnotedivider'><\/div>\n<ol>\n<li id='fn-1639-1'> An <em>agent provocateur<\/em>, literally &#8216;inciting agent&#8217;, is one hired to give sufficient offence to provoke a challenge but without raising suspicions of a set-up. <span class='footnotereverse'><a href='#fnref-1639-1'>&#8617;<\/a><\/span><\/li>\n<\/ol>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<\/p>\n<p>Duelling with pistols. If you were the one issuing the challenge, your dilemma was that custom dictated that your adversary be allowed to shoot first. Only then, if you were still able to shoot, would you be permitted to seek &#8220;satisfaction&#8221;.<\/p>\n<p>How much of an advantage does the first shooter really have? In this [Read More&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":1643,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","footnotes":""},"categories":[3],"tags":[118,116,103,126,117,29,33],"coauthors":[112],"class_list":["post-1639","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-general","tag-applied-mathematics","tag-history","tag-mathematical-modeling","tag-mathematics","tag-probability","tag-problem-solving","tag-r","odd"],"views":9348,"_links":{"self":[{"href":"https:\/\/mathscitech.org\/articles\/wp-json\/wp\/v2\/posts\/1639","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mathscitech.org\/articles\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mathscitech.org\/articles\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mathscitech.org\/articles\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mathscitech.org\/articles\/wp-json\/wp\/v2\/comments?post=1639"}],"version-history":[{"count":62,"href":"https:\/\/mathscitech.org\/articles\/wp-json\/wp\/v2\/posts\/1639\/revisions"}],"predecessor-version":[{"id":2756,"href":"https:\/\/mathscitech.org\/articles\/wp-json\/wp\/v2\/posts\/1639\/revisions\/2756"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mathscitech.org\/articles\/wp-json\/wp\/v2\/media\/1643"}],"wp:attachment":[{"href":"https:\/\/mathscitech.org\/articles\/wp-json\/wp\/v2\/media?parent=1639"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mathscitech.org\/articles\/wp-json\/wp\/v2\/categories?post=1639"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mathscitech.org\/articles\/wp-json\/wp\/v2\/tags?post=1639"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/mathscitech.org\/articles\/wp-json\/wp\/v2\/coauthors?post=1639"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}