How to resolve the algorithm Fibonacci word step by step in the J programming language

Published on 12 May 2024 09:40 PM
#J

How to resolve the algorithm Fibonacci word step by step in the J programming language

Table of Contents

Problem Statement

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

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:

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Fibonacci word step by step in the J programming language

Source code in the j programming language

F_Words=: (,<@;@:{~&_1 _2)@]^:(2-~[)&('1';'0')


entropy=:  +/@:-@(* 2&^.)@(#/.~ % #)


   (,.~#\)(#,entropy)@> F_Words 37
 1         1        0
 2         1        0
 3         2        1
 4         3 0.918296
 5         5 0.970951
 6         8 0.954434
 7        13 0.961237
 8        21 0.958712
 9        34 0.959687
10        55 0.959316
11        89 0.959458
12       144 0.959404
13       233 0.959424
14       377 0.959417
15       610  0.95942
16       987 0.959418
17      1597 0.959419
18      2584 0.959419
19      4181 0.959419
20      6765 0.959419
21     10946 0.959419
22     17711 0.959419
23     28657 0.959419
24     46368 0.959419
25     75025 0.959419
26    121393 0.959419
27    196418 0.959419
28    317811 0.959419
29    514229 0.959419
30    832040 0.959419
31 1.34627e6 0.959419
32 2.17831e6 0.959419
33 3.52458e6 0.959419
34 5.70289e6 0.959419
35 9.22747e6 0.959419
36 1.49304e7 0.959419
37 2.41578e7 0.959419


  

You may also check:How to resolve the algorithm 15 puzzle game step by step in the AutoHotkey programming language
You may also check:How to resolve the algorithm Matrix transposition step by step in the Maple programming language
You may also check:How to resolve the algorithm Bitmap step by step in the MAXScript programming language
You may also check:How to resolve the algorithm Composite numbers k with no single digit factors whose factors are all substrings of k step by step in the Perl programming language
You may also check:How to resolve the algorithm Damm algorithm step by step in the Groovy programming language