[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

HELP!! with Scheme programming


I'm learning scheme and stuck on a problem.  Please help,

H(sub a) = h  h
                 h  h a

Hope you understand what i try to say,

anyway the problem is

Imagine an area populated only by wolves and caribou.  We want to
predict what will happen to their populations over several years.
According to the simpliifed Predator-Prey model w(sub n+1) and c(sub
n+1), the populations of wolves and caribou in year n+1, can be
determined from the populations in year n by the following equations:

c(sub n+1)  =  A c(sub n)  -  B c(sub n) w(sub n)
w(sub n+1) =  C w(sub n)  + D c(sub n) w(sub n)

where A= 1.1, B = 0.01, C = 0.9, and D = 0.02 

Write two programs (using state variables wolves, caribou, n, and k)
which runs the wolves-caribou model for n years and outputs its
results every k years.  One program in recursion and the other in

Sample output for checking,

in this problem, we start with 10 wolves and 10 caribou and obtain
after 2 years, printing every year, the output:

(population 10 10 2 1)
11.0 10.0
12.1 9.9

Thank you, please post or email me your answer

Thank again,