Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

USE PYTHON Bob.may.py print(\"The one point iteration that brought chaos into fo

ID: 3673019 • Letter: U

Question

USE PYTHON

Bob.may.py

print("The one point iteration that brought chaos into focus!")

print('Try these values of r: 3, 3.5, 3.544099, 3.56445, 3.568759')

r=float(input('Enter the value of r = '))
N=10000
x=[0 for i in range(0, N)]
x[0]=0.7
index=[0 for i in range(0, N)]

#=============================================
# Main iteration
#=============================================

for n in range(1,N):
index[n]=n
x[n]=r*x[n-1]*(1-x[n-1])

# Let us print the last 100 values
print('The last 4 values are:')
print(x[N-4], ' , ',x[N-3],' , ', x[N-2], ' , ', x[N-1])

#=============================================

# Plotting
import matplotlib.pyplot as plt
plt.plot(index[N-100:N], x[N-100:N])
plt.show()
#=============================================

Explanation / Answer


print("The one point iteration that brought chaos into focus!")
print('Try these values of r: 3, 3.5, 3.544099, 3.56445, 3.568759')
r=float(input('Enter the value of r = '))
N=10000
x=[0 for i in range(0, N)]
x[0]=0.7
index=[0 for i in range(0, N)]
#=============================================
# Main iteration
#=============================================
for n in range(1,N):
index[n]=n
x[n]=r*x[n-1]*(1-x[n-1])
# Let us print the last 100 values
print('The last 4 values are:')
print(x[N-4], ' , ',x[N-3],' , ', x[N-2], ' , ', x[N-1])
continue
#=============================================
# Plotting
import matplotlib.pyplot as plt
plt.plot(index[N-100:N], x[N-100:N])
plt.show()
#=============================================