Semi-trivial Mathematica Question

  • Thread starter Thread starter MichalXC
  • Start date Start date
  • Tags Tags
    Mathematica
AI Thread Summary
The discussion centers on analyzing a binary list of numbers, specifically how to determine the duration of consecutive sequences of 1s and 0s. The user seeks a method to calculate the lengths of these sequences in a time-ordered list. After exploring options, the user discovers that the "Split" command in Mathematica effectively addresses the problem, allowing for the segmentation of the list into groups of identical values, which can then be used to compute the desired output of consecutive counts.
MichalXC
Messages
39
Reaction score
0
Hi guys,

I have a long list of numbers which has only two values, e.g. {1,1,1,0,0,1,0,1,0,0,0...}.

The list is ordered as a function of time -- chronologically.

I need to see, then, how long the list stays at 1 before going to 0, and then how long the list stays at 0 before going back to 1... etc. etc. until the list terminates.

In my example above, I would expect an output like {3,2,1,1,1,3}.

How can I implement this?

Thanks.
 
Technology news on Phys.org
Woo hoo! Found my answer: the http://reference.wolfram.com/mathematica/ref/Split.html" command.
 
Last edited by a moderator:
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...
Back
Top