Skip to content

Instantly share code, notes, and snippets.

@crowding
Created April 10, 2014 05:49
Show Gist options
  • Save crowding/10345922 to your computer and use it in GitHub Desktop.
Save crowding/10345922 to your computer and use it in GitHub Desktop.
Draw the logistic map in J, annotated.
'dot;color black' plot (; 50&}.@:((**(1-]))^:(i. 200)&0.25)) 2.4 ([+-~*((%~i.)100)) 4
NB. 100 numbers in [0,1) ^^^^^^^^^
NB. rescaled to ^^^^^
NB. 100 numbers in [2.4,4) ^^^ ^
NB. makes "x", ^^^^^^^^^^^^^^^^^^^^^^^^
NB. ^^^^^^^^^ function y -> y * (1-y)*x
NB. ^^^^^^^^^^ applied 200 times
NB. ^^^^^ starting with y=0.25
NB. ^^^^^^^ then dropping first 50 iterations
NB. ^ put original "x" alongside result
NB.^^^^^^^^^^^^^^^^^^^ and plot points
NB. (%~i.)&100
NB. 2.4 ([+-~*((%~i.)&:100)) 4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment