Genome Sciences 373 Genome Informatics Quiz Section #1 March 31, 2015.

Slides:



Advertisements
Similar presentations
CS107 Introduction to Computer Science Lecture 2.
Advertisements

LECTURE 1 CMSC 201. Overview Goal: Problem solving and algorithm development. Learn to program in Python. Algorithm - a set of unambiguous and ordered.
Lecture 1: Overview CMSC 201 Computer Science 1 (Prof. Chang version)
Introduction to Computer Programming I CSE 113
CS101- Lecture 11 CS101 Fall 2004 Course Introduction Professor Douglas Moody –Monday – 12:00-1:40 – – –Web Site: websupport1.citytech.cuny.edu.
Syllabus 1. Go to Click Analysis of Algorithms link 4. bookmark course website  Important.
A High-Level Model For Software Development
Programming Fundamentals (750113) Ch1. Problem Solving
Review Algorithm Analysis Problem Solving Space Complexity
Math 010 online work that was due today at the start of class:
Computer Science 101 Introduction to Programming.
Chapter Seven Advanced Shell Programming. 2 Lesson A Developing a Fully Featured Program.
Introducing Java.
Introduction CSE 1310 – Introduction to Computers and Programming
CS223 Algorithms D-Term 2013 Instructor: Mohamed Eltabakh WPI, CS Introduction Slide 1.
An ordered sequence of unambiguous and well-defined instructions that performs some task and halts in finite time Let's examine the four parts of this.
COMP 111 Programming Languages 1 First Day. Course COMP111 Dr. Abdul-Hameed Assawadi Office: Room AS15 – No. 2 Tel: Ext. ??
PCSpim How to Program ?. Some Resource There are some useful online document! You can find the links on our TAs’ website. tw/~xdd/Arc06/
Programming. What is a Program ? Sets of instructions that get the computer to do something Instructions are translated, eventually, to machine language.
General Programming Introduction to Computing Science and Programming I.
CS 114 – Class 02 Topics  Computer programs  Using the compiler Assignments  Read pages for Thursday.  We will go to the lab on Thursday.
Computer Programming TCP1224 Chapter 3 Completing the Problem-Solving Process and Getting Started with C++
Input, Output, and Processing
By the end of this session you should be able to...
What does a computer program look like: a general overview.
PHY 1405 Conceptual Physics (CP 1) Spring 2010 Cypress Campus.
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
Class 1: What this course is about. Assignment Read: Chapter 1 Read: Chapter 1 Do: Chapter 1 ‘workbook’ pages not finished in class Do: Chapter 1 ‘workbook’
CS 100Lecture 11 Welcome to CS 100 n Goal: Learn to write intelligible, correct computer programs n Language: Java (but the language should not be the.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 2 Input, Processing, and Output.
PROBLEM SOLVING WITH LOOPS Chapter 7. Concept of Repetition Structure Logic It is a computer task, that is used for Repeating a series of instructions.
COMP 171: Data Types John Barr. Review - What is Computer Science? Problem Solving  Recognizing Patterns  If you can find a pattern in the way you solve.
Chapter 7 Low-Level Programming Languages. 2 Chapter Goals List the operations that a computer can perform Discuss the relationship between levels of.
CS 100 Introduction to Computing Seminar September 21, 2015.
Conditional Statements.  Quiz  Hand in your jQuery exercises from last lecture  They don't have to be 100% perfect to get full credit  They do have.
CSC 1010 Programming for All Lecture 3 Useful Python Elements for Designing Programs Some material based on material from Marty Stepp, Instructor, University.
CPSC 217 T03 Week VI Part #2: Midterm Review Session Hubert (Sathaporn) Hu.
Algorithm Discovery and Design Objectives: Interpret pseudocode Write pseudocode, using the three types of operations: * sequential (steps in order written)
8.1 8 Algorithms Foundations of Computer Science  Cengage Learning.
Flowchart. a diagram of the sequence of movements or actions of people or things involved in a complex system or activity. a graphical representation.
Algorithms and Pseudocode
ALGORITHMS AND FLOWCHARTS. Why Algorithm is needed? 2 Computer Program ? Set of instructions to perform some specific task Is Program itself a Software.
Lecture #1: Introduction to Algorithms and Problem Solving Dr. Hmood Al-Dossari King Saud University Department of Computer Science 6 February 2012.
Chapter 1: Introduction to Computers and Programming.
Intro. to Computer Programming Eng. Nehal A. Mohamed Spring Semester-2016.
Low-Level Programming Languages, Pseudocode and Testing Chapter 6.
C++ Programming Basics C++ Lecture 1 Stacy MacAllister.
All materials copyright UMBC unless otherwise noted CMSC201 Computer Science I for Majors Lecture 02 – Algorithmic Thinking.
CSc 120 Introduction to Computer Programing II
Introduction to Algorithms
3.1 Fundamentals of algorithms
Topics Designing a Program Input, Processing, and Output
CSIS 104 –Intro. To Computer Science
C++ Basic Syntax – Homework Exercises
Unit 2 Smarter Programming.
Lecture 2 Introduction to Programming
Algorithm and Ambiguity
Learning to Program in Python
1) C program development 2) Selection structure
Introduction to Algorithms and Programming
Programming We have seen various examples of programming languages
Introduction to Algorithms
Topics Designing a Program Input, Processing, and Output
CMSC201 Computer Science I for Majors Final Exam Information
Tonga Institute of Higher Education IT 141: Information Systems
Topics Designing a Program Input, Processing, and Output
Tonga Institute of Higher Education IT 141: Information Systems
Administrivia- Introduction
WJEC GCSE Computer Science
Hardware is… Software is…
Presentation transcript:

Genome Sciences 373 Genome Informatics Quiz Section #1 March 31, 2015

About me, course logistics, etc. Matthew’s contact info Phone: Office hours:Mondays 2:00-3:00pm Foege building, room S110 …or by appointment

About me, course logistics, etc. Homework policy: No late homework accepted without PRIOR arrangements Grading is equally about your effort and your execution First homework assigned tomorrow

About me, course logistics, etc. What is the quiz section all about? not a “how-to” homework session mostly we will learn Python and review in-class material attendance is not required, but the material covered in section is required

Questions about course logistics?

What is an algorithm? Formally: an exact procedure, or set of instructions, to achieve a predictable final result from a given input Colloquially: a thorough method for solving a problem according to step-by- step instructions

Some key features of algorithms Typically written in “pseudocode” or similar Inputs and outputs specified at the outset Often designed to achieve some goal in the “best” way possible fastest least memory most accurate

Example of an algorithm: smallest number Algorithm FindSmallestNumber Input: three numbers A, B, and C Output: the largest number Find the smallest of three numbers

Example of an algorithm: smallest number Algorithm FindSmallestNumber Input: three numbers A, B, and C Output: the largest number current_smallest  A if B < current_smallest: current_smallest  B else: [do nothing] if C < current_smallest: current_smallest  C [… else: do nothing] return current_smallest Find the smallest of three numbers

Example of an algorithm: smallest number Algorithm FindSmallestNumber Input: three numbers A, B, and C Output: the largest number current_smallest  A if B < current_smallest: current_smallest  B else: [do nothing] if C < current_smallest: current_smallest  C [… else: do nothing] return current_smallest Find the smallest of three numbers

Find the greatest common divisor of two numbers If A > B, and A & B have greatest common divisor G, then G is also the GCD of A and (A – B) Example: A = 63, B = 18 What is the GCD? Can we generalize this process as a set of rules or steps to follow to ALWAYS find the GCD? Another example: Euclid’s algorithm

Algorithm EuclidGCD Input: two numbers: A and B Output: the GCD of A and B Find the greatest common divisor of two numbers Another example: Euclid’s algorithm

Algorithm EuclidGCD Input: two numbers: A and B Output: the GCD of A and B start: if B = 0 then output A (else: keep going) if A > B then A  A – B else B  B – A go to start Find the greatest common divisor of two numbers Another example: Euclid’s algorithm

Source: art.svg Often we can draw an algorithm as a flowchart What’s the problem with this flowchart? How could we improve it?

Common pitfalls and issues to consider What if I enter a zero? What if I enter a negative number? What if I enter a fraction? Is my algorithm guaranteed to ever finish?

In class example: algorithm for factorial Recall: for any positive integer k, k! = k * (k -1) * (k-2) * … * 1 What is an algorithm for calculating the factorial?

Algorithms are not the same as computer code! But, algorithms can be implemented in programming languages You have already done hard work!

Why do we program? Get Stuff Done. –Automate repeated tasks –Extract information from huge amounts of data –Manipulate or convert data to get it in the right format

What tools do we need to write a program? Variables Flow control Syntax Grammar Patience Practice Comments Internet Technical stuffImportant stuff

What tools do we need to write a program? Variables Flow control Syntax Grammar Patience Practice Comments Internet Technical stuffImportant stuff Editor Interpreter Practical stuff Today: focus on editor & interpreter

SublimeText: PyCharm: Python Editors: too many choices!

The Python Interpreter Typing your script line-by-line: not a good plan

The Python Interpreter Write your script in an editor, and then “call” it or “run” it from the command line

In-class example: Hello, world!

And now, a few comments about comments

What is a comment in code? A comment is a line, or part of a line, that is skipped by the interpreter. In other words, it’s not interpreted. It’s just there. In python, comments start with the pound sign (“#”)

Why do we comment our code? Help yourself remember what you were thinking Help other people understand what you were thinking Help your grader figure out what you were trying to do, and what went wrong!

Commenting for beginners Your homework MUST HAVE COMMENTS It’s OK to “over-comment” Usually you put comments just above / before the part of the program you’re referring to