Comments on: Centennial of Markov Chains http://blog.wolfram.com/2013/02/04/centennial-of-markov-chains/ News, views, and ideas from the front lines at Wolfram Research. Tue, 20 Feb 2018 16:00:00 +0000 hourly 1 http://wordpress.org/?v=3.2.1 By: Alex W http://blog.wolfram.com/2013/02/04/centennial-of-markov-chains/comment-page-1/#comment-27312 Alex W Thu, 04 Apr 2013 22:25:45 +0000 http://blog.internal.wolfram.com/?p=13258#comment-27312 Also, I am using version 8. Also, I am using version 8.

]]>
By: Alex W http://blog.wolfram.com/2013/02/04/centennial-of-markov-chains/comment-page-1/#comment-27311 Alex W Thu, 04 Apr 2013 22:23:35 +0000 http://blog.internal.wolfram.com/?p=13258#comment-27311 I have written In[2] and In[3] into my notebook and hit shift enter. instead of seeing Out[3] I am getting an error message. StringSplit::strse: String or list of strings expected at position 1 in StringSplit[ExamplData[{ } , AliceInWonderland Text],RegularExpression[[\W_]+]]. >> Can somebody let me know what I'm doing wrong. Thanks. I have written In[2] and In[3] into my notebook and hit shift enter. instead of seeing Out[3] I am getting an error message.
StringSplit::strse: String or list of strings expected at position 1 in StringSplit[ExamplData[{ } , AliceInWonderland Text],RegularExpression[[\W_]+]]. >>

Can somebody let me know what I’m doing wrong. Thanks.

]]>
By: Michael Stern http://blog.wolfram.com/2013/02/04/centennial-of-markov-chains/comment-page-1/#comment-26146 Michael Stern Fri, 15 Feb 2013 17:09:26 +0000 http://blog.internal.wolfram.com/?p=13258#comment-26146 I will admit, the very first thing I did with Mathematica 9 was test out the new Markov process capabilities with analysis of, then random generation of stylistic matches for, the songs of Bob Dylan and Shakespeare's sonnets. I will admit, the very first thing I did with Mathematica 9 was test out the new Markov process capabilities with analysis of, then random generation of stylistic matches for, the songs of Bob Dylan and Shakespeare’s sonnets.

]]>
By: Brian Beckman http://blog.wolfram.com/2013/02/04/centennial-of-markov-chains/comment-page-1/#comment-26113 Brian Beckman Sun, 10 Feb 2013 15:43:11 +0000 http://blog.internal.wolfram.com/?p=13258#comment-26113 By the way, I just wanted to say that this is a magnificent blog. I had done a similar treatment some time ago, building the text-generating random process by hand (coincidentally using Alice as my source :). It's much shorter and clearer (and probably faster) using the new built-ins! By the way, I just wanted to say that this is a magnificent blog. I had done a similar treatment some time ago, building the text-generating random process by hand (coincidentally using Alice as my source :). It’s much shorter and clearer (and probably faster) using the new built-ins!

]]>
By: Brian Beckman http://blog.wolfram.com/2013/02/04/centennial-of-markov-chains/comment-page-1/#comment-26112 Brian Beckman Sun, 10 Feb 2013 15:15:59 +0000 http://blog.internal.wolfram.com/?p=13258#comment-26112 Thanks! That clears that up! I noticed a little later, in the word analysis, via SortBy[gram4data, #[[2]] &] // Take[#, 30] &, that some punctuation was left in. For instance, from position 19 down, some 4-grams are as follows: {"said", "the", "king", "when"} -> 0.0769231, {"said", "the", "king", "you"} -> 0.0769231, {"i", "don", "t", "care"} -> 0.111111, {"i", "don", "t", "keep"} -> 0.111111, creating some "false" words like "don". A tweaked rule like the following gets rid of apostrophes: Short[ AiWwords = ToLowerCase[ StringSplit[ StringReplace[ ExampleData[{"Text", "AliceInWonderland"}], "'" -> ""], RegularExpression["[\\W_]+"]]]] Thanks! That clears that up!

I noticed a little later, in the word analysis, via SortBy[gram4data, #[[2]] &] // Take[#, 30] &, that some punctuation was left in. For instance, from position 19 down, some 4-grams are as follows:
{“said”, “the”, “king”, “when”} -> 0.0769231,
{“said”, “the”, “king”, “you”} -> 0.0769231,
{“i”, “don”, “t”, “care”} -> 0.111111,
{“i”, “don”, “t”, “keep”} -> 0.111111,
creating some “false” words like “don”. A tweaked rule like the following gets rid of apostrophes:
Short[
AiWwords =
ToLowerCase[
StringSplit[
StringReplace[
ExampleData[{"Text", "AliceInWonderland"}],
“‘” -> “”],
RegularExpression["[\\W_]+”]]]]

]]>
By: Oleksandr Pavlyk http://blog.wolfram.com/2013/02/04/centennial-of-markov-chains/comment-page-1/#comment-26111 Oleksandr Pavlyk Sun, 10 Feb 2013 14:32:35 +0000 http://blog.internal.wolfram.com/?p=13258#comment-26111 The presence of "" in the test is not needed, as you correctly pointed out. Length[vcseq] is equal to Length[AiWletters]. The numbers displayed in the elated form of Out[4] and Out[6] indicate the number of terms hidden. In Out[4] 20 characters are showing, with 39,227 hidden, and in Out[6] 8 labels are showing with 29,239 hidden. Total number of elements are equal. The presence of “” in the test is not needed, as you correctly pointed out. Length[vcseq] is equal to Length[AiWletters]. The numbers displayed in the elated form of Out[4] and Out[6] indicate the number of terms hidden. In Out[4] 20 characters are showing, with 39,227 hidden, and in Out[6] 8 labels are showing with 29,239 hidden. Total number of elements are equal.

]]>
By: Brian Beckman http://blog.wolfram.com/2013/02/04/centennial-of-markov-chains/comment-page-1/#comment-26110 Brian Beckman Sun, 10 Feb 2013 14:20:09 +0000 http://blog.internal.wolfram.com/?p=13258#comment-26110 Curious why In[5] has an optional pattern for an empty string (my test of Select[AiLetters, #===""&] turned up no instances, and also curious why Length[Out[6]] is different from Length[Out[4]] (i.o.w., why there should be a different number of "vowel" / "consonant" labels than input characters). The differences are not statistically significant, but I haven't been able to track down the stragglers. Curious why In[5] has an optional pattern for an empty string (my test of Select[AiLetters, #===""&] turned up no instances, and also curious why Length[Out[6]] is different from Length[Out[4]] (i.o.w., why there should be a different number of “vowel” / “consonant” labels than input characters). The differences are not statistically significant, but I haven’t been able to track down the stragglers.

]]>
By: John Barton http://blog.wolfram.com/2013/02/04/centennial-of-markov-chains/comment-page-1/#comment-26086 John Barton Wed, 06 Feb 2013 16:33:09 +0000 http://blog.internal.wolfram.com/?p=13258#comment-26086 Brilliant! I am compelled to try this myself. Thank goodness I have Mathematica to help. I'm curious how far Wolfram Alfa will go on this endeavor. Brilliant!
I am compelled to try this myself. Thank goodness I have Mathematica to help. I’m curious how far Wolfram Alfa will go on this endeavor.

]]>
By: Alex Isakov http://blog.wolfram.com/2013/02/04/centennial-of-markov-chains/comment-page-1/#comment-25798 Alex Isakov Tue, 05 Feb 2013 07:29:23 +0000 http://blog.internal.wolfram.com/?p=13258#comment-25798 Nice, though it would be harder to replicate Markov's results with original Pushkin's text as Mathematca isn't able to ToLowerCase Cyrillic strings (except with Shifrin's java workaround). Nice, though it would be harder to replicate Markov’s results with original Pushkin’s text as Mathematca isn’t able to ToLowerCase Cyrillic strings (except with Shifrin’s java workaround).

]]>
By: Tony Gualtieri http://blog.wolfram.com/2013/02/04/centennial-of-markov-chains/comment-page-1/#comment-25789 Tony Gualtieri Mon, 04 Feb 2013 23:04:11 +0000 http://blog.internal.wolfram.com/?p=13258#comment-25789 Beautiful demonstration, thanks. Beautiful demonstration, thanks.

]]>