mscroggs.co.uk Blog & PuzzlesNew posts from mscroggs.co.uk.
http://www.mscroggs.co.uk/
MENACE in fiction<div class='paragraph'>By now, you've probably noticed that I like <a href="http://www.mscroggs.co.uk/blog/19">teaching matchboxes to play noughts and crosses</a>.
Thanks to comments on <a href="https://news.ycombinator.com/item?id=15523260" target="new">Hacker</a> <a href="https://news.ycombinator.com/item?id=15702749" target="new">News</a>, I discovered that I'm not the only one:
<a href="http://www.mscroggs.co.uk/blog/19">MENACE</a> has appeared in, or inspired, a few works of fiction.</div>
<h3>The Adolescence of P-1</h3>
<a class='zoom' href='javascript:showlimage("p1book.jpg")'><img src='http://www.mscroggs.co.uk/img/320/p1book.jpg'></a>
<div class='paragraph'><ref1> is the story of Gregory Burgess, a computer programmer who writes a computer program that becomes sentient.
P-1, the program in question, then gets a bit murdery as it tries to prevent humans from deactivating it.</div>
<div class='paragraph'>The first hint of MENACE in this book comes early on, in chapter 2, when Gregory's friend Mike says to him:</div>
<blockquote>
<div class='paragraph'>"Because I'm a veritable fount of information. From me you could learn such wonders
as the gestation period of an elephant or how to teach a matchbox to win at tic-tac-toe."</div>
<div class='attr'><ref1>, page 27</div>
</blockquote>
<div class='paragraph'>A few years later, in chapter 4, Gregory is talking to Mike again. Gregory asks:</div>
<blockquote>
<div class='paragraph'>"... How do you teach a matchbox to play tic-tac toe?"</div>
<div class='paragraph'>"What?"</div>
<div class='paragraph'>"You heard me. I remember you once said you could teach a matchbox. How?"</div>
<div class='paragraph'>"Jesus Christ! Let me think . . . Yeah . . . I remember now. That was an article in <em>Scientific American</em>
quite a few years ago. It was a couple of years old when I mentioned it to you, I think."</div>
<div class='paragraph'>"How does it work?"</div>
<div class='paragraph'>"Pretty good. Same principal of reward and punishment you use to teach a dog tricks, as I remember.
Actually, you get several matchboxes. One for each possible move you might make in a game of tic-tac-toe.
You label them appropriately, then you put an equal number of two different coloured beads in each box. The beads correspond
to each yes/no decision you can make in a game.
When a situation is reached, you grab the box for the move, shake it up, and grab a bead out of it. The bead indicates the move.
You make a record of that box and color, and then make the opposing move yourself.
You move against the boxes.
If the boxes lose the game, you subtract a bead of the color you used from each of the boxes you used. If they win, you add a bead
of the appropriate color to the boxes you used.
The boxes lose quite a few games, theoretically, and after the bad moves start getting eliminated or statistically reduced to inoperative levels,
they start to win. Then they never lose. Something like that. Check <em>Scientific American</em> about four years ago.
How is this going to help you?"</div>
<div class='attr'><ref1>, pages 41-42</div>
</blockquote>
<div class='paragraph'>The article in <em>Scientific American</em> that they're talking about is obviously <ref2>.
Mike, unfortunately, hasn't quite remembered perfectly how MENACE works: rather than having two colours in each box for yes and no, each box actually has a different colour for each possible move that could be made next.
But to be fair to Mike, he read the article around two years before this conversation so this error is forgivable.</div>
<div class='paragraph'>In any case, this error didn't hold Gregory back, as he quickly proceeded to write a program, called P-1 inspired by MENACE.
P-1 was first intended to learn to connect to other computers through their phone connections and take control of their supervisor, but then
Gregory failed to close the code and it spent a few years learning everything it could before contacting Gregory, who was obviously a little
surprised to hear from it.</div>
<div class='paragraph'>P-1 has also learnt to fear, and is scared of being deactiviated. With Gregory's help, P-1 moves much of itself to a more secure location.
Without telling Gregory, P-1 also attempts to get control of America's nuclear weapons to obtain its own nuclear deterrent, and starts
using its control over computer systems across America to kill anyone that threatens it.</div>
<div class='paragraph'>Apart from a few <a href="https://en.wikipedia.org/wiki/Literary_Review" target="new">Literary Review Bad Sex in Fiction Award</a> worthy segments,
<ref1> is an enjoyable read.</div>
<h3>Hide and Seek (1984)</h3>
<div class='paragraph'>In 1984, <ref1> was made into a Canadian TV film called <ref3>.
It doesn't seem to have made it to DVD, but luckily the whole film is on
<a href="https://www.youtube.com/watch?v=EjByXo8JVc0" target="new">YouTube</a>.
About <a href="https://youtu.be/EjByXo8JVc0?t=1418" target="new">24 minutes into the film</a>, Gregory explains to Jessica how he made P-1:</div>
<blockquote>
<div class='paragraph script'>Gregory: First you end up with random patterns like this. Now there are certain rules: if a cell has one or two neighbours, it reproduces into the
next generation. If it has no neighbours, it dies of loneliness. More than two it dies of overcrowding. Press the return key.</div>
<div class='paragraph script'>Jessica: Okay. [<em>pause</em>] And this is how you created P-1?</div>
<div class='paragraph script'>Gregory: Well, basically. I started to change the rules and then I noticed that the patterns looked like computer instructions. So I entered
them as a program and it worked.</div>
<div class='attr'><ref3> (1984)</div>
</blockquote>
<div class='paragraph'>This is a description of a cellular automaton similar to <a href="http://www.mscroggs.co.uk/blog/29">Game of Life</a>, and not a great way to make a machine that learns.
I guess the film's writers have worse memories than Gregory's friend Mike.</div>
<div class='paragraph'>In fact, apart from the character names and the murderous machine, the plots of <ref1> and <ref3> don't have much in common.
<ref3> does, however, have a lot of plot elements in common with <ref4>.</div>
<h3>WarGames (1983)</h3>
<div class='paragraph'>In 1983, the film <ref4> was released. It is the story of David, a hacker that tries to hack into a video game company's computer, but accidentally
hacks into the US governments computer and starts a game of <em>Global thermonuclear war</em>. At least David thinks it's a game, but actually
the computer has other ideas, and does everything in its power to actually start a nuclear war.</div>
<div class='paragraph'>During David's quests to find out more about the computer and prevent nuclear war, he learns about its creator, Stephen Falken.
He describes him to his girlfriend, Jennifer:</div>
<blockquote>
<div class='paragraph script'>David: He was into games as well as computers. He designed them so that they could play checkers or poker. Chess.</div>
<div class='paragraph script'>Jennifer: What's so great about that? Everybody's doing that now.</div>
<div class='paragraph script'>David: Oh, no, no. What he did was great! He designed his computer so it could learn from its own mistakes. So they'd be better they next time they played.
The system actually learned how to learn. It could teach itself.</div>
<div class='attr'><ref4> (1983)</div>
</blockquote>
<div class='paragraph'>Although David doesn't explain how the computer learns, he at least states that it does learn, which is more than Gregory managed in <ref3>.</div>
<a class='zoom' href='javascript:showlimage("falkensmaze.png")'><img src='http://www.mscroggs.co.uk/img/320/falkensmaze.jpg'></a>
<div class='caption'>David finding <i>Falken's maze: Teaching a machine to<br />learn</i> by Stephen Falken</div>
<div class='paragraph'>David's research into Stephen Falken included finding an article called <i>Falken's maze: Teaching a machine to learn</i> in
June 1963's issue of Scientific American. This article and Stephen Falken are fictional, but perhaps its appearance in Scientific American
is a subtle nod to Martin Gardner and <ref2>.</div>
<div class='paragraph'><ref4> was a successful film: it was generally liked by viewers and nominated for three Academy Awards. It seems likely that the creators of
<ref3> were really trying to make their own version of <ref4>, rather than an accurate apatation of <ref1>. This perhaps explains the similarities
between the plots of the two films.</div>
<h3>Without a Thought</h3>
<a class='zoom' href='javascript:showlimage("bezbook.jpg")'><img src='http://www.mscroggs.co.uk/img/320/bezbook.jpg'></a>
<div class='paragraph'><ref5> is a short story published in 1963. It appears in a collection of related short stories by Frank Saberhagen called <em>Bezerker</em>.</div>
<div class='paragraph'>In the story, Del and his aiyan (a pet a bit like a more intelligent dog; imagine a cross between R2-D2 and <a href="http://www.mscroggs.co.uk/blog/56">Timber</a>) called Newton are in a spaceship fighting against a bezerker. The bezerker has
a mind weapon that pauses all intelligent thought, both human and machine. The weapon has no effect
on Newton as Newton's thought is non-intelligent.</div>
<div class='paragraph'>The bezerker challenges Del to a simplified checker game, and says that if Del can play the game while the mind weapon is active, then he
will stop fighting.</div>
<div class='paragraph'>After winning the battle, Del explains to his commander how he did it:</div>
<blockquote>
<div class='paragraph'>But the Commander was watching Del: "You got Newt to play by the following diagrams, I see that. But how could he <em>learn</em> the game?"</div>
<div class='paragraph'>Del grinned. "He couldn't, but his toys could. Now wait before you slug me"
He called the <em>aiyan</em> to him and took a small box from the animal's hand. The box rattled faintly as he held it up.
On the cover was pasted a diagram of on possible position in the simplified checker game, with a different-coloured arrow indicating each possible
move of Del's pieces.</div>
<div class='paragraph'>It took a couple of hundred of these boxes," said Del. "This one was in the group that Newt examined for the fourth move.
When he found a box with a diagram matching the position on the board, he picked the box up, pulled out one of these beads from inside, without
looking – that was the hardest part to teach him in a hurry, by the way," said Del, demonstrating. "Ah, this one's blue. That means,
make the move indicated on the cover by the blue arrow. Now the orange arrow leads to a poor position, see?" Del shook all the beads out of
the box into his hand. "No orange beads left; there were six of each colour when we started. But every time Newton drew a bead, he had orders
to leave it out of the box until the game was over. Then, if the scoreboard indicated a loss for our side, he went back and threw away all
the beads he had used. All the bad moves were gradually eliminated. In a few hours, Newt and his boxes learned to play the game perfectly."</div>
<div class='attr'><ref5></div>
</blockquote>
<div class='paragraph'>It's a good thing the checkers game was simplified, as otherwise <a href="http://www.mscroggs.co.uk/blog/52">the number of boxes needed to play would be
way too big</a>.</div>
<div class='paragraph'>Overall, <ref5> is a good short story containing an actually correctly explained machine learning algorithm. Good job Fred Saberhagen!</div>
http://www.mscroggs.co.uk/blog/60
http://www.mscroggs.co.uk/blog/6016 Dec 2018 12:00:00 GMTChristmas card 2018<div class='paragraph'>Just like <a href="http://www.mscroggs.co.uk/blog/47">last year</a> and <a href="http://www.mscroggs.co.uk/blog/37">the year before</a>, <a href="https://twitter.com/televisionduck" target="new">TD</a> and I spent some time in November this year designing a <a href="http://www.chalkdustmagazine.com" target="new">Chalkdust</a> puzzle Christmas card.</div><a class='zoom' href='javascript:showlimage("card2018.jpg")'><img src='http://www.mscroggs.co.uk/img/320/card2018.jpg'></a><div class='paragraph'>The card looks boring at first glance, but contains 10 puzzles. By splitting the answers into pairs of digits, then drawing lines between the dots on the cover for each pair of digits (eg if an answer is 201304, draw a line from dot 20 to dot 13 and another line from dot 13 to dot 4), you will reveal a Christmas themed picture. Colouring the region of the card labelled R red or orange will make this picture even nicer.</div><div class='paragraph'>If you want to try the card yourself, you can download <a href="https://drive.google.com/file/d/1VpLxUJfSK0sTymCgfURCvIhUN_eNKnHx" target="new">this pdf</a>. Alternatively, you can find the puzzles below and type the answers in the boxes. The answers will be automatically be split into pairs of digits, lines will be drawn between the pairs, and the red region will be coloured...</div><div class='paragraph'>If you enjoy these puzzles, then you'll almost certainly enjoy this year's <a href="http://www.mscroggs.co.uk/">puzzle Advent calendar</a>.</div><style type='text/css'>table.puzzle tr {border-bottom:2px dotted green}table.puzzle tr {border-top:2px dotted green}table.puzzle td {vertical-align:top;padding-bottom:5px;padding-top:5px;padding-left:5px}table.puzzle td.n {text-align:right}table.puzzle td.q {text-align:left}table.puzzle td.a {text-align:center;font-size:8pt;font-weight:bold}table.puzzle td.a input {background:white}</style><canvas id='cardvas' width=400 height=400></canvas><table class='puzzle invisible'><tr><td class='n'>1.</td><td class='q'>What is the smallest four digit number whose digits add up to 6?</td><td class='a'>Answer<br /><input size=5 onchange='update_lines()' id='puzza1'></td></tr><tr><td class='n'>2.</td><td class='q'>What is the length of the hypotenuse of a right angled triangle whose two shorter sides have lengths 152,560 and 114,420?</td><td class='a'>Answer<br /><input size=5 onchange='update_lines()' id='puzza2'></td></tr><tr><td class='n'>3.</td><td class='q'>What is the lowest common multiple of 1346 and 196?</td><td class='a'>Answer<br /><input size=5 onchange='update_lines()' id='puzza3'></td></tr><tr><td class='n'>4.</td><td class='q'>What is the sum of all the odd numbers between 0 and 698?</td><td class='a'>Answer<br /><input size=5 onchange='update_lines()' id='puzza4'></td></tr><tr><td class='n'>5.</td><td class='q'>How many numbers are there between 100 and 10,000 that contain no 0, 1, 2, or 3?</td><td class='a'>Answer<br /><input size=5 onchange='update_lines()' id='puzza5'></td></tr><tr><td class='n'>6.</td><td class='q'>How many factors (<small>including 1 and the number itself</small>) does the number \(2^{13}\times3^{19}\times5^9\times7^{39}\) have?</td><td class='a'>Answer<br /><input size=5 onchange='update_lines()' id='puzza6'></td></tr><tr><td class='n'>7.</td><td class='q'>In a book with pages numbered from 1 to 16,020,308, what do the two page numbers on the centre spread add up to?</td><td class='a'>Answer<br /><input size=5 onchange='update_lines()' id='puzza7'></td></tr><tr><td class='n'>8.</td><td class='q'>You think of a number, then make a second number by removing one of its digits. The sum of these two numbers is 18,745,225. What was your first number?</td><td class='a'>Answer<br /><input size=5 onchange='update_lines()' id='puzza8'></td></tr><tr><td class='n'>9.</td><td class='q'>What is the largest number that cannot be written as \(13a+119b\), where \(a\) and \(b\) are positive integers or 0?</td><td class='a'>Answer<br /><input size=5 onchange='update_lines()' id='puzza9'></td></tr><tr><td class='n'>10.</td><td class='q'>You start at the point (0,0) and are allowed to move one unit up or one unit right. How many different paths can you take to get to the point (7,6)?</td><td class='a'>Answer<br /><input size=5 onchange='update_lines()' id='puzza10'></td></tr></table><script type='text/javascript'>var dots = [[188.57142857143,237.95918367347],[234.28571428571,212.24489795918],[202.44897959184,216.32653061224],[238.77551020408,227.75510204082],[12.244897959184,88.163265306122],[309.79591836735,235.10204081633],[88.979591836735,65.30612244898],[194.28571428571,297.55102040816],[164.08163265306,359.18367346939],[225.30612244898,186.12244897959],[204.48979591837,242.44897959184],[47.34693877551,71.836734693878],[262.04081632653,175.91836734694],[146.12244897959,342.85714285714],[87.755102040816,37.959183673469],[156.73469387755,70.612244897959],[208.16326530612,273.87755102041],[120.81632653061,106.5306122449],[385.30612244898,257.14285714286],[177.14285714286,332.24489795918],[97.142857142857,228.97959183673]]dots['x'] = [54.8,95.363265306122]var R = [114.28571428571,186.9387755102]function update_lines(){ var canvas = document.getElementById('cardvas') var ctx = canvas.getContext('2d') ctx.clearRect(0,0,canvas.width,canvas.height) var lines = [] for(var i=1;i<=10;i++){ number = document.getElementById('puzza'+i).value number = number.split(',').join('') number = number.split(' ').join('') first = true for(var j=0;j<number.length;j+=2){ document.getElementById('puzza'+i).style.background = 'white' nst = number.substring(j,j+2) n = nst/1 if(n in dots && nst.length == 2){ if(first){ first = false pre = n } else { if(pre==4 && n==17 || pre==17 && n==4 || pre==11 && n==20 || pre==20 && n==11){ lines.push([pre,'x']) lines.push(['x',n]) } else if(pre==16 && n==17 || pre==17 && n==16){ lines.push([16,0]) lines.push([0,17]) } else if(pre==1 && n==18 || pre==18 && n==1){ lines.push([1,5]) lines.push([5,18]) } else if(pre==7 && n==8 || pre==8 && n==7){ lines.push([7,19]) lines.push([19,8]) } else if(pre==9 && n==3 || pre==3 && n==9){ lines.push([9,1]) lines.push([1,3]) } else { lines.push([pre,n]) } pre = n } } else { document.getElementById('puzza'+i).style.background = 'red' } } } var polygons = [] for(var start=0;start<=20;start++){ polygons = polygons.concat(find_polygons([],start,lines)) } var best = [-1,-1] for(var i=0;i<polygons.length;i++){ var p = polygons[i] if(R_in(p)){ if(best[0] == -1 || area(p) < best[0]){ best = [area(p),p] } } } console.log(best) console.log(R_in(best[1])) if(best[0] > 0){ ctx.fillStyle='#E66F3E' ctx.beginPath() p = dots[best[1][best[1].length-1]] ctx.moveTo(p[0],p[1]) for(var i=0;i<best[1].length;i++){ p = dots[best[1][i]] ctx.lineTo(p[0],p[1]) } ctx.fill() } ctx.fillStyle='black' for(var i=0;i<dots.length;i++){ ctx.beginPath() ctx.arc(dots[i][0],dots[i][1],2,2*Math.PI,false) ctx.fill() ctx.fillText(i,dots[i][0]+3,dots[i][1]+4) } ctx.fillText('R',R[0],R[1]) ctx.strokeStyle = '#000000' ctx.lineWidth = '2' ctx.beginPath() for(var i=0;i<lines.length;i++){ var l = lines[i] ctx.moveTo(dots[l[0]][0],dots[l[0]][1]) ctx.lineTo(dots[l[1]][0],dots[l[1]][1]) } ctx.stroke()}function R_in(p){ count = 0 for(var i=0;i<p.length;i++){ var p1 = dots[p[i]] var p2 = dots[p[0]] if(i+1<p.length){ p2 = dots[p[i+1]] } if(intersect(p1,p2,[0,0],R)){ console.log(p[i],p[0]) count += 1 } } if(count%2==1){ return true } return false}function intersect(p1,p2,q1,q2){ var a = p2[0]-p1[0] var b = q1[0]-q2[0] var c = p2[1]-p1[1] var d = q1[1]-q2[1] var v = q1[0]-p1[0] var w = q1[1]-p1[1] var det = a*d-b*c if(det == 0){ return false } var alpha = (d*v-b*w)/det var beta = (a*w-c*v)/det if(alpha > 0 && alpha < 1 && beta > 0 && beta < 1){ return true } return false}function area(p){ return p.length}function find_polygons(lsin,next,lines){ var ls = [] for(var i=0;i<lsin.length;i++){ ls.push(lsin[i]) } var start = ls[0] if(next < start){ return [] } for(var i=1;i<ls.length;i++){ if(ls[i] == next){ return [] } } if(next==start && ls.length>2){ return [ls] } ls.push(next) var out = [] for(var i=0;i<lines.length;i++){ var l = lines[i] if(l[0] == next){ out = out.concat(find_polygons(ls,l[1],lines)) } if(l[1] == next){ out = out.concat(find_polygons(ls,l[0],lines)) } } return out}update_lines()</script>
http://www.mscroggs.co.uk/blog/59
http://www.mscroggs.co.uk/blog/5908 Dec 2018 12:00:00 GMTChristmas (2018) is coming!<div class='paragraph'>This year, the <a href="http://www.mscroggs.co.uk/">front page</a> of mscroggs.co.uk will once again feature an advent calendar, just like <a href="http://www.mscroggs.co.uk/blog/46">last year</a>, <a href="http://www.mscroggs.co.uk/blog/36">the year before</a> and <a href="http://www.mscroggs.co.uk/blog/23">the year before</a>. Behind each door, there will be a puzzle with a three digit solution. The solution to each day's puzzle forms part of a logic puzzle:</div><div class='paragraph'>It's nearly Christmas and something terrible has happened: one of Santa's five helpers—<span class='namepurple'>Kip Urples</span>, <span class='namegreen'>Meg Reeny</span>, <span class='namered'>Fred Metcalfe</span>, <span class='nameorange'>Jo Ranger</span>, and <span class='nameblue'>Bob Luey</span>—has stolen all the presents during the North Pole's annual Sevenstival. You need to find the culprit before Christmas is ruined for everyone.</div><div class='paragraph'>Every year in late November, Santa is called away from the North Pole for a ten hour meeting in which a judgemental group of elders decide who has been good and who has been naughty. While Santa is away, it is traditional for his helpers celebrate Sevenstival.Sevenstival gets its name from the requirement that every helper must take part in exactly seven activities during the celebration; this year'savailable activities were billiards, curling, having lunch, solving maths puzzles, table tennis, skiing, chess, climbing and ice skating.</div><div class='paragraph'>Each activity must be completed in one solid block: it is forbidden to spend some time doing an activity, take a break to do something else then return to the first activity.This year's Sevenstival took place between 0:00 and 10:00 (North Pole standard time).</div><div class='paragraph'>During this year's Sevenstival, one of Santa's helpers spent the time for one of their seven activities stealing all the presents from Santa's workshop.Santa's helpers have 24 pieces of information to give to you, but the culprit is going to lie about everything in an attempt to confuse you, so be careful who you trust.</div><div class='paragraph'>Behind each day (except Christmas Day), there is a puzzle with a <b>three-digit answer</b>.Each of these answers forms part of a fact that one of the helpers tells you.You must work out who the culprit is and between which times the theft took place.</div><div class='paragraph'>Ten randomly selected people who solve all the puzzles and submit their answers to the logic puzzle using the form behind the door on the 25th will win <b>prizes</b>!</div><a class='zoom' href='javascript:showlimage("prizes2018.jpg")'><img src='http://www.mscroggs.co.uk/img/320/prizes2018.jpg'></a><div class='paragraph'>As you solve the puzzles, your answers will be stored. To share your stored answers between multiple devices, enter your email address below the calendar and you will be emailed a magic link to visit on your other devices.</div><div class='paragraph'>Behind the door on Christmas Day, there will be a form allowing you to submit your answers. The winner will be randomly chosen from all those who submit the correct answer before the end of 2018. Each day's puzzle (and the entry form on Christmas Day) will be available from 5:00am GMT. But as the winners will be selected randomly, there's no need to get up at 5am on Christmas Day to enter!</div><div class='paragraph'>To win a prize, you must submit your entry before the end of 2018. Only one entry will be accepted per person. If you have any questions, ask them in the comments below or on <a href="https://twitter.com/mscroggs" target="new">Twitter</a>.</div><div class='paragraph'>So once December is here, get solving! Good luck and have a very merry Christmas!</div>
http://www.mscroggs.co.uk/blog/58
http://www.mscroggs.co.uk/blog/5825 Nov 2018 12:00:00 GMTRunge's Phenomenon<div class='note'>This is a post I wrote for round 2 of The Aperiodical's <a href="https://aperiodical.com/2018/06/announcing-the-big-internet-math-off/" target="new">Big Internet Math-Off 2018</a>. As I went out in round 1 of the Big Math-Off, you got to read about <a href="https://aperiodical.com/2018/07/the-big-internet-math-off-round-2-matt-parker-v-jo-morgan/" target="new">the real projective plane</a> instead of this.</div><div class='paragraph'>Polynomials are very nice functions: they're easy to integrate and differentiate, it's quick to calculate their value at points, and they're generally friendly to deal with. Because of this, it can often be useful to find a polynomial that closely approximates a more complicated function.</div><div class='paragraph'>Imagine a function defined for \(x\) between -1 and 1. Pick \(n-1\) points that lie on the function. There is a unique degree \(n\) polynomial (a polynomial whose highest power of \(x\) is \(x^n\)) that passes through these points. This polynomial is called an <em>interpolating polynomial</em>, and it sounds like it ought to be a pretty good approximation of the function.</div><div class='paragraph'>So let's try taking points on a function at equally spaces values of \(x\), and try to approximate the function:</div>$$f(x)=\frac1{1+25x^2}$$<a class='zoom' href='javascript:showlimage("runge-uniform.gif")'><img src='http://www.mscroggs.co.uk/img/320/runge-uniform.jpg'></a><div class='caption'>Polynomial interpolations of \(\displaystyle f(x)=\frac1{1+25x^2}\) using equally spaces points</div><div class='paragraph'>I'm sure you'll agree that these approximations are pretty terrible, and they get worse as more points are added. The high error towards 1 and -1 is called Runge's phenomenon, and was discovered in 1901 by Carl David Tolmé Runge.</div><div class='paragraph'>All hope of finding a good polynomial approximation is not lost, however: by choosing the points more carefully, it's possible to avoid Runge's phenomenon. Chebyshev points (named after Pafnuty Chebyshev) are defined by taking the \(x\) co-ordinate of equally spaced points on a circle.</div><a class='zoom' href='javascript:showlimage("chebdef.png")'><img src='http://www.mscroggs.co.uk/img/320/chebdef.jpg'></a><div class='caption'>Eight Chebyshev points</div><div class='paragraph'>The following GIF shows interpolating polynomials of the same function as before using Chebyshev points.</div><a class='zoom' href='javascript:showlimage("runge-chebyshev.gif")'><img src='http://www.mscroggs.co.uk/img/320/runge-chebyshev.jpg'></a><div class='paragraph'>Nice, we've found a polynomial that closely approximates the function... But I guess you're now wondering how well the Chebyshev interpolation will approximate other functions. To find out, let's try it out on the votes over time of <a href="http://aperiodical.com/2018/07/the-big-internet-math-off-round-1-matt-parker-v-matthew-scroggs/" target="new">my first round Big Internet Math-Off match.</a></div><a class='zoom' href='javascript:showlimage("data.png")'><img src='http://www.mscroggs.co.uk/img/320/data.jpg'></a><div class='caption'>Scroggs vs Parker, 6-8 July 2018</div><div class='paragraph'>The graphs below show the results of the match over time interpolated using 16 uniform points (left) and 16 Chebyshev points (right). You can see that the uniform interpolation is all over the place, but the Chebyshev interpolation is very close the the actual results.</div><a class='zoom' href='javascript:showlimage("uniform.png")'><img src='http://www.mscroggs.co.uk/img/320/uniform.jpg'></a><a class='zoom' href='javascript:showlimage("chebyshev.png")'><img src='http://www.mscroggs.co.uk/img/320/chebyshev.jpg'></a><div class='caption'>Scroggs vs Parker, 6-8 July 2018, approximated using uniform points (left) and Chebyshev points (right)</div><div class='paragraph'>But maybe you still want to see how good Chebyshev interpolation is for a function of your choice... To help you find out, I've written <a href="https://twitter.com/RungeBot" target="new">@RungeBot</a>, a Twitter bot that can compare interpolations with equispaced and Chebyshev points. Just tweet it a function, and it'll show you how bad Runge's phenomenon is for that function, and how much better Chebysheb points are.</div><div class='paragraph'>For example, if you were to tweet <a href="https://twitter.com/mscroggs/status/1013052921288720384" target="new">@RungeBot f(x)=abs(x)</a>, then RungeBot would reply: <a href="https://twitter.com/RungeBot/status/1013061582933430272" target="new">Here's your function interpolated using 17 equally spaced points (blue) and 17 Chebyshev points (red). For your function, Runge's phenomenon is terrible.</a></div><a class='zoom' href='javascript:showlimage("runge-abs.jpg")'><img src='http://www.mscroggs.co.uk/img/320/runge-abs.jpg'></a><div class='paragraph'>A list of constants and functions that RungeBot understands can be found <a href="https://github.com/mscroggs/Equation/blob/master/doc/source/Functions.rst" target="new">here</a>.</div>
http://www.mscroggs.co.uk/blog/57
http://www.mscroggs.co.uk/blog/5713 Sep 2018 12:00:00 GMTWorld Cup stickers 2018, pt. 3<div class='paragraph'>So you've <a href="http://www.mscroggs.co.uk/blog/50">calculated how much you should expect the World Cup sticker book to cost</a>and <a href="http://www.mscroggs.co.uk/blog/54">recorded how much it actually cost</a>. You might be wondering what else you can do with your sticker book.If so, look no further: this post contains 5 mathematical things involvolving your sticker book and stickers.</div><h3>Test the birthday paradox</h3><a class='zoom' href='javascript:showlimage("birthdaysbrazil.jpg")'><img src='http://www.mscroggs.co.uk/img/320/birthdaysbrazil.jpg'></a><div class='caption'>Stickers 354 and 369: Alisson and Roberto Firmino</div><div class='paragraph'>In a group of 23 people, there is a more than 50% chance that two of them will share a birthday. This is often called the birthday paradox, as the number 23 is surprisingly small.</div><div class='paragraph'>Back in 2014 when <a href="https://www.theguardian.com/science/alexs-adventures-in-numberland/2014/jun/10/world-cup-birthday-paradox-footballers-born-on-the-same-day" target="new">Alex Bellos</a> suggested testing the birthday paradox on World Cup squads, as there are 23 players in a World Cup squad. I recently discovered that even further back in 2012, <a href="https://www.youtube.com/watch?v=a2ey9a70yY0" target="new">James Grime made a video</a> about the birthday paradox in football games, using the players on both teams plus the referee to make 23 people.</div><div class='paragraph'>In this year's sticker book, each player's date of birth is given above their name, so you can use your sticker book to test it out yourself.</div><h3>Kaliningrad</h3><a class='zoom' href='javascript:showlimage("kaliningrad.jpg")'><img src='http://www.mscroggs.co.uk/img/320/kaliningrad.jpg'></a><div class='caption'>Sticker 022: Kaliningrad</div><div class='paragraph'>One of the cities in which games are taking place in this World Cup is Kaliningrad. Before 1945, Kaliningrad was called Königsberg. In Königsburg, there were seven bridges connecting four islands. The arrangement of these bridges is shown below.</div><a class='zoom' href='javascript:showlimage("7bridges.png")'><img src='http://www.mscroggs.co.uk/img/320/7bridges.jpg'></a><div class='paragraph'>The people of Königsburg would try to walk around the city in a route that crossed each bridge exactly one. If you've not tried this puzzle before, try to find such a route now before reading on...</div><div class='paragraph'>In 1736, mathematician Leonhard Euler proved that it is in fact impossible to find such a route. He realised that for such a route to exist, you need to be able to pair up the bridges on each island so that you can enter the island on one of each pair and leave on the other. The islands in Königsburg all have an odd number of bridges, so there cannot be a route crossing each bridge only once.</div><div class='paragraph'>In Kaliningrad, however, there are eight bridges: two of the original bridges were destroyed during World War II, and three more have been built. Because of this, it's now possible to walk around the city crossing each bridge exactly once.</div><a class='zoom' href='javascript:showlimage("kaliningrad-path.png")'><img src='http://www.mscroggs.co.uk/img/320/kaliningrad-path.jpg'></a><div class='attr'><a href="https://www.openstreetmap.org/" target="new">OpenStreetMap</a></div><div class='caption'>A route around Kaliningrad crossing each bridge exactly once.</div><div class='paragraph'>I wrote more about this puzzle, and using similar ideas to find the shortest possible route to complete a level of Pac-Man, in <a href="http://www.mscroggs.co.uk/blog/18">this blog post.</a></div><h3>Sorting algorithms</h3><div class='paragraph'>If you didn't convince many of your friends to join you in collecting stickers, you'll have lots of swaps. You can use these to practice performing your favourite sorting algorithms.</div><h4>Bubble sort</h4><div class='paragraph'>In the bubble sort, you work from left to right comparing pairs of stickers. If the stickers are in the wrong order, you swap them. After a few passes along the line of stickers, they will be in order.</div><a class='zoom' href='javascript:showlimage("bubble-sort-stickers.gif")'><img src='http://www.mscroggs.co.uk/img/320/bubble-sort-stickers.jpg'></a><div class='caption'>Bubble sort</div><h4>Insertion sort</h4><div class='paragraph'>In the insertion sort, you take the next sticker in the line and insert it into its correct position in the list.</div><a class='zoom' href='javascript:showlimage("insertion-sort-stickers.gif")'><img src='http://www.mscroggs.co.uk/img/320/insertion-sort-stickers.jpg'></a><div class='caption'>Insertion sort</div><h4>Quick sort</h4><div class='paragraph'>In the quick sort, you pick the middle sticker of the group and put the other stickers on the correct side of it. You then repeat the process with the smaller groups of stickers you have just formed.</div><a class='zoom' href='javascript:showlimage("quick-sort-stickers.gif")'><img src='http://www.mscroggs.co.uk/img/320/quick-sort-stickers.jpg'></a><div class='caption'>Quick sort</div><div class='paragraph'></div><h3>The football</h3><a class='zoom' href='javascript:showlimage("correct-football.jpg")'><img src='http://www.mscroggs.co.uk/img/320/correct-football.jpg'></a><div class='caption'>Sticker 007: The official ball</div><div class='paragraph'>Sticker 007 shows the official tournament ball. If you look closely (click to enlarge), you can see that the ball is made of a mixture of pentagons and hexagons. The ball is not made of only hexagons, as <a href="https://www.youtube.com/watch?v=btPqKAGyajM" target="new">road signs in the UK show</a>.</div><div class='paragraph'>Stand up mathematician Matt Parker started <a href="https://petition.parliament.uk/petitions/202305" target="new">a petition</a> to get the symbol on the signs changed, but the idea was rejected.</div><div class='paragraph'>If you have a swap of sticker 007, why not stick it to a letter to your MP about the incorrect signs as an example of what an actual football looks like.</div><h3>Psychic pets</h3><div class='paragraph'>Speaking of Matt Parker, during this World Cup, he's looking for <a href="https://www.youtube.com/watch?v=tQiiaFE1e-Y" target="new">psychic pets</a> that are able to predict World Cup results. Why not use your swaps to label two pieces of food that your pet can choose between to predict the results of the remaining matches?</div><a class='zoom' href='javascript:showlimage("timber-football1.jpg")'><img src='http://www.mscroggs.co.uk/img/320/timber-football1.jpg'></a><a class='zoom' href='javascript:showlimage("timber-football2.jpg")'><img src='http://www.mscroggs.co.uk/img/320/timber-football2.jpg'></a><div class='caption'>Timber using my swaps to wrongly predict the first match</div>
http://www.mscroggs.co.uk/blog/56
http://www.mscroggs.co.uk/blog/5607 Jul 2018 12:00:00 GMTSunday Afternoon Maths LXVI<h3>Cryptic crossnumber #2</h3><div class='paragraph'>In this puzzle, the clues are written like clues from a cryptic crossword, but the answers are all numbers. You can download a printable pdf of this puzzle <a href="https://drive.google.com/open?id=18fgs3nnakOyqcqyYQ7FVRfMl-UU_luNk" target="new">here</a>.</div><table class='crossnumber'><tr><td style='background-color:black'></td><td style='background-color:black'></td><td>1</td><td>2</td><td> </td></tr><tr><td style='background-color:black'></td><td style='background-color:black'></td><td>3</td><td> </td><td style='background-color:black'></td></tr><tr><td style='background-color:black'></td><td style='background-color:black'></td><td> </td><td style='background-color:black'></td><td style='background-color:black'></td></tr><tr><td style='background-color:black'></td><td>4</td><td> </td><td style='background-color:black'></td><td style='background-color:black'></td></tr><tr><td>5</td><td> </td><td> </td><td style='background-color:black'></td><td style='background-color:black'></td></tr></table><table class='invisible'><tr><td width='49%' style='vertical-align:top'><h3>Across</h3><table class='invisible'><tr><td width='15px' style='text-align:left;vertical-align:top'><b>1</b></td><td style='text-align:left;vertical-align:top'>Found your far dented horn mixed to make square.</td><td width='15px' style='text-align:right;vertical-align:top'><b>(3)</b></td></tr><tr><td width='15px' style='text-align:left;vertical-align:top'><b>3</b></td><td style='text-align:left;vertical-align:top'>Eno back in Bowie's evening prime.</td><td width='15px' style='text-align:right;vertical-align:top'><b>(2)</b></td></tr><tr><td width='15px' style='text-align:left;vertical-align:top'><b>4</b></td><td style='text-align:left;vertical-align:top'>Prime legs.</td><td width='15px' style='text-align:right;vertical-align:top'><b>(2)</b></td></tr><tr><td width='15px' style='text-align:left;vertical-align:top'><b>5</b></td><td style='text-align:left;vertical-align:top'>Palindrome ends cubone, starts ninetales, inside poison ekans.</td><td width='15px' style='text-align:right;vertical-align:top'><b>(3)</b></td></tr></table></td><td></td><td width='49%' style='vertical-align:top'><h3>Down</h3><table class='invisible'><tr><td width='15px' style='text-align:left;vertical-align:top'><b>1</b></td><td style='text-align:left;vertical-align:top'>Odd confused elven elves hounded deerhound antenna.</td><td width='15px' style='text-align:right;vertical-align:top'><b>(5)</b></td></tr><tr><td width='15px' style='text-align:left;vertical-align:top'><b>2</b></td><td style='text-align:left;vertical-align:top'>Prime try of confused Sven with Beckham's second.</td><td width='15px' style='text-align:right;vertical-align:top'><b>(2)</b></td></tr><tr><td width='15px' style='text-align:left;vertical-align:top'><b>4</b></td><td style='text-align:left;vertical-align:top'>Prime even and Ian fed the being.</td><td width='15px' style='text-align:right;vertical-align:top'><b>(2)</b></td></tr></table></td></tr></table>
http://www.mscroggs.co.uk/puzzles/LXVI
http://www.mscroggs.co.uk/puzzles/LXVI20 May 2018 12:00:00 GMTSunday Afternoon Maths LXV<h3>Cryptic crossnumber #1</h3><div class='paragraph'>In this puzzle, the clues are written like clues from a cryptic crossword, but the answers are all numbers. You can download a printable pdf of this puzzle <a href="https://drive.google.com/open?id=1cS0TN2_qxYX5Jo-ijSio1ywRW33zPz04" target="new">here</a>.</div><table class='crossnumber'><tr><td>1</td><td> </td><td>2</td><td style='background-color:black'></td><td style='background-color:black'></td></tr><tr><td> </td><td style='background-color:black'></td><td> </td><td style='background-color:black'></td><td style='background-color:black'></td></tr><tr><td>3</td><td> </td><td> </td><td> </td><td>4</td></tr><tr><td style='background-color:black'></td><td style='background-color:black'></td><td> </td><td style='background-color:black'></td><td> </td></tr><tr><td style='background-color:black'></td><td style='background-color:black'></td><td>5</td><td> </td><td> </td></tr></table><table class='invisible'><tr><td width='49%' style='vertical-align:top'><h3>Across</h3><table class='invisible'><tr><td width='15px' style='text-align:left;vertical-align:top'><b>1</b></td><td style='text-align:left;vertical-align:top'>Triangular one then square.</td><td width='15px' style='text-align:right;vertical-align:top'><b>(3)</b></td></tr><tr><td width='15px' style='text-align:left;vertical-align:top'><b>3</b></td><td style='text-align:left;vertical-align:top'>Audible German no between tutus, for one square.</td><td width='15px' style='text-align:right;vertical-align:top'><b>(5)</b></td></tr><tr><td width='15px' style='text-align:left;vertical-align:top'><b>5</b></td><td style='text-align:left;vertical-align:top'>Irreducible ending Morpheus halloumi fix, then Trinity, then mixed up Neo.</td><td width='15px' style='text-align:right;vertical-align:top'><b>(3)</b></td></tr></table></td><td></td><td width='49%' style='vertical-align:top'><h3>Down</h3><table class='invisible'><tr><td width='15px' style='text-align:left;vertical-align:top'><b>1</b></td><td style='text-align:left;vertical-align:top'>Inside Fort Worth following unlucky multiple of eleven.</td><td width='15px' style='text-align:right;vertical-align:top'><b>(3)</b></td></tr><tr><td width='15px' style='text-align:left;vertical-align:top'><b>2</b></td><td style='text-align:left;vertical-align:top'>Palindrome two between two clickety-clicks.</td><td width='15px' style='text-align:right;vertical-align:top'><b>(5)</b></td></tr><tr><td width='15px' style='text-align:left;vertical-align:top'><b>4</b></td><td style='text-align:left;vertical-align:top'>Confused Etna honored thundery din became prime.</td><td width='15px' style='text-align:right;vertical-align:top'><b>(3)</b></td></tr></table></td></tr></table><h3>Breaking Chocolate</h3><div class='paragraph'>You are given a bar of chocolate made up of 15 small blocks arranged in a 3×5 grid.</div>
<a class='zoom' href='javascript:showlimage("choc.png")'><img src='http://www.mscroggs.co.uk/img/320/choc.jpg'></a>
<div class='paragraph'>You want to snap the chocolate bar into 15 individual pieces. What is the fewest number of snaps that you need to break the bar? (One snap consists of picking up one piece of chocolate and snapping it into two pieces.)</div><h3>Square and cube endings</h3><div class='paragraph'>How many positive two-digit numbers are there whose square and cube both end in the same digit?</div>
http://www.mscroggs.co.uk/puzzles/LXV
http://www.mscroggs.co.uk/puzzles/LXV13 May 2018 12:00:00 GMTSunday Afternoon Maths LXIV<h3>Equal lengths</h3><div class='paragraph'>The picture below shows two copies of the same rectangle with red and blue lines. The blue line visits the midpoint of the opposite side. The lengths shown in red and blue are of equal length.</div><a class='zoom' href='javascript:showlimage("rectangles506.png")'><img src='http://www.mscroggs.co.uk/img/320/rectangles506.jpg'></a><div class='paragraph'>What is the ratio of the sides of the rectangle?</div><h3>Digitless factor</h3><div class='paragraph'>Ted thinks of a three-digit number. He removes one of its digits to make a two-digit number.</div><div class='paragraph'>Ted notices that his three-digit number is exactly 37 times his two-digit number. What was Ted's three-digit number?</div><h3>Backwards fours</h3><div class='paragraph'>If A, B, C, D and E are all unique digits, what values would work with the following equation?</div>$$ABCCDE\times 4 = EDCCBA$$
http://www.mscroggs.co.uk/puzzles/LXIV
http://www.mscroggs.co.uk/puzzles/LXIV06 May 2018 12:00:00 GMTSunday Afternoon Maths LXIII<h3>Is it equilateral?</h3><div class='paragraph'>In the diagram below, \(ABDC\) is a square. Angles \(ACE\) and \(BDE\) are both 75°.</div><a class='zoom' href='javascript:showlimage("square-cd07.png")'><img src='http://www.mscroggs.co.uk/img/320/square-cd07.jpg'></a><div class='paragraph'>Is triangle \(ABE\) equilateral? Why/why not?</div><h3>Cube multiples</h3><div class='paragraph'>Six different (strictly) positive integers are written on the faces of a cube. The sum of the numbers on any two adjacent faces is a multiple of 6.</div><div class='paragraph'>What is the smallest possible sum of the six numbers?</div>
http://www.mscroggs.co.uk/puzzles/LXIII
http://www.mscroggs.co.uk/puzzles/LXIII22 Apr 2018 12:00:00 GMTAdvent calendar 2017<h3>Advent 2017 logic puzzle</h3><div class='paragraph'>2017's Advent calendar ended with a logic puzzle: It's nearly Christmas and something terrible has happened: Santa and his two elves have been cursed! The curse has led Santa to forget which present three childrenâ€”Alex, Ben and Carolâ€”want and where they live.</div><div class='paragraph'>The elves can still remember everything about Alex, Ben and Carol, but the curse is causing them to lie. One of the elves will lie on even numbered days and tell the truth on odd numbered days; the other elf will lie on odd numbered days and tell the truth on even numbered days. As is common in elf culture, each elf wears the same coloured clothes every day.</div><div class='paragraph'>Each child lives in a different place and wants a different present. (But a present may be equal to a home.) The homes and presents are each represented by a number from 1 to 9.</div><div class='paragraph'>Here are the clues:</div><div class="advent ad2017"><div class="door solved white"><span class="advent_solved_num">21</span><br>White shirt says: "Yesterday's elf lied: Carol wants <b>4</b>, <b>9</b> or <b>6</b>."</div><div class="door solved orange"><span class="advent_solved_num">10</span><br>Orange hat says: "<b>249</b> is my favourite number."</div><div class="door solved red"><span class="advent_solved_num">5</span><br>Red shoes says: "Alex lives at <b>1</b>, <b>9</b> or <b>6</b>."</div><div class="door solved blue"><span class="advent_solved_num">16</span><br>Blue shoes says: "I'm the same elf as yesterday. Ben wants <b>5</b>, <b>7</b> or <b>0</b>."</div><div class="door solved red"><span class="advent_solved_num">23</span><br>Red shoes says: "Carol wants a factor of <b>120</b>. I am yesterday's elf."</div><div class="door solved blue"><span class="advent_solved_num">4</span><br>Blue shoes says: "<b>495</b> is my favourite number."</div><div class="door solved blue"><span class="advent_solved_num">15</span><br>Blue shoes says: "Carol lives at <b>9</b>, <b>6</b> or <b>8</b>."</div><div class="door solved purple"><span class="advent_solved_num">22</span><br>Purple trousers says: "Carol wants a factor of <b>294</b>."</div><div class="door solved white"><span class="advent_solved_num">11</span><br>White shirt says: "<b>497</b> is my favourite number."</div><div class="door solved pink"><span class="advent_solved_num">6</span><br>Pink shirt says: "Ben does not live at the last digit of <b>106</b>."</div><div class="door solved blue"><span class="advent_solved_num">9</span><br>Blue shoes says: "Ben lives at <b>5</b>, <b>1</b> or <b>2</b>."</div><div class="door solved orange"><span class="advent_solved_num">20</span><br>Orange hat says: "Carol wants the first digit of <b>233</b>."</div><div class="door solved red"><span class="advent_solved_num">1</span><br>Red shoes says: "Alex wants <b>1</b>, <b>2</b> or <b>3</b>."</div><div class="door solved green"><span class="advent_solved_num">24</span><br>Green hat says: "The product of the six final presents and homes is <b>960</b>."</div><div class="door solved grey"><span class="advent_solved_num">17</span><br>Grey trousers says: "Alex wants the first digit of <b>194</b>."</div><div class="door solved pink"><span class="advent_solved_num">14</span><br>Pink shirt says: "One child lives at the first digit of <b>819</b>."</div><div class="door solved white"><span class="advent_solved_num">3</span><br>White shirt says: "Alex lives at <b>2</b>, <b>1</b> or <b>6</b>."</div><div class="door solved green"><span class="advent_solved_num">18</span><br>Green hat says: "Ben wants <b>1</b>, <b>5</b> or <b>4</b>."</div><div class="door solved green"><span class="advent_solved_num">7</span><br>Green hat says: "Ben lives at <b>3</b>, <b>4</b> or <b>3</b>."</div><div class="door solved grey"><span class="advent_solved_num">12</span><br>Grey trousers says: "Alex lives at <b>3</b>, <b>1</b> or <b>5</b>."</div><div class="door solved purple"><span class="advent_solved_num">19</span><br>Purple trousers says: "Carol lives at <b>2</b>, <b>6</b> or <b>8</b>."</div><div class="door solved red"><span class="advent_solved_num">8</span><br>Red shoes says: "The digits of <b>529</b> are the toys the children want."</div><div class="door solved green"><span class="advent_solved_num">13</span><br>Green hat says: "One child lives at the first digit of <b>755</b>."</div><div class="door solved red"><span class="advent_solved_num">2</span><br>Red shoes says: "Alex wants <b>1</b>, <b>4</b> or <b>2</b>."</div></div><br /><h3>24 December</h3><div class='paragraph'>Today's number is the smallest number with exactly 28 factors (including 1 and the number itself as factors).</div><h3>23 December</h3><div class='paragraph'>In the song <a href="https://en.wikipedia.org/wiki/Twelve_Days_of_Christmas_(song)" target="new"><i>The Twelve Days of Christmas</i></a>, how many presents have been given after 8 days?</div><h3>22 December</h3><div class='paragraph'>22 is two times an odd number. Today's number is the mean of all the answers on days (including today) that are two times an odd number.</div><div class='note'>Clarification: You are taking the mean for answers on days that are two times an odd numbers; ie. the days are two times odd, not the answers.</div><h3>21 December</h3><div class='paragraph'>The factors of 6 (excluding 6 itself) are 1, 2 and 3. \(1+2+3=6\), so 6 is a <i>perfect number</i>.</div><div class='paragraph'>Today's number is the only three digit perfect number.</div><h3>20 December</h3><div class='paragraph'>What is the largest number that cannot be written in the form \(10a+27b\), where \(a\) and \(b\) are nonnegative integers (ie \(a\) and \(b\) can be 0, 1, 2, 3, ...)?</div><h3>19 December</h3><div class='paragraph'>Put the digits 1 to 9 (using each digit exactly once) in the boxes so that the products are correct. Today's number is the smallest number that can be made using the digits in the red boxes.</div><table class='grid'><tr><td class='bsq red'></td><td>×</td><td class='bsq'></td><td>×</td><td class='bsq'></td><td>= 90</td></tr><tr><td>×</td><td class='g'> </td><td>×</td><td class='g'> </td><td>×</td><td></td></tr><tr><td class='bsq'></td><td>×</td><td class='bsq'></td><td>×</td><td class='bsq'></td><td>= 84</td></tr><tr><td>×</td><td class='g'> </td><td>×</td><td class='g'> </td><td>×</td><td></td></tr><tr><td class='bsq red'></td><td>×</td><td class='bsq red'></td><td>×</td><td class='bsq'></td><td>= 48</td></tr><tr><td>=<br />64</td><td></td><td>=<br />90</td><td></td><td>=<br />63</td><td class='nb nr'></td></tr></table><h3>18 December</h3><div class='paragraph'>Today's number is the maximum number of pieces that a (circular) pancake can be cut into with 17 straight cuts.</div><h3>17 December</h3><div class='paragraph'>Arrange the digits 1-9 in a 3×3 square so that every row makes a three-digit square number, the first column makes a multiple of 7 and the second column makes a multiple of 4.The number in the third column is today's number.</div><table class='biggrid'><tr><td class='bsq'></td><td class='bsq'></td><td class='bsq'></td><td align=left>square</td></tr><tr><td class='bsq'></td><td class='bsq'></td><td class='bsq'></td><td>square</td></tr><tr><td class='bsq'></td><td class='bsq'></td><td class='bsq'></td><td align=left>square</td></tr><tr><td>multiple of 7</td><td>multiple of 4</td><td><b>today's number</b></td></tr></table><h3>16 December</h3><div class='paragraph'>There are <a href="http://www.mscroggs.co.uk/puzzles/25">204 squares (of any size) in an 8×8 grid of squares</a>. Today's number is the number of rectangles (of any size) in a 2×19 grid of squares</div><h3>15 December</h3><div class='paragraph'>The string <i>ABBAABBBBB</i> is 10 characters long, contains only <i>A</i> and <i>B</i>, and contains at least three <i>A</i>s.</div><div class='paragraph'>Today's number is the number of different 10 character strings of <i>A</i>s and <i>B</i>s that have at least three <i>A</i>s.</div><h3>14 December</h3><div class='paragraph'>There are <a href="http://www.mscroggs.co.uk/puzzles/25">204 squares (of any size) in an 8×8 grid of squares</a>. Today's number is the number of squares in a 13×13 grid of squares</div><h3>13 December</h3><div class='paragraph'>A book has 754 pages (numbered 1 to 754: page 1 is on the left of the first double page spread, and page 754 is on the right of the final double page spread). What do the page numbers of the middle two-page spread add up to?</div><h3>12 December</h3><div class='paragraph'>Put the digits 1 to 9 (using each digit exactly once) in the boxes so that the sums are correct. Today's number is the product of the numbers in the red boxes.</div><table class='grid'><tr><td class='bsq'></td><td>+</td><td class='bsq red'></td><td>+</td><td class='bsq red'></td><td>= 17</td></tr><tr><td>+</td><td class='g'> </td><td>+</td><td class='g'> </td><td>+</td><td></td></tr><tr><td class='bsq'></td><td>+</td><td class='bsq'></td><td>+</td><td class='bsq'></td><td>= 7</td></tr><tr><td>+</td><td class='g'> </td><td>+</td><td class='g'> </td><td>+</td><td></td></tr><tr><td class='bsq'></td><td>+</td><td class='bsq red'></td><td>+</td><td class='bsq'></td><td>= 21</td></tr><tr><td>=<br />11</td><td></td><td>=<br />20</td><td></td><td>=<br />14</td><td class='nb nr'></td></tr></table><h3>11 December</h3><div class='paragraph'>Two more than today's number is the reverse of two times today's number.</div><h3>10 December</h3><div class='paragraph'>How many zeros does 1000! (ie 1000 × 999 × 998 × ... × 1) end with?</div><h3>9 December</h3><div class='paragraph'>Write the numbers 1 to 15 in a row. Underneath, write the same list without the first and last numbers. Continue this until you have just one number left.</div><table class='invisible'><tr><td> 1 </td><td> 2 </td><td> 3 </td><td> 4 </td><td> 5 </td><td> 6 </td><td> 7 </td><td> 8 </td><td> 9 </td><td> 10 </td><td> 11 </td><td> 12 </td><td> 13 </td><td> 14 </td><td> 15 </td></tr><tr><td> </td><td> 2 </td><td> 3 </td><td> 4 </td><td> 5 </td><td> 6 </td><td> 7 </td><td> 8 </td><td> 9 </td><td> 10 </td><td> 11 </td><td> 12 </td><td> 13 </td><td> 14 </td><td> </td></tr><tr><td> </td><td> </td><td> 3 </td><td> 4 </td><td> 5 </td><td> 6 </td><td> 7 </td><td> 8 </td><td> 9 </td><td> 10 </td><td> 11 </td><td> 12 </td><td> 13 </td><td> </td><td> </td></tr><tr><td colspan=15>etc.</td></tr></table><div class='paragraph'>Today's number is the sum of all the numbers you have written.</div><h3>8 December</h3><div class='paragraph'>The odd numbers are written in a pyramid.</div><table class='invisible'><tr><td></td><td></td><td>1</td><td></td><td></td></tr><tr><td></td><td>3</td><td></td><td>5</td><td></td></tr><tr><td>7</td><td></td><td>9</td><td></td><td>11</td></tr><tr><td colspan=5>etc.</td></tr></table><div class='paragraph'>What is the mean of the numbers in the 23rd row?</div><h3>7 December</h3><div class='paragraph'>The odd numbers are written in a pyramid.</div><table class='invisible'><tr><td></td><td></td><td>1</td><td></td><td></td></tr><tr><td></td><td>3</td><td></td><td>5</td><td></td></tr><tr><td>7</td><td></td><td>9</td><td></td><td>11</td></tr><tr><td colspan=5>etc.</td></tr></table><div class='paragraph'>What is the sum of the numbers in the seventh row?</div><h3>6 December</h3><div class='paragraph'>\(p(x)\) is a quadratic with real coefficients. For all real numbers \(x\),</div>$$x^2+4x+14\leq p(x)\leq 2x^2+8x+18$$<div class='paragraph'>\(p(2)=34\). What is \(p(6)\)?</div><h3>5 December</h3><div class='paragraph'>You start at A and are allow to walk left, right, up or down along the grid. The grid continues forever in every direction. After you have walked thirteen units, how many different locations could you be in?</div><a class='zoom' href='javascript:showlimage("grid2017.png")'><img src='http://www.mscroggs.co.uk/img/320/grid2017.jpg'></a><div class='paragraph'></div><h3>4 December</h3><div class='paragraph'>Pick a three digit number whose digits are all different.</div><div class='paragraph'>Sort the digits into ascending and descending order to form two new numbers. Find the difference between these numbers.</div><div class='paragraph'>Repeat this process until the number stops changing. The final result is today's number.</div><h3>3 December</h3><div class='paragraph'>Put the digits 1 to 9 (using each digit exactly once) in the boxes so that the sums are correct. The sums should be read left to right and top to bottom ignoring the usual order of operations. For example, 4+3×2 is 14, not 10. Today's number is the product of the numbers in the red boxes.</div><table class='grid'><tr><td class='bsq'></td><td>+</td><td class='bsq'></td><td>+</td><td class='bsq red'></td><td>= 17</td></tr><tr><td>+</td><td class='g'> </td><td>÷</td><td class='g'> </td><td>×</td><td></td></tr><tr><td class='bsq'></td><td>÷</td><td class='bsq'></td><td>-</td><td class='bsq red'></td><td>= 1</td></tr><tr><td>-</td><td class='g'> </td><td>×</td><td class='g'> </td><td>÷</td><td></td></tr><tr><td class='bsq'></td><td>÷</td><td class='bsq red'></td><td>-</td><td class='bsq'></td><td>= 0</td></tr><tr><td>=<br />4</td><td></td><td>=<br />12</td><td></td><td>=<br />27</td><td class='nb nr'></td></tr></table><h3>2 December</h3><div class='paragraph'>There are three cards; one number is written on each card. You are told that the sums of pairs of cards are 99, 83 and 102.What is the sum of all three cards?</div><h3>1 December</h3><div class='paragraph'>Today's number is the smallest three digit number such that the sum of its digits is equal to the product of its digits.</div>
http://www.mscroggs.co.uk/puzzles/advent2017
http://www.mscroggs.co.uk/puzzles/advent201725 Dec 2017 12:00:00 GMT