AMC Sample Exam MS
AMC Sample Exam MS
Marking Scheme
Answer ALL questions.
Time: 3 hours
Marks
Question 1
You are tasked with developing a software application for a small business to manage
their inventory. The application needs to track product quantities, update inventory
levels, and generate reports.
i) Analysis
ii) Design
iii) Implementation
iv) Testing
Mark scheme
i) Analysis (1 mark)
Mark scheme
Page 2 of 23
Algorithms and Mathematical Concepts © NCC Education Limited 2024
Mark scheme
Answer:
Criteria:
• Function and End Function keywords (1 mark)
• Parameters (1 mark)
• Step 1: Create a new product record (1 mark)
• Step 2: Add the product record to the inventory data (1 mark)
Mark scheme
Criteria:
• Abstraction and decomposition involve breaking down a complex
problem into smaller, more manageable parts (1 mark)
• Abstraction allows us to focus on high-level concepts without getting
bogged down in implementation details (1 mark)
• Decomposition breaks a problem into smaller, more manageable sub
problems (1 mark)
• Abstraction and decomposition are essential for managing complexity,
improving maintainability, and facilitating collaboration (1 mark)
Total 10 Marks
Page 3 of 23
Algorithms and Mathematical Concept © NCC Education Limited 2024
Question 2
i) Whole number
ii) Rational number
iii) Relation number
iv) Prime number
Mark scheme
Mark scheme
binary (1 mark)
c) Explain the difference between a prime number and a composite number. Provide 2
examples of each.
Mark scheme
Page 4 of 23
Algorithms and Mathematical Concept © NCC Education Limited 2024
d) Conversion between Binary, Octal, and Decimal 6
Mark scheme:
i) (001) (101)
001=1
101=5
Answer: 15 (1 mark for correct answer, 1 mark for working)
ii) 3 =011
7 =111
--------------------
011 111
Answer: 11 111(1 mark for correct answer, 1 mark for working)
iii) 25/8 = 3, remainder is 1
3/8 = 0, remainder is 3
Read from bottom to top as 31
Answer= 31 (1 mark for correct answer, 1 mark for working)
Total 10 Marks
Page 5 of 23
Algorithms and Mathematical Concept © NCC Education Limited 2024
Question 3
Mark scheme
Answer: iii) | (1 mark)
(P∧Q)∨(¬P)
P Q ¬P P∧Q (P∧Q)∨(¬P)
T T
T F
F T
F F
Mark scheme
The biconditional operator (↔) evaluates to true if both operands are the
same, either both true or both false. For example, A ↔ B is true if A and B
are both true or both false.
Criteria:
• both operands are the same (1 Mark)
• either both true or both false (1 Mark)
• For example, A ↔ B is true if A and B are both true or both false (1
Mark)
Total 10 Marks
Page 6 of 23
Algorithms and Mathematical Concept © NCC Education Limited 2024
Question 4
Answer the following questions related to Predicate Logic, Set Theory, and Venn
Diagrams:
• ∀
• ∃
• ∧
• ∨
Mark scheme
Mark scheme
Mark scheme
{3, 4} (1 mark)
d) What is the Cartesian product of two sets, and how is it represented? Calculate 4
the Cartesian product of the following sets: A = {1, 2, 3} B = {a, b}
Page 7 of 23
Algorithms and Mathematical Concept © NCC Education Limited 2024
Mark scheme
The Cartesian product of two sets A and B is the set of all possible ordered
pairs where the first element comes from set A and the second element
comes from set B.
The Cartesian product of sets A and B is: A × B = {(1, a), (1, b), (2, a), (2, b),
(3, a), (3, b)}
Criteria:
• The Cartesian product of two sets A and B is the set of all possible
ordered pairs (1 mark)
• where the first element comes from set A and the second element
comes from set B. (1 mark)
• The Cartesian product of sets A and B is: A × B = {(1, a), (1, b), (2, a),
(2, b), (3, a), (3, b)} (2 marks)
A ∪ B = {a, b, c, d, e} (2 marks)
Deduct mark if duplication of element c.
Total 10 Marks
Page 8 of 23
Algorithms and Mathematical Concept © NCC Education Limited 2024
Question 5
i) Standard deviation
ii) Range
iii) Mean
iv) Variance
Mark scheme
ii) Mean (1 mark)
b) The measure of dispersion shows the ________ of data around the central value. 1
Mark scheme
spread (1 mark)
c) Calculate the mean of the following data set: 10, 15, 20, 25, 30. Show your 3
working.
Mark scheme
Criteria:
• 2 marks for showing the steps
• 1 mark for final result
Page 9 of 23
Algorithms and Mathematical Concept © NCC Education Limited 2024
d) Explain the concept of range as a measure of dispersion and provide an 2
example.
Mark scheme
e) Calculate the median of the following data set: 15, 27, 18, 21,12, 24, Show your 3
working.
Mark scheme
Since the number of data points is even, the median is the average of the
two middle values:
Criteria:
• 2 marks for showing the steps
• 1 mark for final result
Total 10 Marks
Page 10 of 23
Algorithms and Mathematical Concept © NCC Education Limited 2024
Question 6
Mark scheme
b) An array is a ________ data structure that stores elements of the same data 1
type.
Mark scheme
linear (1 mark)
c) Write Pseudocode to find the sum of all elements in a 1-dimensional array. You 5
should assume the existence of a function called length(arr) which returns the
number of elements in the array arr.
Mark scheme
Page 11 of 23
Algorithms and Mathematical Concept © NCC Education Limited 2024
d) Explain the concept of a singly linked list and describe one advantage it offers 3
over arrays in terms of memory allocation.
Mark scheme
Total 10 Marks
Page 12 of 23
Algorithms and Mathematical Concept © NCC Education Limited 2024
Question 7
i) Stack
ii) Queue
iii) Linked List
iv) Array
Mark scheme
i) Stack (1 mark)
b) In a queue, elements are removed from the ________ and added to the 2
________.
Mark scheme
c) Consider a queue which is initially empty. Perform the following operations on the 3
queue, showing the queue after each operation:
What is the sum of the remaining elements in the queue after these operations?
Mark scheme
Page 13 of 23
Algorithms and Mathematical Concept © NCC Education Limited 2024
d) Provide a real-world example where a stack and a queue data structure would be 4
appropriately used.
Mark scheme
Total 10 Marks
Page 14 of 23
Algorithms and Mathematical Concept © NCC Education Limited 2024
Question 8
Answer the following questions related to algorithm efficiency and searching techniques:
Mark scheme
Mark scheme
O(n) (1 mark)
Page 15 of 23
Algorithms and Mathematical Concept © NCC Education Limited 2024
c) Write pseudocode for a function for a binary search algorithm that searches for a 6
target value in a sorted 1-dimensional array. The function takes the target value
and array as parameters. You should assume the existence of a function called
length(arr) which returns the number of elements in the array arr.
Mark scheme
Criteria:
• 1 mark for function keyword and parameters
• 1 mark for defining low and high
• 1 mark for correct while loop
• 1 mark for mid calculation
• 1 mark for correct if, elseif and else statement
• 1 mark for correct if, elseif and else content
Mark scheme
• The binary search algorithm has a time complexity of O(log n), which is
significantly better than the linear search algorithm's time complexity of
O(n). (1 mark)
• This means that binary search can efficiently search large arrays in
logarithmic time, making it much faster than linear search for sorted
arrays. (1 mark)
Total 10 Marks
Page 16 of 23
Algorithms and Mathematical Concept © NCC Education Limited 2024
Question 9
i) Bubble Sort
ii) Quick Sort
iii) Merge Sort
iv) Insertion Sort
Mark scheme
Mark scheme
termination (1 mark)
c) Write pseudocode for a function that uses the Bubble Sort algorithm. You should 6
assume the existence of a function called length(arr) which returns the number
of elements in the array arr.
Page 17 of 23
Algorithms and Mathematical Concept © NCC Education Limited 2024
Mark scheme
function bubbleSort(array)
n = length(array)
for i from 0 to n-1
for j from 0 to n-i-1
if array[j] > array[j+1]
temp= array[j]
array[j]= array[j+1]
array[j+1] = temp
end for
end for
return array
End function
Criteria:
• 1 mark for function keyword and parameter
• 1 mark for defining n
• 1 mark for the first for loop
• 1 mark for the nested for loop
• 1 mark for correct if statement and condition
• 1 mark for swapping array elements
Mark scheme
Total 10 Marks
Page 18 of 23
Algorithms and Mathematical Concept © NCC Education Limited 2024
Question 10
Mark scheme
b) A binary tree is a tree data structure in which each node has at most __________ 1
children.
Mark scheme
c) Construct a binary search tree from the following sequence of numbers: 10, 5, 4
15, 3, 7, 12, 20.
Mark scheme
10 (1 mark)
/ \
5 15 (1 mark)
/\ / \
3 7 12 20 (2 marks)
Page 19 of 23
Algorithms and Mathematical Concept © NCC Education Limited 2024
d) Using the provided binary search tree (BST) below, demonstrate the steps 4
involved in searching for the value 16. Begin the search at the root node and
describe each comparison and movement until the value is found or determined
to be absent.
15
/ \
10 20
/\ /\
5 12 17 25
/ \ / \
3 7 16 30
Mark scheme
• To search for the value 16 in the provided binary search tree (BST), we
start at the root node, which contains the value 15. Since 16 is greater
than 15, we move to the right subtree. (1 mark)
• Next, we compare 16 with the value at the current node, which is 20.
Since 16 is less than 20, we move to the left subtree of the current node.
(1 mark)
• In the left subtree, we encounter the node with the value 17. Since 16 is
less than 17, we move to the left subtree again. (1 mark)
• Finally, we arrive at the node with the value 16, which is the target value
we are searching for. Therefore, the search for the value 16 is
successful in the provided BST. (1 mark)
Total 10 Marks
End of paper
Page 20 of 23
Algorithms and Mathematical Concept © NCC Education Limited 2024
Learning Outcomes matrix
Page 21 of 23
Algorithms and Mathematical Concept © NCC Education Limited 2024
Grade descriptors.
Page 23 of 23
Algorithms and Mathematical Concept © NCC Education Limited 2024