Skip to main content

Questions tagged [markov-chain]

A stochastic model describing a sequence of possible events in which the probability of each event depends only on the state attained in the previous event.

6 votes
2 answers
207 views

This is a Markov chain generator. It reads a file, reads all triples of words, and creates the Markov model. The model it makes is weighted, by which I mean that if "word1 word2 word3" ...
davidlowryduda's user avatar
2 votes
1 answer
186 views

Introduction A first order HMM (hidden Markov model) is a tuple \$(H, \Sigma, T, E, \mathbb{P})\$, where \$H = \{1, \ldots, \vert H \vert\}\$ is the set of hidden states, \$\Sigma\$ is the set of ...
coderodde's user avatar
  • 32.3k
5 votes
1 answer
286 views

The problem The partition function for the quantum harmonic oscillator can be written in the path integral formulation as $$Z\propto\int Dx(\tau)\exp\left(-\frac{S_E}{\hbar}\right)=\int Dx(\tau)\exp\...
My Code is a Flying Circus's user avatar
1 vote
1 answer
321 views

Is there any improvement that can be made to the following code, written to simulate the harmonic oscillator in the path integral formulation with Monte Carlo methods? ...
My Code is a Flying Circus's user avatar
2 votes
0 answers
340 views

This is a Python 3 module that generates random pronounceable word-like strings based on Markov Chains. It has many modes, each mode conforms to the structures of dictionary words to a degree, the two ...
Ξένη Γήινος's user avatar
3 votes
0 answers
92 views

I play a lot of old-school western CRPGs, and most of them (if not all) require the player to generate an avatar at the start of a new game, including naming the character (with names that will never ...
Ξένη Γήινος's user avatar
2 votes
2 answers
370 views

This is my first non-trivial program in my Python. I am coming from a Java background and I might have messed up or ignored some conventions. I would like to hear feedback on my code. ...
BovineScatologist's user avatar
4 votes
1 answer
640 views

So I have a file(story.dat) with a randomly generated story like: "Sleeping in his car was never the plan but sometimes things don't work out as planned. This..." It will print out each word ...
GigaHiga's user avatar
15 votes
5 answers
4k views

I wrote a Markov-chain based sentence generator as my first non-trivial Python program. I mainly used C before, so I probably have ignored a lot of Python conventions and features, so any advice would ...
Hashew's user avatar
  • 211
3 votes
2 answers
192 views

Background I've come across a puzzle (Problem 10 from this list of sample interview questions): One day, an alien comes to Earth. Every day, each alien does one of four things, each with equal ...
Motun's user avatar
  • 133
16 votes
1 answer
451 views

I have spent about more than a year in python, but I come from biology background. I should say I have got some understanding of for-loop and nested-for-loop to workout the solution to the problem I ...
everestial's user avatar
6 votes
1 answer
220 views

I'm no ace when it comes to mathematical problems, so I've decided to go over some old college coursework and put it to code. The function works just fine and the returned values are spot on, but I'm ...
Luke's user avatar
  • 1,120
6 votes
1 answer
4k views

I have a Hidden Markov model class with basically a single method: getting the best parse of a sequence of input tokens based on Viterbi. While I have no hardcore benchmarks, I'd love some pointers ...
erip's user avatar
  • 926
6 votes
1 answer
218 views

What follows in an attempt at implementing Mark V. Shaney using contemporary Python. One question has already been asked while working on a generator in the code, but included here is the entire ...
Noctis Skytower's user avatar
39 votes
2 answers
5k views

I wrote a country name generator in Python 3.5. My goal was to get randomized names that would look as much like real-world names as possible. Each name needed to have a noun and an adjective form (e....
DLosc's user avatar
  • 495

15 30 50 per page