MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

Searching for embedded zeros in list

  • To: mathgroup at
  • Subject: [mg32136] Searching for embedded zeros in list
  • From: "Coleman, Mark" <mark.coleman at>
  • Date: Sat, 29 Dec 2001 00:46:57 -0500 (EST)
  • Sender: owner-wri-mathgroup at


Can anyone suggest an efficient/elegant way of checking a list for
'embedded' zeros. By embedded I mean the occurence of one or more zeros
between two non-zero elements (note: zeros at the ends of the list are
not relevant). For instance, the following lists all contain embedded


while this list does not d={0.0,0.90,0.75,0.42,0.25,0.0}

By way of background, I am working on a problem involving estimating
generators for Markov transition matrices. One condition that ensures
that a generator *does not* exist is the presence of inaccessible states
in any row of the matrix. Thus one need only find a single occurance of
an inaccessible state to show that a generator does not exist. Hence the
code need only locate one such state, not all of them.

The Mathematica code I've written for this problem does work, but it is hardly

Any help would be much appreciated!

Best regards,


  • Prev by Date: Is this the usual method...?
  • Next by Date: 3dplots again
  • Previous by thread: Is this the usual method...?
  • Next by thread: Re: Searching for embedded zeros in list