0% found this document useful (0 votes)
32 views5 pages

As para Ut d1 U1 Test

Uploaded by

zahra.jamil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views5 pages

As para Ut d1 U1 Test

Uploaded by

zahra.jamil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Decision Mathematics 1 Unit Test 1: Algorithms and graph theory

1 a Define the term algorithm. (1 mark)


b Give an example of an algorithm used in everyday life. (1 mark)
c Explain the meaning of shapes A and B in Figure 1, when used in a flow chart. (2 marks)

Figure 1

2 An algorithm is described by the flow chart in Figure 2.


Figure 2

© Pearson Education Ltd 2018. Copying permitted for purchasing institution only. This material is not copyright free.
1
Decision Mathematics 1 Unit Test 1: Algorithms and graph theory

a Complete the table, recording the results of each step as the algorithm is applied.
You may not need all of the rows.
Give the values of A, B, C and D to 3 decimal places and the values of E to 1
significant figure. (3 marks)

A B n C D E is n > 3?

b If the restriction of n > 3 is changed to n > 100, state the value of E when
n = 100. (1 mark)

© Pearson Education Ltd 2018. Copying permitted for purchasing institution only. This material is not copyright free.
2
Decision Mathematics 1 Unit Test 1: Algorithms and graph theory

3 The algorithm below finds the approximate square root of a number.


1 Input a number, N
N
2 Calculate S =
2
N +S
3 Calculate T = S
2
4 If S = T when rounded to 2 decimal places, go to 7
5 Replace S with the value of T
6 Go to 3
7 Output S to 2 decimal places

a Apply the algorithm with N = 7.


Complete the table, recording the values of S and T each time they change. (3 marks)

S T S = T to 2 dp?

b Show that the algorithm fails when N = −4.


Give a reason for this failure. (3 marks)

4 The list of numbers below is to be sorted into descending order.

7 5 4 6 8

a Perform the first pass of a bubble sort, showing each comparison. (2 marks)
b Write the number of comparisons and the number of swaps used in this first
pass. (1 mark)
c State which numbers, if any, are guaranteed to be in their correct final position
after the first pass. (1 mark)

© Pearson Education Ltd 2018. Copying permitted for purchasing institution only. This material is not copyright free.
3
Decision Mathematics 1 Unit Test 1: Algorithms and graph theory

5 Use a quick sort to arrange the numbers below into ascending order.

65 43 24 64 46 13 71 23 16 45

(4 marks)

6 Look at Figure 3.

Figure 3

a Explain why UXYZWVYU is not a cycle of the graph in Figure 3. (1 mark)


b Explain why there would be 5 arcs in a spanning tree of the graph in Figure 3. (1 mark)
c Show that the sum of the valencies of the vertices of the graph in Figure 3 is
equal to twice the number of edges. (2 marks)
d Determine whether the network UXYZWVYU is Eulerian. (1 mark)

© Pearson Education Ltd 2018. Copying permitted for purchasing institution only. This material is not copyright free.
4
Decision Mathematics 1 Unit Test 1: Algorithms and graph theory

7 Look at Figure 5.

Figure 5

a Use an adjacency matrix to represent the graph in Figure 5. (2 marks)

A network is defined by the distance matrix below.

A B C D E

A – 6 – 7 –

B 6 – 4 – 12

C – 4 – 5 –

D – – 5 – –

E – 10 – – –

b Draw the network. (2 marks)

8 Below are the lengths of seven pieces of wood to be cut from 1.25 m strips.
All lengths are given in cm.

40 55 65 40 40 45 40 45 70 40 45

a Use the first-fit decreasing algorithm to calculate how many 1.25 m strips are
required and how much wood will be wasted. (4 marks)
b i Use the full-bin algorithm to calculate how many 1.25 m strips are required. (2 marks)
ii State if your solution for part bi is optimal. Justify your answer. (2 marks)

© Pearson Education Ltd 2018. Copying permitted for purchasing institution only. This material is not copyright free.
5

You might also like