def LfromS(seq):
	"""
		Compute Schroder function value L from a given sequence.
		This performs the calculation by plodding through the algorithm given in
		the paper.  Humans can easily recognize the relation between elements of S
		and length of runs of 0s or 1s in the binary representation of L. Knowing
		that, there probably is a slicker way to code LfromS().
		
		Args:
			S (list of int):   Sequence - see paper for details
			
		Returns:
			value of L, real in range  0.0 .. 1.0
			
		Note that overflows are no problem - S may contain "large" values like ten.
		Note also there's no check on the length of S, or if it's empty.
	"""
	Lambda = 1.0
	L = Lambda/2
	for c in reversed(seq):
		L = L/(2**c)
		L = Lambda - L
	L = Lambda-L
	return L