Mathematical Algorithms and Methods Flashcards

1
Q

Define clearly the terms perfect number, abundant number, semiperfect number and weird number

A
Perfect = sum of **proper** divisors equals the number
Abundant = sum of **proper** divisors in greater than the number
Semiperfect = the sum of **some** of the **proper** divisors equals the number
Weird = abundant but not semiperfect
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

State the Fundamental Theorem of Arithmetic. Illustrate with an example of your choosing

A

A positive integer can be factorised as a product of primes in a unique way.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

State and give the general solution to the Diophantine equation
753x + 135y = 6

A

A solution of an ordinary differential equation of order n that involves exactly n essential arbitrary constants.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Why does the similar Diophantine equation 753x + 135y = 5 not have a solution

A

5 is not a multiple of the gcd 3

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

State and convert the decimal 121 into each of the bases binary, hexadecimal and base 7, show your working.

A

Binary: Is a system of numbers based on two symbols 0 and 1.

Hexadecimal: Is a system of numbers based on sixteen symbols. 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F.

Base 7: is a system that has 7 digits. 0, 1, 2, 3, 4 5 and 6. We count like this: 0. Start at 0.

1111001, 7D, 232

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Both add and multiply together base 8 numbers 352 and 17, show all workings.

A

Addition 371,
Multiplication 6666

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Define what is meant by 2’s complement in binary. Explain why it is useful for dealing with negative numbers and subtraction. Include examples to illustrate your explanation.

A

The way computers chooses to represent integers.

In two’s complement form, a negative number is the 2’s complement of its positive number with the subtraction of two numbers being A – B = A + ( 2’s complement of B ).

Subtraction of binary numbers can be done by adding the (2’s complement + 1) of the second number to the first number. Binary subtraction is just binary addition of a negative number.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Consider the sets U = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} and subsets
A = {1, 2, 4, 8}, B = {2, 4, 6, 8, 10}, and C = {3, 4, 5, 6, 7}.

Determine the following:
 (A ∩ B ) ∪ C
 (A ∪ C)ˊ
 B \ C
 A ∆ C

A

{2, 3, 4, 5, 6, 7, 8}

{9, 10}

{2, 8, 10}

{1, 3, 5, 6, 7, 8}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Consider the sets
U = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
and subsets
A = {1, 2, 4, 8}, B = {2, 4, 6, 8, 10},
and
C = {3, 4, 5, 6, 7}.

Calculate the power set P(A). In general, how many elements are in the power set of a set of cardinality n? How many elements are there in the Cartesian product A × A?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

For each of the following statements, either prove they are true or give an example to show they are false.

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Define clearly the terms injective, surjective, and bijective.

A

Injective – two things cannot map to the same thing, or f(x) = f(y) implies x = y. Surjective – For all y, there exists x such that f(x) = y. Bijective – both injective and surjective.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Consider the function f

A

f(x) is none, g(x) is injective only.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Calculate

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Explain briefly what is meant by O(n) notation (you do not need a formal definition). Illustrate your explanation with an example.

A

Big O notation describes the complexity of your code using algebraic terms.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Find

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Draw the complete graph on 4 vertices. Is this graph planar?

A
17
Q

Define what is meant by a cycle, a tree, and a spanning tree.

A

Cycle – a path that returns to the same vertex with no other repeats.

Tree – a graph with no cycles.

Spanning tree – A subgraph that forms a tree

18
Q

What is the main difference between Prim’s algorithm and Kruskal’s algorithm? Illustrate with an example. Will they always give the same graph as their result?

A

Prim starts from the beginning and chooses the next shortest path from those already established (without creating a cycle) while Kruskal chooses from the shortest anywhere in the graph. Any example. Will not always be the same (although will be if the weights are all different).