Search for question
Question

#5 (3+1+3+1=8 marks) This problem is about the RSA cryptosystem; a process by which people can

communicate securely. It is widely used in today's society. (The question is more long than hard.)

Every character of the alphabet is turned into a number: We assign the letters of the alphabet

A,B,C,...,Y,Z with the numbers 0, 1, 2,..., 24, 25, respectively.

In this small version of RSA, we'll deal with 2 letters at a time: every pair of letters can be uniquely

represented by a number less than 676 in base 26. Every pair of letters corresponds to some number

between 0 and 675 inclusive, and any such number corresponds to a pair of letters.

For example, to convert DISCRETE into numbers we would do the following: DI SC RE-TE

becomes

D is 3, I is 8: so DI is 3 x 26+8 = 86.

S is 18, C is 2: so SC is 18 x 26+2 = 470.

R is 17, E is 4: so RE is 17 × 26 +4= 446.

T is 19, E is 4: so TE is 19 × 26 + 4 = 498.

Thus, DISCRETE would be written 86 470 446 498.

Fig: 1


Most Viewed Questions Of Discrete Mathematics

Prove or disprove: a) For all integers a, b, c, if a | b and b|c then a|c. b) For all integers a, b, c, d, if a | b and c | d, then (ac)| (b+d). c) For all integers a, b, c, if a | (b+c), then a | b and a | c. d) For all integers a, b, c, if a | bc, then a | b or a | c. e) For all integers a, b, c, if a | c and b | c, then ab |c².


Show that: a) If a and d: positive integers, then (-a) div d=-a div d if and only if d divides a. b) If n and k are positive integers, then [n/k] = [(n – 1)/k] + 1.


Create an application that allows a teacher to enter three test scores each for threestudents. The application should calculate each student's average test score and as-sign a letter grade based on the following grading scale: The application should prompt the user for each student's name and three test scores. Figure 5-54 shows an example of how the application's form might appear after all the data has been entered.


Show that: a) If a |b and b|a, where a and b are integers, then a = b or a=-b. b) If a, b, and c are integers, where a + 0 and c + 0, such that ac | bc, then a | b.


Sort the following list showing the lists obtained at each step. a) Use insertion sort to sort list: 3, 1, 5, 7, 4. b) Use selection sort to sort list: 3, 5, 4, 1, 2.


4.13 A combinational logic circuit has four inputs (A, B, C, and D) and one output Z. The output is 1 iff the input has three consecutive 0's or three consecutive 1's. For example, if A = 1, B = 0, C = 0, and D = 0, then Z = 1, but if A = 0, B = 1, C = 0, and D = 0, then Z = 0. Design the circuit using one four-input OR gate and four three-input AND gates.


A logistics task: rectangular boxes containing mechanical components need to be transported to a site. Every box has the same width and height (60 x 10 cm). Lengths of boxes vary from 10 cm to 60 cm. All boxes need to be packed into a large container of dimensions 60 × 60 × 60 cm. In a certain shipment the boxes have the following lengths How can the boxes be packed in the container? Any empty space within the container could be filled with packing material. Design an algorithm for handling the task for n boxes of variable lengths. What is the complexity of this algorithm (see Figure 2.9)?Show your work.


Determine the numerical values of the ß coefficients(weighting factors) in such a way that the solution of the water resources allocation problem complies with the assumed hierarchy of water users:U5 > U1 > U2 > U3 > U4


Distance Calculator If you know a vehicle's speed and the amount of time it has traveled, you can calculate the distance it has traveled as follows: Distance = Speed * Time For example, if a train travels 40 miles per hour for 3 hours, the distance traveled is 120 miles. Create an application with a form similar to the one shown in Figure 5-47.When the user clicks the Calculate button, the application should display an input box asking the user for the speed of the vehicle in miles-per-hour, followed by an-other input box asking for the amount of time, in hours, that the vehicle has traveled. Then it should use a loop to display in a list box the distance the vehicle has traveled for each hour of that time period. Figure 5-48 shows an example of what the application's form should look like.


A software company sells three packages, Package A, Package B, and Package C,which retail for $99, $199, and $299, respectively. Quantity discounts are given ac-cording to the following table: Create an application that allows the user to enter the number of units sold for each software package. The application's form should resemble Figure 4-37. The application should calculate and display the order amounts and the grand total in a Label control. The Clear button must clear all text boxes and calculated labels.The Exit button must close the window. Input validation: Make sure the number of units for each package is numeric, and is not negative.Use the following test data to determine if the application is calculating properly: