Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Counting no. of times state chosen in markov ch...' topicStudent Support Forum > General > Archives > "Counting no. of times state chosen in markov ch..."

< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic
Author Comment/Response
Bill Simpson
01/22/13 10:06pm

If you can get your Markov data into a list then perhaps you can use this:

In[1]:= markovdata={2,1,1,1,3,2,1,2,2,3};
Map[{First[#],Length[#]}&,Split[Sort[markovdata]]]

Out[2]= {{1,4},{2,4},{3,2}}

That shows that
1 appeared 4 times
2 appeared 4 times
3 appeared 2 times

URL: ,

Subject (listing for 'Counting no. of times state chosen in markov ch...')
Author Date Posted
Counting no. of times state chosen in markov ch... Antonio Fern... 01/22/13 09:41am
Re: Counting no. of times state chosen in marko... Bill Simpson 01/22/13 10:06pm
Re: Re: Counting no. of times state chosen in m... Antonio Fern... 01/24/13 06:25am
Re: Counting no. of times state chosen in marko... yehuda 01/24/13 2:55pm
< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic