# Friday Q&A 2018-04-27: Generating Text With Markov Chains in Swift

DevFeed: [Friday Q&A 2018-04-27: Generating Text With Markov Chains in Swift](<https://devfeed.tech/articles/friday-q-a-2018-04-27-generating-text-with-markov-chains-in-swift-30627.md>)

Original publisher: [Read original article](<http://www.mikeash.com/pyblog/friday-qa-2018-04-27-generating-text-with-markov-chains-in-swift.html>)

Author: Mike Ash

Published: 2018-04-28T01:27:00Z

Content type: tutorial

Language: en

Sources: [Mike Ash](<https://devfeed.tech/sources/mike-ash.md>)

Topics: [Swift](<https://devfeed.tech/topics/swift.md>), [text-generation](<https://devfeed.tech/topics/text-generation.md>)

Tags: [build](<https://devfeed.tech/tags/build.md>), [swift](<https://devfeed.tech/tags/swift.md>), [text-generation](<https://devfeed.tech/tags/text-generation.md>)

## AI overview

This tutorial explains Markov chains and uses Swift to build a text generator from the blog's contents. It describes probabilistic state transitions, data representation, and tradeoffs between simple and more efficient ways to choose transitions.

## Source excerpt

Markov chains make for a simple way to generate realistic looking but nonsensical text. Today, I'm going to use that technique to build a text generator based on this blog's contents, an idea suggested/inspired by reader Jordan Pittman. (Read More)