Download CS 413, Assignment 1

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Approximations of π wikipedia , lookup

Positional notation wikipedia , lookup

Arithmetic wikipedia , lookup

Collatz conjecture wikipedia , lookup

Addition wikipedia , lookup

Elementary mathematics wikipedia , lookup

Weber problem wikipedia , lookup

Proofs of Fermat's little theorem wikipedia , lookup

Transcript
1
CS 413, Homework 1, Part 3, Merkle-Hellman Questions
1. Define the term superincreasing with respect to knapsack contents.
2. Can the elements of this vector be used to form a superincreasing knapsack? If so,
what would it be?
(1, 6, 10, 4, 16)
3. Can the elements of this vector be used to form a superincreasing knapsack? If so,
what would it be?
(7, 2, 35, 3, 20)
4. The components of a knapsack problem are shown. Give the mathematical expression
(equation) showing their relationship, assuming that the vector V is a solution.
V = (v1, v2, …, vn), vi an element of {0, 1)
S = (a1, a2, …, an), ai an element of {the positive integers)
T, a positive integer
5. Here is a superincreasing knapsack. Can you find a target T which can’t be obtained
using the knapsack? If so, give an example. Is this a problem?
(1, 5, 10, 20)
6. The knapsack shown is not superincreasing. Give two vectors V which would both
form the target T = 13.
(1, 2, 3, 5, 8)
7. Given the knapsack and target shown, find the solution to this knapsack problem if
there is one.
S = (1, 2, 6, 11, 22)
T = 14
2
8. Given the knapsack and target shown, find the solution to this knapsack problem if
there is one.
S = (1, 2, 7, 11, 27)
T = 16
9. In Merkle-Hellman encryption, is the hard knapsack or the superincreasing knapsack
the public key?
10. Is Merkle-Hellman encryption based on an NP-complete problem?
11. Given the hard knapsack (8, 3, 15), encode the bit sequence (1, 0, 1) (i.e., find T).
12. Following is a message given as a sequence of binary numbers, and a knapsack.
Give the resulting encryption as a sequence of decimal numbers. Note that this will result
in three decimal integers.
P = 1011 0101 0001
S = (6, 12, 13, 3)
13. Given n = 29 and w = 3, convert the superincreasing knapsack shown below to a
hard knapsack.
S = (1, 4, 6, 13)
14. Given n = 15 and w = 4, convert the superincreasing knapsack shown below to a
hard knapsack.
S = (1, 4, 7, 14)
15. In Merkle-Hellman encryption you do modular arithmetic with parameters w and n.
What algebraic relationship has to hold between w and n in order for decryption to be
possible?
16. In Merkle-Hellman encryption: a) Does the encrypter need any information besides
the hard knapsack in order to do encryption? If so, what? b) Does the intended receiver
need any information besides the superincreasing knapsack in order to do decryption? If
so, what?
3
17. Given these parameters, n = 29 and w = 3, find w-1 in the modular field base 29.
18. Given n = 17, w = 4, w-1 = 13, and an encoded value of 8, transform this value to the
one that can be solved using the superincreasing knapsack, whatever that knapsack might
happen to be in this case.
19. Let these values be given:
S = (1, 2, 5, 9)
n = 17, w = 6
A sequence of decimal, encrypted targets T: 12, 25, 22
a. Find the inverse of w mod n.
b. Convert the sequence of T’s to values that can be decrypted using the superincreasing
knapsack.
c. Express the values of step b as three vectors V containing 4 binary elements each.
20. Let these values be given:
S = (1, 3, 7, 15)
n = 29, w = 5
V = (0, 1, 1, 0)
a. Transform S into a hard knapsack using the other parameters given.
b. Using the result of the previous step, find T, that is, encrypt the plaintext represented
by V.
c. Find the inverse of w mod n.
d. Convert T to the value which can be decrypted using the superincreasing knapsack.
e. Finish by expressing the result of step d as a sum of the elements of the
superincreasing knapsack.
4
21. Mother Goose asks, who or what am I?
In Spring I look gay
In Spring I look gay,
Decked in comely array,
In Summer more clothing I wear;
When colder it grows,
I fling off my clothes,
And in Winter quite naked appear.
Possible answers:
1.
2.
3.
4.
Each element is greater than the sum of the preceding ones.
(1, 4, 6, 10, 16), no
(2, 3, 7, 20, 35), yes
S · V = T, or
n
a v
i 1
i i
T
5. There are lots of them. T = 14, for example. This isn’t a problem.
6. (0, 1, 1, 0, 1), (0, 0, 0, 1, 1)
7. (1, 1, 0, 1, 0)
8. no solution
9. the hard knapsack
10. yes
11. T = 23
12. 22, 15, 3
13. (3, 12, 18, 10)
14. (4, 1, 13, 11)
15. The have to be relatively prime. The easiest way to get this is by picking n prime.
16. a) no. b) yes, w-1
17. w-1 = 10
18. 8 · 13 mod 17 = 2
19.
a. w-1 = 3
b. 2, 7, 15
c. (0, 1, 0, 0), (0, 1, 1, 0), (1, 0, 1, 1)
20.
a. (5, 15, 6, 17)
b. T = 21
c. w-1 = 6
d. 10
e. 3 + 7
21. A Tree