string length question

From: NKProductionZ (nkproductionz_at_aol.com)
Date: 09/21/04


Date: 21 Sep 2004 04:32:45 GMT

We have that string A can go into one of two forms
either A --> BC and terminates or A --> ADA and D is terminal, but each of
those A's can break up into either BC or ADA.

what is the expected length of string A?

the standard approach which i took fails, since i said let a be the expected
length.
in this case the answer would be the solution of a = .5*2 + .5(2a + 1) but this
leads to 3/2 = 0.

any help would be appreciated.

thanks in advance



Relevant Pages

  • Re: The future of Ada is at risk
    ... working under Mac OS X. ... People should have the opportunity to "give Ada a spin" free of charge, ... I don't see how simple but powerful string handling ... I think that the default string type should be the unbounded string, ...
    (comp.lang.ada)
  • Re: How come Ada isnt more popular?
    ... Ada programming -- http://www.mysunrise.ch/users/gdm/gsoft.htm ... Perhaps if the central string were a number? ... But when I compare a book on expert systems written in C and one written in Ada (well, Ada83), the book in Ada is both thicker and has more pages devoted to code than the book in C, and the expert systems are approximately of equivalent power. ...
    (comp.lang.ada)
  • Re: Teaching new tricks to an old dog (C++ -->Ada)
    ... In Ada I could use Ada.Strings.Bounded_Strings ... not at all convinced that two separate string classes are necessary to ... allocator that only ever allocates a block of the initially-specified ... And thead save means that an exception may be ...
    (comp.lang.ada)
  • Re: Interpretation of extensions different from Unix/Linux?
    ... the use of UTF-8 in this way is the recommendation of the ARG. ... (UTF-8 is a problem of its own in Ada. ... a UTF-8 encoded string is a String. ... You can't enumerate roots in Windows, ...
    (comp.lang.ada)
  • Re: Data table text I/O package?
    ... > And if you don't know what you are analyzing for, Ada is hardly the ... > programming language to be using. ... there isn't a way to search for an unbounded string in another ... > unbounded string. ...
    (comp.lang.ada)