Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 344585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:00:15+00:00 2026-05-12T11:00:15+00:00

I just began reading more about Markov Chain Generators today, and am really intrigued

  • 0

I just began reading more about Markov Chain Generators today, and am really intrigued by the whole process of building one. From my understanding, the future state is dependent upon the statistical past states to the present.

Example:

Hello World. Hello Dolly. Hello World.

"World" follows "Hello" ~66% of the time in that source.

If that is always the case, how then do you avoid out-putting the same results each time? The statistical-occurrences won’t change with a static string, so am I right to assume that no variants will every be generated, unless the source-data is modified in some way?

How could I get variations from a static-source, considering the statistical-values, yet allowing some flexibility? Using my example above, how do I allow my generator to follow "Hello" with "Dolly," when "Dolly" only follows "Hello" 33% of the time?

I guess what I’m asking is, How do I base the probability of my next selection on the statistical presence of the words that follow my present selection? That way, "Dolly" shows up 33% of the time, and "World" shows up 66% of the time – or am I completely lost here?

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T11:00:16+00:00Added an answer on May 12, 2026 at 11:00 am

    You use a random number generator to pick which path you go down. You have to save each state (which is really a history of N previous items) and the probabilities for that state. Then you pick a random number and decide based on it what the next state you transition to is.

    In your example you have a Markov chain with an N of 1 you would have a chain structure that looked something like this:

    <start> -> Hello : 1.0
    
    Hello -> World. : 0.66666
    Hello -> Dolly. : 0.33333
    
    Dolly. -> Hello : 1.0
    
    World. -> <end> : 0.5
    World. -> Hello : 0.5
    

    If your current state is Hello, then your next possible states are World. and Dolly.. Generate a random number between 0 and 1 and choose World. if it’s less than 0.666666, otherwise choose Dolly.

    With an N=2 Markov chain, you get almost deterministic behavior with that input:

    <start> <start> -> <start> Hello : 1.0
    
    <start> Hello -> Hello World. : 1.0
    
    Hello World. -> World. Hello : 0.5
    Hello World. -> World. <end> : 0.5
    
    World. Hello -> Hello Dolly. : 1.0
    
    Hello Dolly. -> Dolly. Hello : 1.0
    
    Dolly. Hello -> Hello World. : 1.0
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm reading about the State pattern. I have only just begun, so of course
I just began using Visual Studio to work on a practice .NET project. I
I just began looking into source control.... And installed subversion from collabnet... I also
I just began working on a little twitter-app using tweepy. is there any kind
So, I've just began playing around with the demo of Skeleton, the responsive grid
So just as I began to get a good grasp on MySQL, I found
I'm designing a Monopoly game while also reading up more on OO principles. I
I have just started reading Spring In Action - Third edition and am stuck
just reading up on spring, and when using DI in spring, if you set
I've been reading about TransactionScope and had a question about its interoperability with ADO.Net

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.