1. Define: (a) Variable, (b) Constant, (c) Type, (d) Enumerated Type, (e) Identifier.

Size: px
Start display at page:

Download "1. Define: (a) Variable, (b) Constant, (c) Type, (d) Enumerated Type, (e) Identifier."

Transcription

1 Study Group 1 Variables and Types 1. Define: (a) Variable, (b) Constant, (c) Type, (d) Enumerated Type, (e) Identifier. 2. What does the byte represent? 3. What is the purpose of the declarations section of a Pascal program? Why are there so many different types of whole number? 4. Write Pascal statements that compute the roots of a quadratic equation ax 2 + bx + c = The function Ord can be applied to any ordinal type, including enumerated types. In particular, for working with ASCII characters (type Char): Ord(ch) computes the ASCII value (ordinal position) of character ch Chr(n) computes the character whose ASCII value is n; Thus Ord( A ) = 65, Ord( a ) = 97, Chr(122) = z, Chr(90) = Z, etc. The inbuilt type string is made of up of the sequence characters, numbered from 1. The [] notation is used to refer to a character at a particular position in a string. So for the string S = LIAM, S[1] = L, S[2] = I, etc. The function LENGTH can be applied to a variable type of string to return the number of characters making up that string, thus LENGTH( LIAM ) = 4. The lucky number for a name is made by adding the values of the letters, then repeating until the value is less than 10. So: LIAM = = 35 = 8 Write formal statements (which could be Pascal) that compute the lucky number for (a) Liam, (b) your name. 6. Write Pascal statements that change the string SEAL into the string COAT by changing one letter at a time, each time making a new (proper) word. 7. Define an enumerated type for the days of the week. Consider some useful functions on this type (e.g. before, after, weekend, weekday, n days time, etc), how they might be programmed, and what their type signature would be. 8. In The Republic, Plato introduces his Theory of Forms, using as an example distinction between 2 as a real number (used by practical people for counting) and the number 2 of pure mathematics. Point out to Plato where he was going wrong. The, 2001.

2 Study Group 2 Loops and Conditionals A cipher is a general term for any cryptographic technique in which the letters of a string, called the plaintext, are changed into another string, called the ciphertext. A transposition cipher is a cipher where the characters stay the same but change position in the string; a substitution cipher is a cipher where the characters change but retain the same relative positions. The double rail transposition cipher mixes alternative characters: e.g. hello world = h e l l o w o r l d = hloolelwrd One possible substitution cipher is to exchange each letter n places from the start of the alphabet with a letter n places from the end of the alphabet, e.g. substitute z for a, y for b, and so on. 1. Write a program to encode and decode a plaintext using the double rail cipher described above. 2. Write a program to encode and decode a plaintext using the substitution cipher described above. 3. Generalise the program of Question 1 for an arbitrary number of rails. 4. Write a program to encode and decode a plaintext using a transposition cipher which swaps adjacent letter pairs. 5. The Caesar Shift Cipher. Write a program to encode and decode a plaintext using a substitution cipher in which the letters of the alphabet are shifted n places, i.e. for n =1, a b, b c, etc.; for n =2,, a c, b d, etc. The, 2001.

3 Study Group 3 Algorithm Design Using the Vignere Cipher, a keyword is used to index into a set of Caesar Shift Ciphers, each shifted by a different number of places: A B C D E F a b c d e f g h i j k l m n o p q r s t u v w x y z 1 b c d e f g h i j k l m n o p q r s t u v w x y z a 2 c d e f g h i j k l m n o p q r s t u v w x y z a b 3 d e f g h i j k l m n o p q r s t u v w x y z a b c 4 e f g h i j k l m n o p q r s t u v w x y z a b c d 5 f g h i j k l m n o p q r s t u v w x y z a b c d e 6 g h i j k l m n o p q r s t u v w x y z a b c d e f So using the keyword DAB (row 4, row 1, row 2), a plaintext would be enciphered by repeating the keyword over the plaintext and looking at the row of the table to encode each letter: Keyword Plaintext Ciphertext D A B D A B D A B D A B D A B D A B h e e d t h e i d e s o f m a r c h l f g h u j i j f i t q j n c v d j Note how the same letters in the plaintext can be encoded as different letters in the ciphertext, and how different letters in the plaintext are encoded as the same letter in the ciphertext. 1. Design a program (i.e. specify an algorithm in pseudo-code) to encode and decode a plaintext using the Vignere Cipher. 2. Implement your design, by writing a program to encode and decode a plaintext using the Vignere Cipher. Hint. Use a string constant to represent the Vignere Table and use modulo arithmetic. The, 2001.

4 Study Group 4 Procedures and Functions 1. Write a function that computes the greatest common divisor (GCD) of two numbers. 2. Write a function that computes whether or not two numbers are co-prime (relatively prime), i.e. their GCD is Write a procedure that gets as user input two numbers, p and q, checks that they are both prime, computes N = p*q, M = (p-1)*(q-1), and asks for another number e which must be less than p*q, checks that M and e are co-prime, and returns the values of M, N, and e. 4. Write a function that computes the value of d in the equation e * d MOD M = 1 Hint. One way is to test successive numbers of d. Another way is to recognize that trying to calculate d in d * e MOD M = 1 is the same as computing d such that (de - 1) is evenly divisible by (p-1)(q-1), i.e. M. Mathematicians write this as de = 1 (mod (p-1)(q-1)), and they call d the multiplicative inverse of e. This is easy to do - simply find an integer x which causes d = (x(p-1)(q-1) + 1)/e to be an integer, then use that value of d. Then we are trying to calculate: d = xm + 1/e de = xm + 1 de xm = 1 de + (-x)m = 1 There is an algorithm called Extended Euclid s algorithm which can be used to compute the greatest common divisor, g, of two positive integers, a and b, and coefficients, h and j, such that g = ha + jb. 5. Write a function that will compute modulos of very big exponentials, bearing in mind the following example: A e mod N =(A e1 * A e2 ) mod N where e = e1 + e2, and if e is a power of 2, and: A e mod N = (A 2 ) e/2 mod N = (A 2 mod N) e/2 mod N The, 2001.

5 Study Group 4a Procedures and Functions 1. Write a function maxof2 that returns the larger of two values. Write another function minof2 that returns the smaller of two values. Write a function maxof3 that returns the largest of three values, and another function minof3 that returns the smallest of 3 values. Write a function midof3 that returns the middle value of three numbers, using one statement, using maxof2 and minof2 functions only. 2. Write a function which takes as input a number in the range and which returns a date in DD/MM format. In the first version, ignore leap years. Write a second version which takes as an extra parameter the year, and returns the date in DD/MM/YY format. In other words, you will need to write a (Boolean) function leapyear, according to the rules: 1. If a year is divisible by 4 it is a leap year; 2. Unless it is divisible by 100, in which case it is not a leap year; 3. Unless it is divisible by 400, in which case it is still a leap year. This means that 1800 and 1900 were not leap years, but 2000 was. 3. Define a type which stores the vertices of a quadrilateral. Write a function which checks if the four vertices form a square. 4. Write procedures which draw right-angle triangles using characters, of a specified size and shape. The shape depends on which corner the right angle is in, and can be one of four possibilities: south-west, south east, north-west or north-east * * ***** ***** ** ** **** **** *** *** *** *** **** **** ** ** ***** ***** * * south-west south east north-west north-east The, 2001.

6 Study Group 5 Data Structures 1. Redesign the Vignere Cipher program using an array. Write a program to implement the redesign. 2. One way to crack a substitution cipher is frequency analysis. That is, the codebreaker looks for the most common letters occurring in the ciphertext, and supposes that these are the ciphers for the most commonly occurring letters in natural text. Write a program that counts the number of occurrences of each letter in a ciphertext. 3. Write a program that displays a graph of the results from Question Design a program that would propose solutions to a Caesar Shift Cipher. The, 2001.

7 Study Group 6 Dataflow Design The ADFGVX Cipher features both transposition and substitution. The process is: Draw up a 6-by-6 grid, filling the 36 squares at random with the 26 letters of the alphabet and the 10 digits. Each row and column of the grid is identified by a letter from A, D, F, G, V and X. The first stage of encryption is to take each letter of the plaintext, locate it in the grid, and substitute it with the letters labeling its row and column. The second stage is to use a keyword, the letters of which are written on the top of a fresh grid. The letters from the first stage are then written in rows across the grid. The grid itself is then rearranged so the letters of the keyword are in alphabetical order, then the letters are read off column by column. For example: given the grid: A D F G V X A z l x 6 f 9 D u 8 m g v e F 3 t h n d 2 G k i s c o y V j w b r 5 p X 4 a 0 1 q 7 hello world then codes as FF DX AD AD GV VD GV VG AD FV Assume we have the keyword LIAM. The code letters are then arranged and transposed L I A M A I L M F F D X D F F X A D A D A D A D G V V D V V G D G V V G V V G G A D F V F D A V Giving a final code of DAVVFFDVVDFAGGAXDDGV 1. Design (dataflow and pseudocode) a program to encode and decode using this cipher. 2 Write a program that implements the design. The, 2001.

8 Study Group 7 Noughts and Crosses Consider the design and pseudo-code from Lecture 9 (Tic Tac Toe). Then consider the following declarations: type var OandX = (nought, cross, blank) ; Tttboard1D = array [1..9] of OandX ; Tttboard2D = array [1..3,1..3] of OandX ; Frame1D : Tttboard1D ; Frame2D : Tttboard2D ; Player : OandX 1. Write code to initialize the frame at the start of a new game, using: (a) using a function; (b) using a procedure; (c) using a procedure with global variables. 2. Write a procedure that displays the state of the game at any point, for each of Frame1D and Frame2D. 3. Write a procedure or function that implements MakeTurn, i.e. inputs a board location from the user, validates it, and once valid input is entered, updates the game board. Specify whether you are using Tttboard1D or Tttboard2D and how the user enters input. 4. Write a procedure or function that calculates the game status from the current state of the board (GameOn, GameOver, GameWon, and GameDrawn). 5. Given a single additional data structure, it is possible to define a boolean function for checking GameWon using a single for loop whose body is a simple statement (a single assignment). Define this data structure and implement this function. 6. Define and implement a procedure that would allow the computer to make a turn. The, 2001.

9 Study Group 8 File Input and Output Processing TextFiles 1. Write a program that takes as input a textfile, codes it using some cipher algorithm, and outputs it as another textfile. 2. Write another program which decodes encrypted textfiles. 3. Write a program which extends the ADFGVX cipher program by reading in the grid and keyword from some configuration file. Processing Typed Binary Files A program is required to process football results and update a league table. The league consists of twenty teams. Each week a number of matches are played between the two teams. The results of the matches are of the form: Arsenal 5 Tottenham Hotspur 3 Newcastle United 0 West Ham United 2 Manchester United 4 Brentford 7 And so on. The league table will store, for each of twenty teams, the team name, the number of game played, the number of home matches won, drawn and lost, the number of away matches won, drawn, and lost, the goals scored for and against, and the total number of points (3 for each win, 1 for each draw and 0 for each loss). 4. Write declarations for: a date type of team records, a data type for a league table; a data type for results; a file of type results, and a file of type team records. 5. Design and implement a program which reads in a file of team records into a league table, then processes a file of results, updating the league table according to the results, then outputs the new league table to a new file. 6. Write out the new file sorted in order of points, then goal difference, then alphabetical order. ± 7 The, 2001.

10 Study Group 9 Abstract Data Types 1. A stack is a dynamic data structure providing a reserved amount of memory for storing data items. A stack can be used, for example, used for arithmetic calculations, or to keep track of internal operations. Stacks keep track of the sequence of routines called in a program. For example, if one routine calls another, which calls another and so on. As each routine is completed, the computer returns control to the calling routine all the way back to the first one that started the sequence. Stacks used in this way are LIFO based: the last item, or address, placed (pushed) onto the stack is the first item removed (popped) from the stack. Write a unit containing an abstract data type for a stack using an array. You should provide four access procedures: PUSH (push an item onto the stack), POP (remove the topmost item off the stack), PEEK (look at the top item on the stack without processing it), and SIZE (how big the stack is). You can use any kind of data item for the type of data stored on the stack. 2. Re-implement the stack ADT of Q1 using a dynamic data structure. [Requires Pointers.] 3. Write a unit containing an abstract data type for a queue. A queue is like a stack except it is LILO based (i.e. last in last out). Again, design and implement two implementations, one using an array and one using a dynamic data structure. The, 2001.

Number Theory. Proof. Suppose otherwise. Then there would be a finite number n of primes, which we may

Number Theory. Proof. Suppose otherwise. Then there would be a finite number n of primes, which we may Number Theory Divisibility and Primes Definition. If a and b are integers and there is some integer c such that a = b c, then we say that b divides a or is a factor or divisor of a and write b a. Definition

More information

Cryptography and Network Security Department of Computer Science and Engineering Indian Institute of Technology Kharagpur

Cryptography and Network Security Department of Computer Science and Engineering Indian Institute of Technology Kharagpur Cryptography and Network Security Department of Computer Science and Engineering Indian Institute of Technology Kharagpur Module No. # 01 Lecture No. # 05 Classic Cryptosystems (Refer Slide Time: 00:42)

More information

Solutions to Problem Set 1

Solutions to Problem Set 1 YALE UNIVERSITY DEPARTMENT OF COMPUTER SCIENCE CPSC 467b: Cryptography and Computer Security Handout #8 Zheng Ma February 21, 2005 Solutions to Problem Set 1 Problem 1: Cracking the Hill cipher Suppose

More information

8 Primes and Modular Arithmetic

8 Primes and Modular Arithmetic 8 Primes and Modular Arithmetic 8.1 Primes and Factors Over two millennia ago already, people all over the world were considering the properties of numbers. One of the simplest concepts is prime numbers.

More information

Hill s Cipher: Linear Algebra in Cryptography

Hill s Cipher: Linear Algebra in Cryptography Ryan Doyle Hill s Cipher: Linear Algebra in Cryptography Introduction: Since the beginning of written language, humans have wanted to share information secretly. The information could be orders from a

More information

Introduction to Hill cipher

Introduction to Hill cipher Introduction to Hill cipher We have explored three simple substitution ciphers that generated ciphertext C from plaintext p by means of an arithmetic operation modulo 26. Caesar cipher: The Caesar cipher

More information

Factoring Algorithms

Factoring Algorithms Factoring Algorithms The p 1 Method and Quadratic Sieve November 17, 2008 () Factoring Algorithms November 17, 2008 1 / 12 Fermat s factoring method Fermat made the observation that if n has two factors

More information

Lecture 13 - Basic Number Theory.

Lecture 13 - Basic Number Theory. Lecture 13 - Basic Number Theory. Boaz Barak March 22, 2010 Divisibility and primes Unless mentioned otherwise throughout this lecture all numbers are non-negative integers. We say that A divides B, denoted

More information

Cyber Security Workshop Encryption Reference Manual

Cyber Security Workshop Encryption Reference Manual Cyber Security Workshop Encryption Reference Manual May 2015 Basic Concepts in Encoding and Encryption Binary Encoding Examples Encryption Cipher Examples 1 P a g e Encoding Concepts Binary Encoding Basics

More information

Overview/Questions. What is Cryptography? The Caesar Shift Cipher. CS101 Lecture 21: Overview of Cryptography

Overview/Questions. What is Cryptography? The Caesar Shift Cipher. CS101 Lecture 21: Overview of Cryptography CS101 Lecture 21: Overview of Cryptography Codes and Ciphers Overview/Questions What is cryptography? What are the challenges of data encryption? What factors make an encryption strategy successful? What

More information

RSA Encryption. Tom Davis tomrdavis@earthlink.net http://www.geometer.org/mathcircles October 10, 2003

RSA Encryption. Tom Davis tomrdavis@earthlink.net http://www.geometer.org/mathcircles October 10, 2003 RSA Encryption Tom Davis tomrdavis@earthlink.net http://www.geometer.org/mathcircles October 10, 2003 1 Public Key Cryptography One of the biggest problems in cryptography is the distribution of keys.

More information

K80TTQ1EP-??,VO.L,XU0H5BY,_71ZVPKOE678_X,N2Y-8HI4VS,,6Z28DDW5N7ADY013

K80TTQ1EP-??,VO.L,XU0H5BY,_71ZVPKOE678_X,N2Y-8HI4VS,,6Z28DDW5N7ADY013 Hill Cipher Project K80TTQ1EP-??,VO.L,XU0H5BY,_71ZVPKOE678_X,N2Y-8HI4VS,,6Z28DDW5N7ADY013 Directions: Answer all numbered questions completely. Show non-trivial work in the space provided. Non-computational

More information

Kevin James. MTHSC 412 Section 2.4 Prime Factors and Greatest Comm

Kevin James. MTHSC 412 Section 2.4 Prime Factors and Greatest Comm MTHSC 412 Section 2.4 Prime Factors and Greatest Common Divisor Greatest Common Divisor Definition Suppose that a, b Z. Then we say that d Z is a greatest common divisor (gcd) of a and b if the following

More information

Dr. Jinyuan (Stella) Sun Dept. of Electrical Engineering and Computer Science University of Tennessee Fall 2010

Dr. Jinyuan (Stella) Sun Dept. of Electrical Engineering and Computer Science University of Tennessee Fall 2010 CS 494/594 Computer and Network Security Dr. Jinyuan (Stella) Sun Dept. of Electrical Engineering and Computer Science University of Tennessee Fall 2010 1 Introduction to Cryptography What is cryptography?

More information

Chapter 3. if 2 a i then location: = i. Page 40

Chapter 3. if 2 a i then location: = i. Page 40 Chapter 3 1. Describe an algorithm that takes a list of n integers a 1,a 2,,a n and finds the number of integers each greater than five in the list. Ans: procedure greaterthanfive(a 1,,a n : integers)

More information

159.334 Computer Networks. Network Security 1. Professor Richard Harris School of Engineering and Advanced Technology

159.334 Computer Networks. Network Security 1. Professor Richard Harris School of Engineering and Advanced Technology Network Security 1 Professor Richard Harris School of Engineering and Advanced Technology Presentation Outline Overview of Identification and Authentication The importance of identification and Authentication

More information

MATHS ACTIVITIES FOR REGISTRATION TIME

MATHS ACTIVITIES FOR REGISTRATION TIME MATHS ACTIVITIES FOR REGISTRATION TIME At the beginning of the year, pair children as partners. You could match different ability children for support. Target Number Write a target number on the board.

More information

Review of Fundamental Mathematics

Review of Fundamental Mathematics Review of Fundamental Mathematics As explained in the Preface and in Chapter 1 of your textbook, managerial economics applies microeconomic theory to business decision making. The decision-making tools

More information

Caesar Ciphers: An Introduction to Cryptography

Caesar Ciphers: An Introduction to Cryptography Purdue GK-12 Lesson Plan 2006-07 Caesar Ciphers: An Introduction to Cryptography Purdue University GK-12 2006-07 Lead developer and contact: Lance Bryant Purdue GK-12 Fellow LBRYANT@MATH.PURDUE.EDU Co-author

More information

Cryptography Exercises

Cryptography Exercises Cryptography Exercises 1 Contents 1 source coding 3 2 Caesar Cipher 4 3 Ciphertext-only Attack 5 4 Classification of Cryptosystems-Network Nodes 6 5 Properties of modulo Operation 10 6 Vernam Cipher 11

More information

MATH 537 (Number Theory) FALL 2016 TENTATIVE SYLLABUS

MATH 537 (Number Theory) FALL 2016 TENTATIVE SYLLABUS MATH 537 (Number Theory) FALL 2016 TENTATIVE SYLLABUS Class Meetings: MW 2:00-3:15 pm in Physics 144, September 7 to December 14 [Thanksgiving break November 23 27; final exam December 21] Instructor:

More information

Multiplicative Ciphers. Cryptography of Multiplicative Ciphers

Multiplicative Ciphers. Cryptography of Multiplicative Ciphers Fall 2006 Chris Christensen MAT/CSC 483 Multiplicative Ciphers It is evident from the relative ease with which the Caesar Cipher or its generalization to an arbitrary number of positions of shift has been

More information

Network Security. Security Attacks. Normal flow: Interruption: 孫 宏 民 hmsun@cs.nthu.edu.tw Phone: 03-5742968 國 立 清 華 大 學 資 訊 工 程 系 資 訊 安 全 實 驗 室

Network Security. Security Attacks. Normal flow: Interruption: 孫 宏 民 hmsun@cs.nthu.edu.tw Phone: 03-5742968 國 立 清 華 大 學 資 訊 工 程 系 資 訊 安 全 實 驗 室 Network Security 孫 宏 民 hmsun@cs.nthu.edu.tw Phone: 03-5742968 國 立 清 華 大 學 資 訊 工 程 系 資 訊 安 全 實 驗 室 Security Attacks Normal flow: sender receiver Interruption: Information source Information destination

More information

Cryptography and Network Security Prof. D. Mukhopadhyay Department of Computer Science and Engineering Indian Institute of Technology, Karagpur

Cryptography and Network Security Prof. D. Mukhopadhyay Department of Computer Science and Engineering Indian Institute of Technology, Karagpur Cryptography and Network Security Prof. D. Mukhopadhyay Department of Computer Science and Engineering Indian Institute of Technology, Karagpur Lecture No. #06 Cryptanalysis of Classical Ciphers (Refer

More information

Number Theory and Cryptography using PARI/GP

Number Theory and Cryptography using PARI/GP Number Theory and Cryptography using Minh Van Nguyen nguyenminh2@gmail.com 25 November 2008 This article uses to study elementary number theory and the RSA public key cryptosystem. Various commands will

More information

CHAPTER 5. Number Theory. 1. Integers and Division. Discussion

CHAPTER 5. Number Theory. 1. Integers and Division. Discussion CHAPTER 5 Number Theory 1. Integers and Division 1.1. Divisibility. Definition 1.1.1. Given two integers a and b we say a divides b if there is an integer c such that b = ac. If a divides b, we write a

More information

Cryptography and Network Security. Prof. D. Mukhopadhyay. Department of Computer Science and Engineering. Indian Institute of Technology, Kharagpur

Cryptography and Network Security. Prof. D. Mukhopadhyay. Department of Computer Science and Engineering. Indian Institute of Technology, Kharagpur Cryptography and Network Security Prof. D. Mukhopadhyay Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Module No. # 01 Lecture No. # 12 Block Cipher Standards

More information

MATH 10034 Fundamental Mathematics IV

MATH 10034 Fundamental Mathematics IV MATH 0034 Fundamental Mathematics IV http://www.math.kent.edu/ebooks/0034/funmath4.pdf Department of Mathematical Sciences Kent State University January 2, 2009 ii Contents To the Instructor v Polynomials.

More information

U.C. Berkeley CS276: Cryptography Handout 0.1 Luca Trevisan January, 2009. Notes on Algebra

U.C. Berkeley CS276: Cryptography Handout 0.1 Luca Trevisan January, 2009. Notes on Algebra U.C. Berkeley CS276: Cryptography Handout 0.1 Luca Trevisan January, 2009 Notes on Algebra These notes contain as little theory as possible, and most results are stated without proof. Any introductory

More information

= 2 + 1 2 2 = 3 4, Now assume that P (k) is true for some fixed k 2. This means that

= 2 + 1 2 2 = 3 4, Now assume that P (k) is true for some fixed k 2. This means that Instructions. Answer each of the questions on your own paper, and be sure to show your work so that partial credit can be adequately assessed. Credit will not be given for answers (even correct ones) without

More information

PES Institute of Technology-BSC QUESTION BANK

PES Institute of Technology-BSC QUESTION BANK PES Institute of Technology-BSC Faculty: Mrs. R.Bharathi CS35: Data Structures Using C QUESTION BANK UNIT I -BASIC CONCEPTS 1. What is an ADT? Briefly explain the categories that classify the functions

More information

DATA STRUCTURES USING C

DATA STRUCTURES USING C DATA STRUCTURES USING C QUESTION BANK UNIT I 1. Define data. 2. Define Entity. 3. Define information. 4. Define Array. 5. Define data structure. 6. Give any two applications of data structures. 7. Give

More information

Unit 6 Direction and angle

Unit 6 Direction and angle Unit 6 Direction and angle Three daily lessons Year 4 Spring term Unit Objectives Year 4 Recognise positions and directions: e.g. describe and find the Page 108 position of a point on a grid of squares

More information

Continued Fractions and the Euclidean Algorithm

Continued Fractions and the Euclidean Algorithm Continued Fractions and the Euclidean Algorithm Lecture notes prepared for MATH 326, Spring 997 Department of Mathematics and Statistics University at Albany William F Hammond Table of Contents Introduction

More information

Pseudo code Tutorial and Exercises Teacher s Version

Pseudo code Tutorial and Exercises Teacher s Version Pseudo code Tutorial and Exercises Teacher s Version Pseudo-code is an informal way to express the design of a computer program or an algorithm in 1.45. The aim is to get the idea quickly and also easy

More information

Basic Algorithms In Computer Algebra

Basic Algorithms In Computer Algebra Basic Algorithms In Computer Algebra Kaiserslautern SS 2011 Prof. Dr. Wolfram Decker 2. Mai 2011 References Cohen, H.: A Course in Computational Algebraic Number Theory. Springer, 1993. Cox, D.; Little,

More information

MATHEMATICS Y6 Geometry 6750 Use co-ordinates and extend to 4 quadrants Equipment MathSphere www.mathsphere.co.uk

MATHEMATICS Y6 Geometry 6750 Use co-ordinates and extend to 4 quadrants Equipment MathSphere www.mathsphere.co.uk MATHEMATICS Y6 Geometry 675 Use co-ordinates and etend to quadrants Paper, pencil, ruler Equipment MathSphere 675 Use co-ordinates and etend to quadrants. Page Concepts Children should be familiar with

More information

ALGEBRA. sequence, term, nth term, consecutive, rule, relationship, generate, predict, continue increase, decrease finite, infinite

ALGEBRA. sequence, term, nth term, consecutive, rule, relationship, generate, predict, continue increase, decrease finite, infinite ALGEBRA Pupils should be taught to: Generate and describe sequences As outcomes, Year 7 pupils should, for example: Use, read and write, spelling correctly: sequence, term, nth term, consecutive, rule,

More information

Advanced Cryptography

Advanced Cryptography Family Name:... First Name:... Section:... Advanced Cryptography Final Exam July 18 th, 2006 Start at 9:15, End at 12:00 This document consists of 12 pages. Instructions Electronic devices are not allowed.

More information

Chapter 4: Computer Codes

Chapter 4: Computer Codes Slide 1/30 Learning Objectives In this chapter you will learn about: Computer data Computer codes: representation of data in binary Most commonly used computer codes Collating sequence 36 Slide 2/30 Data

More information

PROBLEMS (Cap. 4 - Istruzioni macchina)

PROBLEMS (Cap. 4 - Istruzioni macchina) 98 CHAPTER 2 MACHINE INSTRUCTIONS AND PROGRAMS PROBLEMS (Cap. 4 - Istruzioni macchina) 2.1 Represent the decimal values 5, 2, 14, 10, 26, 19, 51, and 43, as signed, 7-bit numbers in the following binary

More information

Discrete Mathematics, Chapter 4: Number Theory and Cryptography

Discrete Mathematics, Chapter 4: Number Theory and Cryptography Discrete Mathematics, Chapter 4: Number Theory and Cryptography Richard Mayr University of Edinburgh, UK Richard Mayr (University of Edinburgh, UK) Discrete Mathematics. Chapter 4 1 / 35 Outline 1 Divisibility

More information

Chapter 11 Number Theory

Chapter 11 Number Theory Chapter 11 Number Theory Number theory is one of the oldest branches of mathematics. For many years people who studied number theory delighted in its pure nature because there were few practical applications

More information

Paper 1. Calculator not allowed. Mathematics test. First name. Last name. School. Remember KEY STAGE 3 TIER 5 7

Paper 1. Calculator not allowed. Mathematics test. First name. Last name. School. Remember KEY STAGE 3 TIER 5 7 Ma KEY STAGE 3 Mathematics test TIER 5 7 Paper 1 Calculator not allowed First name Last name School 2009 Remember The test is 1 hour long. You must not use a calculator for any question in this test. You

More information

Review of Hashing: Integer Keys

Review of Hashing: Integer Keys CSE 326 Lecture 13: Much ado about Hashing Today s munchies to munch on: Review of Hashing Collision Resolution by: Separate Chaining Open Addressing $ Linear/Quadratic Probing $ Double Hashing Rehashing

More information

Symbol Tables. Introduction

Symbol Tables. Introduction Symbol Tables Introduction A compiler needs to collect and use information about the names appearing in the source program. This information is entered into a data structure called a symbol table. The

More information

PROPERTIES OF ELLIPTIC CURVES AND THEIR USE IN FACTORING LARGE NUMBERS

PROPERTIES OF ELLIPTIC CURVES AND THEIR USE IN FACTORING LARGE NUMBERS PROPERTIES OF ELLIPTIC CURVES AND THEIR USE IN FACTORING LARGE NUMBERS A ver important set of curves which has received considerabl attention in recent ears in connection with the factoring of large numbers

More information

Today s Topics. Primes & Greatest Common Divisors

Today s Topics. Primes & Greatest Common Divisors Today s Topics Primes & Greatest Common Divisors Prime representations Important theorems about primality Greatest Common Divisors Least Common Multiples Euclid s algorithm Once and for all, what are prime

More information

ML for the Working Programmer

ML for the Working Programmer ML for the Working Programmer 2nd edition Lawrence C. Paulson University of Cambridge CAMBRIDGE UNIVERSITY PRESS CONTENTS Preface to the Second Edition Preface xiii xv 1 Standard ML 1 Functional Programming

More information

1MA0/3H Edexcel GCSE Mathematics (Linear) 1MA0 Practice Paper 3H (Non-Calculator) Set C Higher Tier Time: 1 hour 45 minutes

1MA0/3H Edexcel GCSE Mathematics (Linear) 1MA0 Practice Paper 3H (Non-Calculator) Set C Higher Tier Time: 1 hour 45 minutes 1MA0/H Edexcel GCSE Mathematics (Linear) 1MA0 Practice Paper H (Non-Calculator) Set C Higher Tier Time: 1 hour 45 minutes Materials required for examination Ruler graduated in centimetres and millimetres,

More information

Lab 4.4 Secret Messages: Indexing, Arrays, and Iteration

Lab 4.4 Secret Messages: Indexing, Arrays, and Iteration Lab 4.4 Secret Messages: Indexing, Arrays, and Iteration This JavaScript lab (the last of the series) focuses on indexing, arrays, and iteration, but it also provides another context for practicing with

More information

Network Security. HIT Shimrit Tzur-David

Network Security. HIT Shimrit Tzur-David Network Security HIT Shimrit Tzur-David 1 Goals: 2 Network Security Understand principles of network security: cryptography and its many uses beyond confidentiality authentication message integrity key

More information

PYTHAGOREAN TRIPLES KEITH CONRAD

PYTHAGOREAN TRIPLES KEITH CONRAD PYTHAGOREAN TRIPLES KEITH CONRAD 1. Introduction A Pythagorean triple is a triple of positive integers (a, b, c) where a + b = c. Examples include (3, 4, 5), (5, 1, 13), and (8, 15, 17). Below is an ancient

More information

Settling a Question about Pythagorean Triples

Settling a Question about Pythagorean Triples Settling a Question about Pythagorean Triples TOM VERHOEFF Department of Mathematics and Computing Science Eindhoven University of Technology P.O. Box 513, 5600 MB Eindhoven, The Netherlands E-Mail address:

More information

CIS 6930 Emerging Topics in Network Security. Topic 2. Network Security Primitives

CIS 6930 Emerging Topics in Network Security. Topic 2. Network Security Primitives CIS 6930 Emerging Topics in Network Security Topic 2. Network Security Primitives 1 Outline Absolute basics Encryption/Decryption; Digital signatures; D-H key exchange; Hash functions; Application of hash

More information

FAREY FRACTION BASED VECTOR PROCESSING FOR SECURE DATA TRANSMISSION

FAREY FRACTION BASED VECTOR PROCESSING FOR SECURE DATA TRANSMISSION FAREY FRACTION BASED VECTOR PROCESSING FOR SECURE DATA TRANSMISSION INTRODUCTION GANESH ESWAR KUMAR. P Dr. M.G.R University, Maduravoyal, Chennai. Email: geswarkumar@gmail.com Every day, millions of people

More information

4. How many integers between 2004 and 4002 are perfect squares?

4. How many integers between 2004 and 4002 are perfect squares? 5 is 0% of what number? What is the value of + 3 4 + 99 00? (alternating signs) 3 A frog is at the bottom of a well 0 feet deep It climbs up 3 feet every day, but slides back feet each night If it started

More information

Cryptography: Motivation. Data Structures and Algorithms Cryptography. Secret Writing Methods. Many areas have sensitive information, e.g.

Cryptography: Motivation. Data Structures and Algorithms Cryptography. Secret Writing Methods. Many areas have sensitive information, e.g. Cryptography: Motivation Many areas have sensitive information, e.g. Data Structures and Algorithms Cryptography Goodrich & Tamassia Sections 3.1.3 & 3.1.4 Introduction Simple Methods Asymmetric methods:

More information

n 2 + 4n + 3. The answer in decimal form (for the Blitz): 0, 75. Solution. (n + 1)(n + 3) = n + 3 2 lim m 2 1

n 2 + 4n + 3. The answer in decimal form (for the Blitz): 0, 75. Solution. (n + 1)(n + 3) = n + 3 2 lim m 2 1 . Calculate the sum of the series Answer: 3 4. n 2 + 4n + 3. The answer in decimal form (for the Blitz):, 75. Solution. n 2 + 4n + 3 = (n + )(n + 3) = (n + 3) (n + ) = 2 (n + )(n + 3) ( 2 n + ) = m ( n

More information

Principles of Public Key Cryptography. Applications of Public Key Cryptography. Security in Public Key Algorithms

Principles of Public Key Cryptography. Applications of Public Key Cryptography. Security in Public Key Algorithms Principles of Public Key Cryptography Chapter : Security Techniques Background Secret Key Cryptography Public Key Cryptography Hash Functions Authentication Chapter : Security on Network and Transport

More information

Elementary Number Theory and Methods of Proof. CSE 215, Foundations of Computer Science Stony Brook University http://www.cs.stonybrook.

Elementary Number Theory and Methods of Proof. CSE 215, Foundations of Computer Science Stony Brook University http://www.cs.stonybrook. Elementary Number Theory and Methods of Proof CSE 215, Foundations of Computer Science Stony Brook University http://www.cs.stonybrook.edu/~cse215 1 Number theory Properties: 2 Properties of integers (whole

More information

CSE 326, Data Structures. Sample Final Exam. Problem Max Points Score 1 14 (2x7) 2 18 (3x6) 3 4 4 7 5 9 6 16 7 8 8 4 9 8 10 4 Total 92.

CSE 326, Data Structures. Sample Final Exam. Problem Max Points Score 1 14 (2x7) 2 18 (3x6) 3 4 4 7 5 9 6 16 7 8 8 4 9 8 10 4 Total 92. Name: Email ID: CSE 326, Data Structures Section: Sample Final Exam Instructions: The exam is closed book, closed notes. Unless otherwise stated, N denotes the number of elements in the data structure

More information

Sandeep Mahapatra Department of Computer Science and Engineering PEC, University of Technology s.mahapatra15101987@gmail.com

Sandeep Mahapatra Department of Computer Science and Engineering PEC, University of Technology s.mahapatra15101987@gmail.com Computing For Nation Development, March 10 11, 2011 Bharati Vidyapeeth s Institute of Computer Applications and Management, New Delhi A Comparative Evaluation of Various Encryptions Techniques Committing

More information

L. Smithline Math 135 Final Exam Solutions 1

L. Smithline Math 135 Final Exam Solutions 1 L. Smithline Math 135 Final Exam Solutions 1 1. Suppose you have a magic box which has an input slot and an output slot. The box works as follows: If you write a prime number P, a base B, and an integer

More information

RSA and Primality Testing

RSA and Primality Testing and Primality Testing Joan Boyar, IMADA, University of Southern Denmark Studieretningsprojekter 2010 1 / 81 Correctness of cryptography cryptography Introduction to number theory Correctness of with 2

More information

Cryptography and Network Security Prof. D. Mukhopadhyay Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Cryptography and Network Security Prof. D. Mukhopadhyay Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Cryptography and Network Security Prof. D. Mukhopadhyay Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Module No. #01 Lecture No. #10 Symmetric Key Ciphers (Refer

More information

How To Know If A Message Is From A Person Or A Machine

How To Know If A Message Is From A Person Or A Machine The RSA Algorithm Evgeny Milanov 3 June 2009 In 1978, Ron Rivest, Adi Shamir, and Leonard Adleman introduced a cryptographic algorithm, which was essentially to replace the less secure National Bureau

More information

RSA Question 2. Bob thinks that p and q are primes but p isn t. Then, Bob thinks Φ Bob :=(p-1)(q-1) = φ(n). Is this true?

RSA Question 2. Bob thinks that p and q are primes but p isn t. Then, Bob thinks Φ Bob :=(p-1)(q-1) = φ(n). Is this true? RSA Question 2 Bob thinks that p and q are primes but p isn t. Then, Bob thinks Φ Bob :=(p-1)(q-1) = φ(n). Is this true? Bob chooses a random e (1 < e < Φ Bob ) such that gcd(e,φ Bob )=1. Then, d = e -1

More information

Calculate Highest Common Factors(HCFs) & Least Common Multiples(LCMs) NA1

Calculate Highest Common Factors(HCFs) & Least Common Multiples(LCMs) NA1 Calculate Highest Common Factors(HCFs) & Least Common Multiples(LCMs) NA1 What are the multiples of 5? The multiples are in the five times table What are the factors of 90? Each of these is a pair of factors.

More information

7! Cryptographic Techniques! A Brief Introduction

7! Cryptographic Techniques! A Brief Introduction 7! Cryptographic Techniques! A Brief Introduction 7.1! Introduction to Cryptography! 7.2! Symmetric Encryption! 7.3! Asymmetric (Public-Key) Encryption! 7.4! Digital Signatures! 7.5! Public Key Infrastructures

More information

FACTORING LARGE NUMBERS, A GREAT WAY TO SPEND A BIRTHDAY

FACTORING LARGE NUMBERS, A GREAT WAY TO SPEND A BIRTHDAY FACTORING LARGE NUMBERS, A GREAT WAY TO SPEND A BIRTHDAY LINDSEY R. BOSKO I would like to acknowledge the assistance of Dr. Michael Singer. His guidance and feedback were instrumental in completing this

More information

1. The RSA algorithm In this chapter, we ll learn how the RSA algorithm works.

1. The RSA algorithm In this chapter, we ll learn how the RSA algorithm works. MATH 13150: Freshman Seminar Unit 18 1. The RSA algorithm In this chapter, we ll learn how the RSA algorithm works. 1.1. Bob and Alice. Suppose that Alice wants to send a message to Bob over the internet

More information

I PUC - Computer Science. Practical s Syllabus. Contents

I PUC - Computer Science. Practical s Syllabus. Contents I PUC - Computer Science Practical s Syllabus Contents Topics 1 Overview Of a Computer 1.1 Introduction 1.2 Functional Components of a computer (Working of each unit) 1.3 Evolution Of Computers 1.4 Generations

More information

Paper Reference. Ruler graduated in centimetres and millimetres, protractor, compasses, pen, HB pencil, eraser. Tracing paper may be used.

Paper Reference. Ruler graduated in centimetres and millimetres, protractor, compasses, pen, HB pencil, eraser. Tracing paper may be used. Centre No. Candidate No. Paper Reference 1 3 8 0 3 H Paper Reference(s) 1380/3H Edexcel GCSE Mathematics (Linear) 1380 Paper 3 (Non-Calculator) Higher Tier Monday 18 May 2009 Afternoon Time: 1 hour 45

More information

Integer Factorization using the Quadratic Sieve

Integer Factorization using the Quadratic Sieve Integer Factorization using the Quadratic Sieve Chad Seibert* Division of Science and Mathematics University of Minnesota, Morris Morris, MN 56567 seib0060@morris.umn.edu March 16, 2011 Abstract We give

More information

10CS35: Data Structures Using C

10CS35: Data Structures Using C CS35: Data Structures Using C QUESTION BANK REVIEW OF STRUCTURES AND POINTERS, INTRODUCTION TO SPECIAL FEATURES OF C OBJECTIVE: Learn : Usage of structures, unions - a conventional tool for handling a

More information

Grade 6 Math Circles March 10/11, 2015 Prime Time Solutions

Grade 6 Math Circles March 10/11, 2015 Prime Time Solutions Faculty of Mathematics Waterloo, Ontario N2L 3G1 Centre for Education in Mathematics and Computing Lights, Camera, Primes! Grade 6 Math Circles March 10/11, 2015 Prime Time Solutions Today, we re going

More information

Primality Testing and Factorization Methods

Primality Testing and Factorization Methods Primality Testing and Factorization Methods Eli Howey May 27, 2014 Abstract Since the days of Euclid and Eratosthenes, mathematicians have taken a keen interest in finding the nontrivial factors of integers,

More information

Some practice problems for midterm 2

Some practice problems for midterm 2 Some practice problems for midterm 2 Kiumars Kaveh November 15, 2011 Problem: What is the remainder of 6 2000 when divided by 11? Solution: This is a long-winded way of asking for the value of 6 2000 mod

More information

Teachers should read through the following activity ideas and make their own risk assessment for them before proceeding with them in the classroom.

Teachers should read through the following activity ideas and make their own risk assessment for them before proceeding with them in the classroom. Mathematical games Teacher notes Teachers should read through the following activity ideas and make their own risk assessment for them before proceeding with them in the classroom. Aims: To use mathematics

More information

3.2. Solving quadratic equations. Introduction. Prerequisites. Learning Outcomes. Learning Style

3.2. Solving quadratic equations. Introduction. Prerequisites. Learning Outcomes. Learning Style Solving quadratic equations 3.2 Introduction A quadratic equation is one which can be written in the form ax 2 + bx + c = 0 where a, b and c are numbers and x is the unknown whose value(s) we wish to find.

More information

9 Control Statements. 9.1 Introduction. 9.2 Objectives. 9.3 Statements

9 Control Statements. 9.1 Introduction. 9.2 Objectives. 9.3 Statements 9 Control Statements 9.1 Introduction The normal flow of execution in a high level language is sequential, i.e., each statement is executed in the order of its appearance in the program. However, depending

More information

8 Divisibility and prime numbers

8 Divisibility and prime numbers 8 Divisibility and prime numbers 8.1 Divisibility In this short section we extend the concept of a multiple from the natural numbers to the integers. We also summarize several other terms that express

More information

Kenken For Teachers. Tom Davis tomrdavis@earthlink.net http://www.geometer.org/mathcircles June 27, 2010. Abstract

Kenken For Teachers. Tom Davis tomrdavis@earthlink.net http://www.geometer.org/mathcircles June 27, 2010. Abstract Kenken For Teachers Tom Davis tomrdavis@earthlink.net http://www.geometer.org/mathcircles June 7, 00 Abstract Kenken is a puzzle whose solution requires a combination of logic and simple arithmetic skills.

More information

WESTMORELAND COUNTY PUBLIC SCHOOLS 2011 2012 Integrated Instructional Pacing Guide and Checklist Computer Math

WESTMORELAND COUNTY PUBLIC SCHOOLS 2011 2012 Integrated Instructional Pacing Guide and Checklist Computer Math Textbook Correlation WESTMORELAND COUNTY PUBLIC SCHOOLS 2011 2012 Integrated Instructional Pacing Guide and Checklist Computer Math Following Directions Unit FIRST QUARTER AND SECOND QUARTER Logic Unit

More information

CS 103X: Discrete Structures Homework Assignment 3 Solutions

CS 103X: Discrete Structures Homework Assignment 3 Solutions CS 103X: Discrete Structures Homework Assignment 3 s Exercise 1 (20 points). On well-ordering and induction: (a) Prove the induction principle from the well-ordering principle. (b) Prove the well-ordering

More information

Unit 6 Number and Operations in Base Ten: Decimals

Unit 6 Number and Operations in Base Ten: Decimals Unit 6 Number and Operations in Base Ten: Decimals Introduction Students will extend the place value system to decimals. They will apply their understanding of models for decimals and decimal notation,

More information

The application of prime numbers to RSA encryption

The application of prime numbers to RSA encryption The application of prime numbers to RSA encryption Prime number definition: Let us begin with the definition of a prime number p The number p, which is a member of the set of natural numbers N, is considered

More information

Just the Factors, Ma am

Just the Factors, Ma am 1 Introduction Just the Factors, Ma am The purpose of this note is to find and study a method for determining and counting all the positive integer divisors of a positive integer Let N be a given positive

More information

DigitalCommons@University of Nebraska - Lincoln

DigitalCommons@University of Nebraska - Lincoln University of Nebraska - Lincoln DigitalCommons@University of Nebraska - Lincoln MAT Exam Expository Papers Math in the Middle Institute Partnership 7-1-007 Pythagorean Triples Diane Swartzlander University

More information

Cryptography and Network Security Chapter 8

Cryptography and Network Security Chapter 8 Cryptography and Network Security Chapter 8 Fifth Edition by William Stallings Lecture slides by Lawrie Brown (with edits by RHB) Chapter 8 Introduction to Number Theory The Devil said to Daniel Webster:

More information

You must have: Ruler graduated in centimetres and millimetres, protractor, compasses, pen, HB pencil, eraser, calculator. Tracing paper may be used.

You must have: Ruler graduated in centimetres and millimetres, protractor, compasses, pen, HB pencil, eraser, calculator. Tracing paper may be used. Write your name here Surname Other names Edexcel IGCSE Centre Number Mathematics A Paper 3H Monday 6 June 2011 Afternoon Time: 2 hours Candidate Number Higher Tier Paper Reference 4MA0/3H You must have:

More information

Public Key Cryptography: RSA and Lots of Number Theory

Public Key Cryptography: RSA and Lots of Number Theory Public Key Cryptography: RSA and Lots of Number Theory Public vs. Private-Key Cryptography We have just discussed traditional symmetric cryptography: Uses a single key shared between sender and receiver

More information

Introduction to Data Structures

Introduction to Data Structures Introduction to Data Structures Albert Gural October 28, 2011 1 Introduction When trying to convert from an algorithm to the actual code, one important aspect to consider is how to store and manipulate

More information

CSE331: Introduction to Networks and Security. Lecture 20 Fall 2006

CSE331: Introduction to Networks and Security. Lecture 20 Fall 2006 CSE331: Introduction to Networks and Security Lecture 20 Fall 2006 Announcements Homework 2 has been assigned: **NEW DUE DATE** It's now due on Friday, November 3rd. Midterm 2 is Friday, November 10th

More information

CS 3719 (Theory of Computation and Algorithms) Lecture 4

CS 3719 (Theory of Computation and Algorithms) Lecture 4 CS 3719 (Theory of Computation and Algorithms) Lecture 4 Antonina Kolokolova January 18, 2012 1 Undecidable languages 1.1 Church-Turing thesis Let s recap how it all started. In 1990, Hilbert stated a

More information

Lab 11. Simulations. The Concept

Lab 11. Simulations. The Concept Lab 11 Simulations In this lab you ll learn how to create simulations to provide approximate answers to probability questions. We ll make use of a particular kind of structure, called a box model, that

More information

FOREWORD. Executive Secretary

FOREWORD. Executive Secretary FOREWORD The Botswana Examinations Council is pleased to authorise the publication of the revised assessment procedures for the Junior Certificate Examination programme. According to the Revised National

More information

Insight Guide. Encryption: A Guide

Insight Guide. Encryption: A Guide Encryption: A Guide for Beginners If you read anything about information security, you re likely to have come across the word encryption. It s a fundamental building block when it comes to securing your

More information