# NCPC 2013 Presentation of solutions

 To view this video please enable JavaScript, and consider upgrading to a web browser that supports HTML5 video
Save this PDF as:

Size: px
Start display at page:

## Transcription

1 NCPC 2013 Presentation of solutions Head of Jury: Lukáš Poláček

2 NCPC Jury authors Andreas Björklund (LTH) Jaap Eldering (Imperial) Daniel Espling (UMU) Christian Ledig (Imperial) Ulf Lundström (KTH) Stefan Pszczolkowski (Imperial) Michał Pilipczuk (UIB) Lukáš Poláček (KTH) Andreas Schuh (Imperial) Fredrik Svensson (Autoliv Electronics) Marc Vinyals (KTH)

3 G Erase Securely Given binary hard disk content before and after described safe file removal procedure, decide whether it was successful. Solution Insight: Each time the file is overwritten, all of its bits are flipped Odd-th number of overwrite: flips all bits once Even-th number of overwrite: Undoes previous flipping In case of odd number of total overwrites, all bits must appear as if flipped once for the removal to be considered successful. Otherwise, both binary strings must be identical. Author: Ulf Lundström, Andreas Schuh

4 A Planting Trees Find an optimal planting schedule to minimize the earliest date when all the trees are mature. Insight and Solution Insight: It is optimal to plant the trees in descending order of growth times. Proof: If any two trees are not in this order, then swapping them cannot increase the result. Solution: Sort the trees by decreasing growth times, and output max(position + growth time + 1). Time complexity: O(n log n). Author: Michał Pilipczuk

5 F Timebomb (1/2) Translate ASCII digits into memory variables Insight and Solution Insight: The code is not known until the input has been read completely. Store the ASCII representation in memory, e.g., matrix of char and compute the number of digits from the string length. Translate the code into a number by using the appropiate power of 10 for each digit and compute the sum of them. Stop if we find an invalid digit. Check if the number is zero modulo 6. But, what if the problem would have allowed 100-digit codes? Author: Stefan Pszczolkowski

6 F Timebomb (2/2) Alternative solution Compute the sum of the digits. Use the fact that a number is divisible by 6 if it is an even number and the sum of its digits is divisible by 3. Author: Stefan Pszczolkowski

7 E Virus Replication Find the minimum substring that needs to be changed to turn one string into another. ACCGTCA ACCTTGCA Insight The beginning and end of the two strings should be identical up until the change. Solution First difference from start of strings marks start of change. First difference from end of strings marks end of change. Check that the start of the change is before its end in both strings. Author: Ulf Lundström

8 D Robert Hood Find the longest distance between any pair of points in a set. Insights and Solution Insight: The interesting points are those in the convex hull of the set. Find the convex hull using a known fast algorithm. Insight: The small integer coordinate range [ 1000, 1000] means that the number of points on the convex hull will be reasonably small. An algorithm with N 2 complexity is sufficiently fast to find the longest distance, i.e. you can examine all possible pairs of points on the hull. Author: Daniel Espling

9 B Boiling Vegetables Find the minimum number of cuts of vegetables, such that the smallest and largest piece are not very different. Insights and Algorithm Insight: All cut pieces of one vegetable are of the same weight. Loop over all possible candidates for the largest weight piece. For each vegetable piece, calculate how many cuts are needed to get all resulting pieces weigh at most the assumed maximum. Check if they are heavy enough to pass the ratio T from the input. Optimizations: Go to a next candidate for the largest piece if you already cut too many pieces. Complexity is 500N log N. Author: Andreas Björklund and Lukáš Poláček

10 J Dartboard Calculate the expected score of throwing one dart. Insights and Solution Insight: The problem is radially symmetric after you average the numbers of all pies. Insight: The integral over the radial variable r can be calculated explicitly. The final result can be calculated in constant time as a sum of the scores over six different radius intervals. Alternatively, a sufficiently efficient numerical integration scheme can also be used. Author: Jaap Eldering

11 C Number Trick (1/2) Given X find numbers A for which moving the first digit to the end of the number is equivalent of multiplying by X. Insight Assume A has n digits and starts with the digit A 0. Moving the first digit to the end then turns it into which should equal A X, so A = (A 10 n A 0 ) 10 + A 0, A X = 10A (10 n+1 1)A 0 A = 10n X A 0 Author: Ulf Lundström

12 C Number Trick (2/2) Solution Loop over the number of digits n and all starting digits A 0 to check whether the A obtained from is a valid solution. A = 10n X A 0 Author: Ulf Lundström

13 K Cliff Walk Find the furthest reachable point while staying clear of the tide. Insights and Algorithm Find the earliest entry and latest exit time for all squares using the provided formula. Run shortest path from home at t = 0 to all positions. Run shortest path from home at t = 12 to all positions, but backwards in time. Use priority queue to make algorithm run fast. Insight: go through the map and see where arrival time is earlier than departure time. Return the maximum of the distances to these squares. Author: Fredrik Svensson

14 I Dance Reconstruction (1/2) Given a permutation, find its kth root. Permutation Exponentiation Example: Take permutation to the 20th power A cycle of length 20 breaks down into 20 cycles of length 1 Length 30: 10 3 Length 40: 20 2 Number of cycles: greatest common divisor of 20 and length A solution should merge small cycles back into big ones Author: Lukáš Poláček

15 I Dance Reconstruction (2/2) Algorithm Decompose input into cycles Insight: When merging m cycles of length l into one cycle of length m l, gcd(m l, k) must be m Example: If k = 20 = and l = 2, m must be a multiple of 4 If p q k and p l, m must be a multiple of p q. m = gcd(l, k) gives wrong answer Carefully place elements on the big cycle Author: Lukáš Poláček

16 H Pinball Simulate ball falling down a pinball board Solution Sweep board as ball falls Event queue, sorted by y Events: Add/erase segment, possible ball hit Search tree with segments, sorted by x at current y Query: which segment would the ball hit? Update: add/erase segment Insight: No intersections = order in the tree independent of y Author: Marc Vinyals

### KTH Challenge 2013. Solutions. Further Information KTH Challenge 2013. April 21, 2013

April 21, Jury Lukáš Poláček (, Spotify), head of jury Per Austrin () Oskar Werkelin Ahlin (Spotify) Ulf Lundström () Marc Vinyals () Erik Aas () Emma Enström () Andreas Lundblad () B Peragrams Only one

### MLR Institute of Technology

MLR Institute of Technology DUNDIGAL 500 043, HYDERABAD COMPUTER SCIENCE AND ENGINEERING Computer Programming Lab List of Experiments S.No. Program Category List of Programs 1 Operators a) Write a C program

### Why? A central concept in Computer Science. Algorithms are ubiquitous.

Analysis of Algorithms: A Brief Introduction Why? A central concept in Computer Science. Algorithms are ubiquitous. Using the Internet (sending email, transferring files, use of search engines, online

### Multimedia Communications. Huffman Coding

Multimedia Communications Huffman Coding Optimal codes Suppose that a i -> w i C + is an encoding scheme for a source alphabet A={a 1,, a N }. Suppose that the source letter a 1,, a N occur with relative

### Lesson 17: Graphing the Logarithm Function

Lesson 17 Name Date Lesson 17: Graphing the Logarithm Function Exit Ticket Graph the function () = log () without using a calculator, and identify its key features. Lesson 17: Graphing the Logarithm Function

### Sequences with MS

Sequences 2008-2014 with MS 1. [4 marks] Find the value of k if. 2a. [4 marks] The sum of the first 16 terms of an arithmetic sequence is 212 and the fifth term is 8. Find the first term and the common

### C programming: exercise sheet L2-STUE (2011-2012)

C programming: exercise sheet L2-STUE (2011-2012) Algorithms and Flowcharts Exercise 1: comparison Write the flowchart and associated algorithm that compare two numbers a and b. Exercise 2: 2 nd order

### Shortest Path Algorithms

Shortest Path Algorithms Jaehyun Park CS 97SI Stanford University June 29, 2015 Outline Cross Product Convex Hull Problem Sweep Line Algorithm Intersecting Half-planes Notes on Binary/Ternary Search Cross

### 2013 Five years Integrated M.Sc.(IT) Semester 1 060010101 - Fundamentals of Programming

03 Five years Integrated M.Sc.(IT) Semester 00000 - Fundamentals Programming File should contain. Problem Statement. Algorithm 3. Flowchart. Program in C language(code) 5. Output and sample calculation

### Two General Methods to Reduce Delay and Change of Enumeration Algorithms

ISSN 1346-5597 NII Technical Report Two General Methods to Reduce Delay and Change of Enumeration Algorithms Takeaki Uno NII-2003-004E Apr.2003 Two General Methods to Reduce Delay and Change of Enumeration

### Homework 5 Solutions

Homework 5 Solutions 4.2: 2: a. 321 = 256 + 64 + 1 = (01000001) 2 b. 1023 = 512 + 256 + 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = (1111111111) 2. Note that this is 1 less than the next power of 2, 1024, which

### Grade 5, Ch. 1 Math Vocabulary

Grade 5, Ch. 1 Math Vocabulary rectangular array number model fact family factors product factor pair divisible by divisibility rules prime number composite number square array square number exponent exponential

### 12 Abstract Data Types

12 Abstract Data Types 12.1 Source: Foundations of Computer Science Cengage Learning Objectives After studying this chapter, the student should be able to: Define the concept of an abstract data type (ADT).

### Lecture 2: The Complexity of Some Problems

IAS/PCMI Summer Session 2000 Clay Mathematics Undergraduate Program Basic Course on Computational Complexity Lecture 2: The Complexity of Some Problems David Mix Barrington and Alexis Maciel July 18, 2000

### TECHNICAL UNIVERSITY OF CRETE DATA STRUCTURES FILE STRUCTURES

TECHNICAL UNIVERSITY OF CRETE DEPT OF ELECTRONIC AND COMPUTER ENGINEERING DATA STRUCTURES AND FILE STRUCTURES Euripides G.M. Petrakis http://www.intelligence.tuc.gr/~petrakis Chania, 2007 E.G.M. Petrakis

### Report on the Train Ticketing System

Report on the Train Ticketing System Author: Zaobo He, Bing Jiang, Zhuojun Duan 1.Introduction... 2 1.1 Intentions... 2 1.2 Background... 2 2. Overview of the Tasks... 3 2.1 Modules of the system... 3

### Objective Specification, design and implementation of an ADT in C/C++. Using generic elements and iterators.

ADTs containers of generic elements and iterators Objective Specification, design and implementation of an ADT in C/C++. Using generic elements and iterators. Theoretical aspects Representation of an ADT

### 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

### Factoring and Applications

Factoring and Applications What is a factor? The Greatest Common Factor (GCF) To factor a number means to write it as a product (multiplication). Therefore, in the problem 48 3, 4 and 8 are called the

### Repetition and Loops. Additional Python constructs that allow us to effect the (1) order and (2) number of times that program statements are executed.

New Topic Repetition and Loops Additional Python constructs that allow us to effect the (1) order and (2) number of times that program statements are executed. These constructs are the 1. while loop and

### International Journal of Advanced Research in Computer Science and Software Engineering

Volume 3, Issue 7, July 23 ISSN: 2277 28X International Journal of Advanced Research in Computer Science and Software Engineering Research Paper Available online at: www.ijarcsse.com Greedy Algorithm:

### VALLIAMMAI ENGINEERING COLLEGE SRM NAGAR, KATTANKULATHUR 603 203 DEPARTMENT OF COMPUTER APPLICATIONS QUESTION BANK IN REVISED BLOOM S TAXONOMY

ACADEMIC YEAR: 0 7 VALLIAMMAI ENGINEERING COLLEGE SRM NAGAR, KATTANKULATHUR 0 0 SEMESTER: ODD BRANCH: MCA YEAR: I SEMESTER: I SUBJECT CODE AND NAME: MC70 Problem Solving and Programming NAME OF THE FACULTY

### If A is divided by B the result is 2/3. If B is divided by C the result is 4/7. What is the result if A is divided by C?

Problem 3 If A is divided by B the result is 2/3. If B is divided by C the result is 4/7. What is the result if A is divided by C? Suggested Questions to ask students about Problem 3 The key to this question

### 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

### 8 Memory Management. 8.1 Requirements. 8 Memory Management Protection Relocation INTRODUCTION TO MEMORY MANAGEMENT OPERATING SYSTEMS

OPERATING SYSTEMS INTRODUCTION TO MEMORY MANAGEMENT 1 8 Memory Management In a multiprogramming system, in order to share the processor, a number of processes must be kept in. Memory management is achieved

### Theorem A graph T is a tree if, and only if, every two distinct vertices of T are joined by a unique path.

Chapter 3 Trees Section 3. Fundamental Properties of Trees Suppose your city is planning to construct a rapid rail system. They want to construct the most economical system possible that will meet the

### Mathematics of Cryptography Modular Arithmetic, Congruence, and Matrices. A Biswas, IT, BESU SHIBPUR

Mathematics of Cryptography Modular Arithmetic, Congruence, and Matrices A Biswas, IT, BESU SHIBPUR McGraw-Hill The McGraw-Hill Companies, Inc., 2000 Set of Integers The set of integers, denoted by Z,

### FBCA-02 April-2007 Programming in C Language BCA-102 (New Course)

Seat No. : FBCA-02 April-2007 Programming in C Language BCA-102 (New Course) Time : 3 Hours] [Max. Marks : 70 Instructions : (1) Figures to the right indicate full marks of the question. (2) Make and state

### CS2 Algorithms and Data Structures Note 11. Breadth-First Search and Shortest Paths

CS2 Algorithms and Data Structures Note 11 Breadth-First Search and Shortest Paths In this last lecture of the CS2 Algorithms and Data Structures thread we will consider the problem of computing distances

### CSE373: Data Structures and Algorithms Lecture 3: Math Review; Algorithm Analysis. Linda Shapiro Winter 2015

CSE373: Data Structures and Algorithms Lecture 3: Math Review; Algorithm Analysis Linda Shapiro Today Registration should be done. Homework 1 due 11:59 pm next Wednesday, January 14 Review math essential

### Social Media Mining. Graph Essentials

Graph Essentials Graph Basics Measures Graph and Essentials Metrics 2 2 Nodes and Edges A network is a graph nodes, actors, or vertices (plural of vertex) Connections, edges or ties Edge Node Measures

### RIT scores between 191 and 200

Measures of Academic Progress for Mathematics RIT scores between 191 and 200 Number Sense and Operations Whole Numbers Solve simple addition word problems Find and extend patterns Demonstrate the associative,

### 7. The solutions of a quadratic equation are called roots. SOLUTION: The solutions of a quadratic equation are called roots. The statement is true.

State whether each sentence is true or false. If false, replace the underlined term to make a true sentence. 1. The axis of symmetry of a quadratic function can be found by using the equation x =. The

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

Study Group 1 Variables and Types 1. Define: (a) Variable, (b) Constant, (c) Type, (d) Enumerated Type, (e) Identifier. 2. What does the byte 00100110 represent? 3. What is the purpose of the declarations

### YOU CAN COUNT ON NUMBER LINES

Key Idea 2 Number and Numeration: Students use number sense and numeration to develop an understanding of multiple uses of numbers in the real world, the use of numbers to communicate mathematically, and

### The Laws of Cryptography Cryptographers Favorite Algorithms

2 The Laws of Cryptography Cryptographers Favorite Algorithms 2.1 The Extended Euclidean Algorithm. The previous section introduced the field known as the integers mod p, denoted or. Most of the field

### A fairly quick tempo of solutions discussions can be kept during the arithmetic problems.

Distributivity and related number tricks Notes: No calculators are to be used Each group of exercises is preceded by a short discussion of the concepts involved and one or two examples to be worked out

### PRIMES 2017 Math Problem Set

Dear PRIMES applicant: PRIMES 2017 Math Problem Set This is the PRIMES 2017 Math Problem Set. Please send us your solutions as part of your PRIMES application by the application deadline (December 1, 2016).

### A. V. Gerbessiotis CS Spring 2014 PS 3 Mar 24, 2014 No points

A. V. Gerbessiotis CS 610-102 Spring 2014 PS 3 Mar 24, 2014 No points Problem 1. Suppose that we insert n keys into a hash table of size m using open addressing and uniform hashing. Let p(n, m) be the

### DATA OBFUSCATION. What is data obfuscation?

DATA OBFUSCATION What data obfuscation? Data obfuscations break the data structures used in the program and encrypt literals. Th method includes modifying inheritance relations, restructuring arrays, etc.

### 4.4 The recursion-tree method

4.4 The recursion-tree method Let us see how a recursion tree would provide a good guess for the recurrence = 3 4 ) Start by nding an upper bound Floors and ceilings usually do not matter when solving

### Outline. NP-completeness. When is a problem easy? When is a problem hard? Today. Euler Circuits

Outline NP-completeness Examples of Easy vs. Hard problems Euler circuit vs. Hamiltonian circuit Shortest Path vs. Longest Path 2-pairs sum vs. general Subset Sum Reducing one problem to another Clique

### Information Theory and Coding Prof. S. N. Merchant Department of Electrical Engineering Indian Institute of Technology, Bombay

Information Theory and Coding Prof. S. N. Merchant Department of Electrical Engineering Indian Institute of Technology, Bombay Lecture - 14 Non-Binary Huffman Code and Other Codes In the last class we

### Lecture 1: Course overview, circuits, and formulas

Lecture 1: Course overview, circuits, and formulas Topics in Complexity Theory and Pseudorandomness (Spring 2013) Rutgers University Swastik Kopparty Scribes: John Kim, Ben Lund 1 Course Information Swastik

### 2.3 Scheduling jobs on identical parallel machines

2.3 Scheduling jobs on identical parallel machines There are jobs to be processed, and there are identical machines (running in parallel) to which each job may be assigned Each job = 1,,, must be processed

### Grade 7 & 8 Math Circles October 19, 2011 Prime Numbers

1 University of Waterloo Faculty of Mathematics Centre for Education in Mathematics and Computing Grade 7 & 8 Math Circles October 19, 2011 Prime Numbers Factors Definition: A factor of a number is a whole

### Hierarchical Cluster Analysis Some Basics and Algorithms

Hierarchical Cluster Analysis Some Basics and Algorithms Nethra Sambamoorthi CRMportals Inc., 11 Bartram Road, Englishtown, NJ 07726 (NOTE: Please use always the latest copy of the document. Click on this

### GCE Computing. COMP3 Problem Solving, Programming, Operating Systems, Databases and Networking Report on the Examination.

GCE Computing COMP3 Problem Solving, Programming, Operating Systems, Databases and Networking Report on the Examination 2510 Summer 2014 Version: 1.0 Further copies of this Report are available from aqa.org.uk

### MATHCOUNTS TOOLBOX Facts, Formulas and Tricks

MATHCOUNTS TOOLBOX Facts, Formulas and Tricks MATHCOUNTS Coaching Kit 40 I. PRIME NUMBERS from 1 through 100 (1 is not prime!) 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 II.

### SQUARE-SQUARE ROOT AND CUBE-CUBE ROOT

UNIT 3 SQUAREQUARE AND CUBEUBE (A) Main Concepts and Results A natural number is called a perfect square if it is the square of some natural number. i.e., if m = n 2, then m is a perfect square where m

### Sample Questions Csci 1112 A. Bellaachia

Sample Questions Csci 1112 A. Bellaachia Important Series : o S( N) 1 2 N N i N(1 N) / 2 i 1 o Sum of squares: N 2 N( N 1)(2N 1) N i for large N i 1 6 o Sum of exponents: N k 1 k N i for large N and k

### Arrangements And Duality

Arrangements And Duality 3.1 Introduction 3 Point configurations are tbe most basic structure we study in computational geometry. But what about configurations of more complicated shapes? For example,

### The Tower of Hanoi. Recursion Solution. Recursive Function. Time Complexity. Recursive Thinking. Why Recursion? n! = n* (n-1)!

The Tower of Hanoi Recursion Solution recursion recursion recursion Recursive Thinking: ignore everything but the bottom disk. 1 2 Recursive Function Time Complexity Hanoi (n, src, dest, temp): If (n >

### Expression. Variable Equation Polynomial Monomial Add. Area. Volume Surface Space Length Width. Probability. Chance Random Likely Possibility Odds

Isosceles Triangle Congruent Leg Side Expression Equation Polynomial Monomial Radical Square Root Check Times Itself Function Relation One Domain Range Area Volume Surface Space Length Width Quantitative

### Theory of Computation Prof. Kamala Krithivasan Department of Computer Science and Engineering Indian Institute of Technology, Madras

Theory of Computation Prof. Kamala Krithivasan Department of Computer Science and Engineering Indian Institute of Technology, Madras Lecture No. # 31 Recursive Sets, Recursively Innumerable Sets, Encoding

### Grade 7/8 Math Circles Fall 2012 Factors and Primes

1 University of Waterloo Faculty of Mathematics Centre for Education in Mathematics and Computing Grade 7/8 Math Circles Fall 2012 Factors and Primes Factors Definition: A factor of a number is a whole

### = 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

### Copy in your notebook: Add an example of each term with the symbols used in algebra 2 if there are any.

Algebra 2 - Chapter Prerequisites Vocabulary Copy in your notebook: Add an example of each term with the symbols used in algebra 2 if there are any. P1 p. 1 1. counting(natural) numbers - {1,2,3,4,...}

### 1 Point Inclusion in a Polygon

Comp 163: Computational Geometry Tufts University, Spring 2005 Professor Diane Souvaine Scribe: Ryan Coleman Point Inclusion and Processing Simple Polygons into Monotone Regions 1 Point Inclusion in a

### Computational Geometry. Lecture 1: Introduction and Convex Hulls

Lecture 1: Introduction and convex hulls 1 Geometry: points, lines,... Plane (two-dimensional), R 2 Space (three-dimensional), R 3 Space (higher-dimensional), R d A point in the plane, 3-dimensional space,

### Chapter 2 Data Storage

Chapter 2 22 CHAPTER 2. DATA STORAGE 2.1. THE MEMORY HIERARCHY 23 26 CHAPTER 2. DATA STORAGE main memory, yet is essentially random-access, with relatively small differences Figure 2.4: A typical

### Bits, Bytes, and Codes

Bits, Bytes, and Codes Telecommunications 1 Peter Mathys Black and White Image Suppose we want to draw a B&W image on a computer screen. We first subdivide the screen into small rectangles or squares called

### Vector storage and access; algorithms in GIS. This is lecture 6

Vector storage and access; algorithms in GIS This is lecture 6 Vector data storage and access Vectors are built from points, line and areas. (x,y) Surface: (x,y,z) Vector data access Access to vector

### Merge Sort. 2004 Goodrich, Tamassia. Merge Sort 1

Merge Sort 7 2 9 4 2 4 7 9 7 2 2 7 9 4 4 9 7 7 2 2 9 9 4 4 Merge Sort 1 Divide-and-Conquer Divide-and conquer is a general algorithm design paradigm: Divide: divide the input data S in two disjoint subsets

### Binary Heaps * * * * * * * / / \ / \ / \ / \ / \ * * * * * * * * * * * / / \ / \ / / \ / \ * * * * * * * * * *

Binary Heaps A binary heap is another data structure. It implements a priority queue. Priority Queue has the following operations: isempty add (with priority) remove (highest priority) peek (at highest

### 1. What s wrong with the following proofs by induction?

ArsDigita University Month : Discrete Mathematics - Professor Shai Simonson Problem Set 4 Induction and Recurrence Equations Thanks to Jeffrey Radcliffe and Joe Rizzo for many of the solutions. Pasted

### EE602 Algorithms GEOMETRIC INTERSECTION CHAPTER 27

EE602 Algorithms GEOMETRIC INTERSECTION CHAPTER 27 The Problem Given a set of N objects, do any two intersect? Objects could be lines, rectangles, circles, polygons, or other geometric objects Simple to

### Programming in Engineering PiE CTW-MSM Exam C/C++ (2012)

1 Programming in Engineering PiE CTW-MSM 191158510 Exam C/C++ (2012) 2 Instructions Present your results in a report that includes a short explanation of your approach, answer to the questions, what you

### Parallel Prime Sieve: Finding Prime Numbers

Parallel Prime Sieve: Finding Prime Numbers David J. Wirian Institute of Information & Mathematical Sciences Massey University at Albany, Auckland, New Zealand dwir001@gmail.com ABSTRACT Before the 19

### Euclidean Minimum Spanning Trees Based on Well Separated Pair Decompositions Chaojun Li. Advised by: Dave Mount. May 22, 2014

Euclidean Minimum Spanning Trees Based on Well Separated Pair Decompositions Chaojun Li Advised by: Dave Mount May 22, 2014 1 INTRODUCTION In this report we consider the implementation of an efficient

### Memory Management. memory hierarchy

Memory Management Ideally programmers want memory that is large fast non volatile Memory hierarchy small amount of fast, expensive memory cache some medium-speed, medium price main memory gigabytes of

### Data Structure [Question Bank]

Unit I (Analysis of Algorithms) 1. What are algorithms and how they are useful? 2. Describe the factor on best algorithms depends on? 3. Differentiate: Correct & Incorrect Algorithms? 4. Write short note:

### Introduction Number Systems and Conversion

UNIT 1 Introduction Number Systems and Conversion Objectives 1. Introduction The first part of this unit introduces the material to be studied later. In addition to getting an overview of the material

### 24: Polygon Partition - Faster Triangulations

24: Polygon Partition - Faster Triangulations CS 473u - Algorithms - Spring 2005 April 15, 2005 1 Previous lecture We described triangulations of simple polygons. See Figure 1 for an example of a polygon

### Balanced search trees

Lecture 8 Balanced search trees 8.1 Overview In this lecture we discuss search trees as a method for storing data in a way that supports fast insert, lookup, and delete operations. (Data structures handling

### Discrete Mathematics Problems

Discrete Mathematics Problems William F. Klostermeyer School of Computing University of North Florida Jacksonville, FL 32224 E-mail: wkloster@unf.edu Contents 0 Preface 3 1 Logic 5 1.1 Basics...............................

Task: ASC Ascending Paths You are visiting the Royal Botanical Gardens. In the gardens there are n intersections connected by m roads. The intersections are numbered from 1 to n. Each road connects two

### Section 1.1. Introduction to R n

The Calculus of Functions of Several Variables Section. Introduction to R n Calculus is the study of functional relationships and how related quantities change with each other. In your first exposure to

### IMPROVING PERFORMANCE OF RANDOMIZED SIGNATURE SORT USING HASHING AND BITWISE OPERATORS

Volume 2, No. 3, March 2011 Journal of Global Research in Computer Science RESEARCH PAPER Available Online at www.jgrcs.info IMPROVING PERFORMANCE OF RANDOMIZED SIGNATURE SORT USING HASHING AND BITWISE

### Count the Dots Binary Numbers

Activity 1 Count the Dots Binary Numbers Summary Data in computers is stored and transmitted as a series of zeros and ones. How can we represent words and numbers using just these two symbols? Curriculum

### CSE 120 Principles of Operating Systems

CSE 120 Principles of Operating Systems Fall 2004 Lecture 11: Page Replacement Geoffrey M. Voelker Memory Management Last lecture on memory management: Goals of memory management To provide a convenient

### 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

### Mathematical induction. Niloufar Shafiei

Mathematical induction Niloufar Shafiei Mathematical induction Mathematical induction is an extremely important proof technique. Mathematical induction can be used to prove results about complexity of

### Category 3 Number Theory Meet #1, October, 2000

Category 3 Meet #1, October, 2000 1. For how many positive integral values of n will 168 n be a whole number? 2. What is the greatest integer that will always divide the product of four consecutive integers?

### Trees and structural induction

Trees and structural induction Margaret M. Fleck 25 October 2010 These notes cover trees, tree induction, and structural induction. (Sections 10.1, 4.3 of Rosen.) 1 Why trees? Computer scientists are obsessed

### Mathematics Vocabulary List For Pre-Algebra

Mathematics Vocabulary List For Pre-Algebra 1. Absolute Value - the distance from a number to zero on a number line. It is always positive. l-6 l = 6 l -25 l = 25 l 6 l = 6 l 25 l = 25 2. Associative Property

### Fractions and Decimals

Fractions and Decimals Tom Davis tomrdavis@earthlink.net http://www.geometer.org/mathcircles December 1, 2005 1 Introduction If you divide 1 by 81, you will find that 1/81 =.012345679012345679... The first

### Big Data and Scripting. Part 4: Memory Hierarchies

1, Big Data and Scripting Part 4: Memory Hierarchies 2, Model and Definitions memory size: M machine words total storage (on disk) of N elements (N is very large) disk size unlimited (for our considerations)

### The finite field with 2 elements The simplest finite field is

The finite field with 2 elements The simplest finite field is GF (2) = F 2 = {0, 1} = Z/2 It has addition and multiplication + and defined to be 0 + 0 = 0 0 + 1 = 1 1 + 0 = 1 1 + 1 = 0 0 0 = 0 0 1 = 0

### Steven Skiena. skiena

Lecture 3: Recurrence Relations (1997) Steven Skiena Department of Computer Science State University of New York Stony Brook, NY 11794 4400 http://www.cs.sunysb.edu/ skiena Argue the solution to T(n) =

### Florida Math for College Readiness

Core Florida Math for College Readiness Florida Math for College Readiness provides a fourth-year math curriculum focused on developing the mastery of skills identified as critical to postsecondary readiness

### APP INVENTOR. Test Review

APP INVENTOR Test Review Main Concepts App Inventor Lists Creating Random Numbers Variables Searching and Sorting Data Linear Search Binary Search Selection Sort Quick Sort Abstraction Modulus Division

### Chapter 1. Computation theory

Chapter 1. Computation theory In this chapter we will describe computation logic for the machines. This topic is a wide interdisciplinary field, so that the students can work in an interdisciplinary context.

### Introduction to Programming (in C++) Loops. Jordi Cortadella, Ricard Gavaldà, Fernando Orejas Dept. of Computer Science, UPC

Introduction to Programming (in C++) Loops Jordi Cortadella, Ricard Gavaldà, Fernando Orejas Dept. of Computer Science, UPC Example Assume the following specification: Input: read a number N > 0 Output:

### INTRODUCTION TO PROOFS: HOMEWORK SOLUTIONS

INTRODUCTION TO PROOFS: HOMEWORK SOLUTIONS STEVEN HEILMAN Contents 1. Homework 1 1 2. Homework 2 6 3. Homework 3 10 4. Homework 4 16 5. Homework 5 19 6. Homework 6 21 7. Homework 7 25 8. Homework 8 28

### Adobe Marketing Cloud Data Workbench Monitoring Profile

Adobe Marketing Cloud Data Workbench Monitoring Profile Contents Data Workbench Monitoring Profile...3 Installing the Monitoring Profile...5 Workspaces for Monitoring the Data Workbench Server...8 Data

### Example. Introduction to Programming (in C++) Loops. The while statement. Write the numbers 1 N. Assume the following specification:

Example Introduction to Programming (in C++) Loops Assume the following specification: Input: read a number N > 0 Output: write the sequence 1 2 3 N (one number per line) Jordi Cortadella, Ricard Gavaldà,

### Chapter 6 Programming the LC-3

Chapter 6 Programming the LC-3 ased on slides McGraw-Hill Additional material 24/25/26 Lewis/Martin Aside: ooting the Computer How does it all begin? We have LC-3 hardware and a program, but what next?