Skip to content

Commit 7e74f81

Browse files
committed
A simple program illustrating chaotic behaviour
This program also demonstrates the apparent unpredictability of chaos functions and how small initial differences can lead to large differences as the formulae is repeatedly applied.
1 parent 6311956 commit 7e74f81

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

chaos.py

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# A simple program illustrating chaotic behaviour
2+
3+
def main():
4+
print ("This program illustrates a chaotic function")
5+
x = float((input("Enter a number between 0 and 1: ")))
6+
for i in range(10):
7+
x = 3.9 * x * (1-x)
8+
print (x)
9+
10+
main()
11+

0 commit comments

Comments
 (0)