The Art of Machinery - Posts Tagged MathematicsMathematics — Understanding the world using abstraction.
https://theartofmachinery.com/tags/maths/
Extending Looped Music for Fun, Relaxation and Productivity<p>Some work (like programming) takes a lot of concentration, and I use noise-cancelling headphones
to help me work productively in silence. But for other work (like doing business paperwork), I prefer to have quiet
music in the background to help me stay focussed. Quiet background music is good for meditation or dozing, too. If you
can’t fall asleep or completely clear your mind, zoning out to some music is the next best thing.</p>
<p>The best music for that is simple and repetitive — something nice enough to listen too, but not distracting,
and okay to tune out of when needed. Computer game music is like that, by design, so there’s plenty of good background
music out there. The harder problem is finding samples that play for more than a few minutes.</p> <p>So I
made <a href="https://gitlab.com/sarneaud/loopx"><code class="language-plaintext
highlighter-rouge">loopx</code></a>, a tool that takes a sample of music that loops a few times, and
repeats the loop to make a long piece of music.</p> <p>When you’re listening to the same music loop for a
long time, even slight distortion becomes distracting. Making quality extended music audio out of real-world samples
(and doing it fast enough) takes a bit of maths and computer science. About ten years ago I was doing digital signal
processing (DSP) programming for industrial metering equipment, so this side project got me digging up some old theory
again.</p>
https://theartofmachinery.com/2021/03/12/loopx.html
https://theartofmachinery.com/2021/03/12/loopx.htmlFri, 12 Mar 2021 00:00:00 +0000Pi from High School Maths<p>Warning: I don’t think the stuff in this post has any direct practical application by itself
(unless you’re a nuclear war survivor and need to reconstruct maths from scratch or something). Sometimes I like to go
back to basics, though. Here’s a look at <math xmlns='http://www.w3.org/1998/Math/MathML'
display='inline'><semantics><mrow><mi>π</mi></mrow><annotation
encoding='application/x-tex'>\pi</annotation></semantics></math> and areas of curved shapes
without any calculus or transcendental functions.</p>
https://theartofmachinery.com/2020/10/26/pi_from_high_school_maths.html
https://theartofmachinery.com/2020/10/26/pi_from_high_school_maths.htmlMon, 26 Oct 2020 00:00:00 +0000Glico (Weighted Rock Paper Scissors)<p>This still isn’t the blog post I said I was going to write about now, but I figured some game
theory would make a good post at the moment, especially when a lot of people I know are working at home with kids who
need entertaining. Here’s some stuff about a traditional Japanese kids’ game called Glico, a form of weighted Rock
Paper Scissors (RPS).</p>
https://theartofmachinery.com/2020/05/21/glico_weighted_rock_paper_scissors.html
https://theartofmachinery.com/2020/05/21/glico_weighted_rock_paper_scissors.htmlThu, 21 May 2020 00:00:00 +0000Some Useful Probability Facts for Systems Programming<p>Probability problems come up a lot in systems programming, and I’m using that term loosely to
mean everything from operating systems programming and networking, to building large online services, to creating
virtual worlds like in games. Here’s a bunch of rough-and-ready probability rules of thumb that are deeply related and
have many practical applications when designing systems.</p>
https://theartofmachinery.com/2020/01/27/systems_programming_probability.html
https://theartofmachinery.com/2020/01/27/systems_programming_probability.htmlMon, 27 Jan 2020 00:00:00 +0000Euler's Identity Really is a Miracle, Too<p><a href="https://blog.plover.com/math/exponential.html">A post about the exponential
function being a miracle</a> did the rounds recently, and <a
href="https://news.ycombinator.com/item?id=20954275">the Hacker News comment thread</a> brought up some debate
about the miracle of Euler’s famous identity:</p> <math xmlns='http://www.w3.org/1998/Math/MathML'
display='block'><semantics><mrow><msup><mi>e</mi>
<mrow><mi>π</mi><mi>i</mi></mrow></msup><mo>+</mo><mn>1</mn><mo>=</mo><mn>0</mn></mrow><annotation
encoding='application/x-tex'>e^{\pi i} + 1 = 0</annotation></semantics></math> <p>A while
back I used to make a living teaching this stuff to high school students and university undergrads. Let me give my
personal take on what’s so special about Euler’s identity.</p>
https://theartofmachinery.com/2019/09/20/euler_formula_miracle.html
https://theartofmachinery.com/2019/09/20/euler_formula_miracle.htmlFri, 20 Sep 2019 00:00:00 +0000Why Sorting is O(N log N)<p>Any decent algorithms textbook will explain how fast sorting algorithms like quicksort and
heapsort are, but it doesn’t take crazy maths to prove that they’re as asymptotically fast as you can possibly
get.</p>
https://theartofmachinery.com/2019/01/05/sorting_is_nlogn.html
https://theartofmachinery.com/2019/01/05/sorting_is_nlogn.htmlSat, 05 Jan 2019 00:00:00 +0000Counting Sudoku Solution Grids using Monte Carlo<p>How many ways can you fill a 9x9 grid, obeying all the rules of the sudoku puzzle? The answer is
too big to just calculate directly on a computer, so an exact answer takes careful analysis. But if an absolutely exact
answer isn’t required, we can get a good statistical approximation using a Monte Carlo algorithm. As a bonus, the
algorithm doesn’t need any application-specific analysis and works on many other problems, too. It’s a handy “stupid
things that work” approach to solving problems.</p>
https://theartofmachinery.com/2017/08/14/monte_carlo_counting_sudoku_grids.html
https://theartofmachinery.com/2017/08/14/monte_carlo_counting_sudoku_grids.htmlMon, 14 Aug 2017 00:00:00 +0000