Professional Documents
Culture Documents
Assignment Programming 20%
Assignment Programming 20%
Assignment – Programming
Total Marks : 30
Instruction
1. This is a group assignment of MAXIMUM 3 students
2. The registration of group can be done through iTa’leem
3. Only ONE submission is required for each group
4. Submission is done through iTa’leem
Assignment Objectives
1. To demonstrate knowledge of discrete mathematics
2. To enhance programming skills
3. To improve collaboration skills through teamwork
Question (30 marks)
Write a user-friendly well-documented Java program, which solves a recurrence relation and
outputs the properties of the sequence. First, consider the linear recurrence relation of
degree 1: 𝑎𝑛 = 𝑐𝑎𝑛−1, where 𝑛 ≥ 1 and 𝑐, 𝑎0 ∈ ℝ. The initial value 𝑎0 and coefficient 𝑐 are
given by the user input. For each run, the program writes the sequence into a file, so that the
user can plot it and check if the output is valid. Then, apply your program to the recurrence
relation of degree 2: 𝑎𝑛 = 𝑐1 𝑎𝑛−1 + 𝑐2 𝑎𝑛−2 for 𝑛 ≥ 2. What kind of properties are involved
in the degree 1 and degree 2 recurrence relations? Explore it through programming, describe
the process of how you examined, and show typical test cases with plotting.
Up-down: no 3000
0
0 10 20 30 40 50
-6000
0 10 20 30 40 50