<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Algorithms on Andrew Walsh</title><link>https://www.awalsh128.com/tags/algorithms/</link><description>Recent content in Algorithms on Andrew Walsh</description><generator>Hugo -- gohugo.io</generator><language>en-US</language><copyright>© 2026 Andrew Walsh</copyright><lastBuildDate>Fri, 04 Jan 2013 19:11:30 -0800</lastBuildDate><atom:link href="https://www.awalsh128.com/tags/algorithms/feed.xml" rel="self" type="application/rss+xml"/><item><title>Text generation using Markov chains.</title><link>https://www.awalsh128.com/text-generation-using-markov-chains/</link><pubDate>Fri, 04 Jan 2013 00:00:00 -0800</pubDate><guid>https://www.awalsh128.com/text-generation-using-markov-chains/</guid><description>&lt;h3 class="relative group"&gt;Introduction&#10; &lt;div id="introduction" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#introduction" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h3&gt;&#10;&lt;p&gt;If you are already familiar with &lt;a href="http://en.wikipedia.org/wiki/Finite-state_machine" target="_blank" rel="noreferrer"&gt;finite automata&lt;/a&gt;, then&#10;understanding a &lt;a href="http://en.wikipedia.org/wiki/Markov_chain" target="_blank" rel="noreferrer"&gt;Markov chain&lt;/a&gt; will not be as hard. If you are not&#10;familiar with one, you can think of finite automata as a &lt;a href="http://en.wikipedia.org/wiki/Flowchart" target="_blank" rel="noreferrer"&gt;flowchart&lt;/a&gt;,&#10;with states and paths leading from one state to another&#10;&lt;a href="http://xkcd.com/627/" target="_blank" rel="noreferrer"&gt;based on some decision being made&lt;/a&gt;. An example could be a room with a light switch;&#10;there are the two states of having the light on or off. Using the light switch will transition you between the&#10;two states.&lt;/p&gt;</description></item><item><title>Understanding compression and Huffman Coding.</title><link>https://www.awalsh128.com/understanding-compression-and-huffman/</link><pubDate>Thu, 20 Sep 2012 00:00:00 -0700</pubDate><guid>https://www.awalsh128.com/understanding-compression-and-huffman/</guid><description>&lt;h3 class="relative group"&gt;Definitions&#10; &lt;div id="definitions" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#definitions" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h3&gt;&#10;&lt;p&gt;In a lot of texts regarding compression you will run across various conventions of syntax to describe the&#10;coding of data. Much of them are used in fields like&#10;&lt;a href="http://en.wikipedia.org/wiki/Automata_theory" target="_blank" rel="noreferrer"&gt;automata theory&lt;/a&gt;, group theory and statistics. Although, the&#10;field of &lt;a href="http://en.wikipedia.org/wiki/Coding_theory" target="_blank" rel="noreferrer"&gt;coding theory&lt;/a&gt; itself has&#10;&lt;a href="http://en.wikipedia.org/wiki/Timeline_of_information_theory" target="_blank" rel="noreferrer"&gt;a long and rich history&lt;/a&gt; in the 20st century;&#10;much of the terminology is borrowed from fields that gave rise to it.&lt;/p&gt;</description></item><item><title>Detecting cycles in decimal digits and lists.</title><link>https://www.awalsh128.com/detecting-cycles-in-decimal-digits-and/</link><pubDate>Sun, 16 Oct 2011 00:00:00 -0700</pubDate><guid>https://www.awalsh128.com/detecting-cycles-in-decimal-digits-and/</guid><description>&lt;p&gt;I was recently working on solving &lt;a href="http://projecteuler.net/problem=64" target="_blank" rel="noreferrer"&gt;problem 64 for project Euler&lt;/a&gt; and one&#10;of the needed algorithms was a detection of cycles in a list. This routine works for detecting cycles in lists&#10;of cardinality greater than 2.&lt;br&gt;&#10;\&lt;/p&gt;</description></item><item><title>Pseudo random proportional scheduling in games.</title><link>https://www.awalsh128.com/pseudo-random-proportional-scheduling/</link><pubDate>Fri, 02 Sep 2011 00:00:00 -0700</pubDate><guid>https://www.awalsh128.com/pseudo-random-proportional-scheduling/</guid><description>&lt;p&gt;I have been working on a game where enemy characters must select a target seemingly at random but such that&#10;the distribution of selected targets is balanced. Initially I had come up with a randomization algorithm with&#10;weighted values for each target but this became cumbersome and much too complex.&lt;br&gt;&#10;&lt;br&gt;&#10;Then I remembered the scheduling algorithms from my Operating Systems class. In particular, the&#10;&lt;a href="http://en.wikipedia.org/wiki/Lottery_scheduling" target="_blank" rel="noreferrer"&gt;lottery scheduling algorithm&lt;/a&gt;.&lt;br&gt;&#10;\&lt;/p&gt;</description></item></channel></rss>