<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Randomness on Yang's Blog</title><link>https://blog.yangtheman.com/tags/randomness/</link><description>Recent content in Randomness on Yang's Blog</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>© 2026 Yang Chung</copyright><lastBuildDate>Tue, 23 Feb 2010 05:09:37 +0000</lastBuildDate><atom:link href="https://blog.yangtheman.com/tags/randomness/index.xml" rel="self" type="application/rss+xml"/><item><title>My answer to text-dynamo</title><link>https://blog.yangtheman.com/2010/02/22/my-naswer-to/</link><pubDate>Tue, 23 Feb 2010 05:09:37 +0000</pubDate><guid>https://blog.yangtheman.com/2010/02/22/my-naswer-to/</guid><description>&lt;p&gt;As an exercise to practice Ruby, you can try to compete a random text generator using an underlying Markov chain model. The codes in the following github account are incomplete. You are supposed to fill in or create methods that will create randomly generated texts given seed texts.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://github.com/eandrejko/text-dynamo" target="_blank" rel="noreferrer"&gt;http://github.com/eandrejko/text-dynamo&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Markov chain is like a state machine, but the key is the what causes state transition only depends on the current state. In this case, how do you determine probability of selecting which word next? It&amp;rsquo;s quite simple. You go through the seed text and count frequency of next words, and that determines the frequency. For example, &amp;ldquo;am&amp;rdquo; is likely to folllow &amp;ldquo;I&amp;rdquo; most frequently. Next might be &amp;ldquo;do&amp;rdquo; or other verbs.&lt;/p&gt;</description></item></channel></rss>