The   Fibonacci Word   may be created in a manner analogous to the   Fibonacci Sequence   as described here:

    Define   F_Word1   as   1
    Define   F_Word2   as   0
    Form     F_Word3   as   F_Word2     concatenated with   F_Word1    i.e.:   01
    Form     F_Wordn   as   F_Wordn-1   concatenated with   F_wordn-2



Task

Perform the above steps for     n = 37.

You may display the first few but not the larger values of   n.

{Doing so will get the task's author into trouble with them what be (again!).} 

Instead, create a table for   F_Words   1   to   37   which shows:

   The number of characters in the word
   The word's Entropy


Related tasks
 
   Fibonacci word/fractal
   Entropy
   Entropy/Narcissist


exec('.\entropy.sci',0);
 
function word=fiboword(n)
    word_1 = '1'; word_2 = '0';
    select n
    case 1
        word = word_1
    case 2
        word = word_2;
    case 3
        word = strcat([word_2 word_1]);
    else
        word = strcat([fiboword(n-1) fiboword(n-2)])
    end
endfunction
 
final_length = 37;
 
N=[1:final_length]';
char_length = zeros(N);
entropies = zeros(N);
tic();
for i=1:final_length
    word = fiboword(i);
    char_length(i) = length(word);
    entropies(i) = entropy(word);
end
time = toc();
 
disp('EXECUTION TIME: '+string(time)+'s.');
disp(['N', 'LENGTH', 'ENTROPY'; string([N char_length entropies])]);