1. ## Find string probabilities

- I have two symbols, one is "long" 1 bit and one is "long" 2 bits. That is X and YY
- The first has probability 2/3 and the second 1/3
- I have a string of these symbols, for example "X YY X X YY YY X X..."

My question: Given a length L, how do I find how many different strings exist of such length? In other words how many different strings I can build such the the length of all its symbols is exactly L

Thanks for the help.  Reply With Quote

2. Seems to be this:
Table[(Fibonacci[L] + LucasL[L])/2, {L, 1, 100}]
or this:
```Table[Total[ Function[x, Binomial[x[] + x[], x[]] ] /@ FrobeniusSolve[{1, 2}, L]], {L, 1, 100}]
(Fibonacci[L-1]+Fibonacci[L]+Fibonacci[L+1])/2
((1+Sqrt)^L*(1+Sqrt+((Sqrt-3)/2)^L*(Sqrt-1)))/Sqrt/2^(L+1)```

Example: L=4
Code:
```1) ----
2) ##--
3) -##-
4) --##
5) ####```  Reply With Quote

3. ## Thanks:

encode (16th September 2018)

4. How did you arrive to Table[(Fibonacci[L] + LucasL[L])/2, {L, 1, 100}] ???  Reply With Quote

5. I only made the "FrobeniusSolve" line, by looking up relevant functions in mathematica help.
Btw, it can be easily modified to compute string probabilities.
Once I had actual values, there's FindSequenceFunction.

Normally its done by building a recurrent function, converting it to generating function, etc.
But I'm too rusty at this stuff.
There's a good book btw - https://en.wikipedia.org/wiki/Concrete_Mathematics  Reply With Quote

probability 