Mathematics Common Math Approaches

Slides:



Advertisements
Similar presentations
Section 5.4 – Properties of Logarithms. Simplify:
Advertisements

22C:19 Discrete Math Sequence and Sums Fall 2011 Sukumar Ghosh.
Data Structures, Spring 2004 © L. Joskowicz 1 Data Structures – LECTURE 3 Recurrence equations Formulating recurrence equations Solving recurrence equations.
Data Structures, Spring 2006 © L. Joskowicz 1 Data Structures – LECTURE 3 Recurrence equations Formulating recurrence equations Solving recurrence equations.
Fundamental in Computer Science Recursive algorithms 1.
Section 4.3: Fermat’s Little Theorem Practice HW (not to hand in) From Barr Text p. 284 # 1, 2.
Unit 11, Part 2: Day 1: Introduction To Logarithms.
1 Chapter 24 Developing Efficient Algorithms. 2 Executing Time Suppose two algorithms perform the same task such as search (linear search vs. binary search)
Solving Exponential and Logarithmic Equations Section 8.6.
Chapter 1 Introduction. Goals Why the choice of algorithms is so critical when dealing with large inputs Basic mathematical background Review of Recursion.
Intro to Logarithms Goes along with 4.4 (GREEN book) Quiz: 1/12/10 Logs Test: 1/21/10.
Math 3 - Module 6 Honors Topics.
Question : How many different ways are there to climb a staircase with n steps (for example, 100 steps) if you are allowed to skip steps, but not more.
Solving Exponential Equations. We can solve exponential equations using logarithms. By converting to a logarithm, we can move the variable from the exponent.
CS 206 Introduction to Computer Science II 09 / 18 / 2009 Instructor: Michael Eckmann.
Lecture 2.5: Sequences CS 250, Discrete Structures, Fall 2014 Nitesh Saxena Adopted from previous lectures by Zeph Grunschlag.
CES 592 Theory of Software Systems B. Ravikumar (Ravi) Office: 124 Darwin Hall.
TCSS 342 Autumn 2004 Version TCSS 342 Data Structures & Algorithms Autumn 2004 Ed Hong.
Sequences Lecture 11. L62 Sequences Sequences are a way of ordering lists of objects. Java arrays are a type of sequence of finite size. Usually, mathematical.
Sequences and Sums.
Problem Solving: Brute Force Approaches
CS 2210 (22C:19) Discrete Structures Sequence and Sums
Analysis of Algorithms
Algorithmic complexity: Speed of algorithms
IGCSE 6 Cambridge Effectiveness of algorithms Computer Science
ID1050– Quantitative & Qualitative Reasoning
CSE373: Data Structures and Algorithms Lecture 3: Math Review; Algorithm Analysis Catie Baker Spring 2015.
The Art of Problem Solving
CS 2210:0001 Discrete Structures Sequence and Sums
Introduction to Computer Science - Alice
Analysis of Algorithms
5.4 Logarithmic Functions and Models
Some Basics for Problem Analysis and Solutions
Problem Solving: Brute Force Approaches
Applied Algorithms (Lecture 17) Recursion Fall-23
(Clickers & computer – Online Book)
Arithmetic & Geometric Sequences
Ch 3.3: Properties of Logarithms
Data Structures and Algorithms
1.7 - Geometric sequences and series, and their
Warm-up: 1. For an arithmetic sequence, , find,
11.3 – Geometric Sequences.
Section 11.1 Sequences.
Arithmetic Expressions & Data Conversions
Mathematics Basic Math and Combinatorics
CS 250, Discrete Structures, Fall 2015
CS 101 – Sept. 4 Number representation Integer Unsigned √ Signed √
Solving Recurrence Relations by Iteration
CS 2210:0001 Discrete Structures Sequence and Sums
Algorithmic complexity: Speed of algorithms
CS 250, Discrete Structures, Fall 2013
Copyright © Zeph Grunschlag,
Recurrences (Method 4) Alexandra Stefan.
CSE 2010: Algorithms and Data Structures Algorithms
CSE 373: Data Structures & Algorithms
Analysis of Algorithms
Warm Up Look for a pattern and predict the next number or expression in the list , 500, 250, 125, _____ 2. 1, 2, 4, 7, 11, 16, _____ 3. 1, −3,
Recursion Taken from notes by Dr. Neil Moore
Algorithmic complexity: Speed of algorithms
Analysis of Algorithms
CS210- Lecture 2 Jun 2, 2005 Announcements Questions
10/31/12 Recognizing patterns Describe the growth pattern of this sequence of blocks. Illustrate the sequences of blocks for 4, 5, and 6. Try creating.
Cryptography Lecture 18.
Cryptography Lecture 16.
Logarithmic Functions
Analysis of Algorithms
Do Now 1/10/19 Take out HW from last night. Copy HW in your planner.
Sequences.
Arithmetic Expressions & Data Conversions
Presentation transcript:

Mathematics Common Math Approaches

Math in Problems Many problems can be simplified with some analysis ahead of time Doing some analysis of the problem ahead of time can make a seemingly complex or long-running problem go much faster Not always a simplification, but sometimes need to think mathematically. Brute Force is sometimes the right approach, but avoid unnecessary work E.g. read lots of numbers, how many are < k? Answer: do O(n) loop and count. Do NOT sort the numbers.

Finding Patterns Often there will be a pattern, but not always obvious Can try to generate several elements of a sequence, to try to ID the pattern Takes some experience to recognize patterns Generate by hand first, before getting computer to do it Generate the first few elements by brute force, so that you can try to discern a pattern. Look for solutions that could use Dynamic Programming Look for well-known sequences

Common Sequences Arithmetic: a+bi Geometric: a ri Other sequences: Let an = a+(n-1)b Then the sum from a1 to an is n(a1+an)/2 e.g. n(n+1)/2 Geometric: a ri Sum from a1 to an is a(1-rn)/(1-r) if r<1. Other sequences: Fibonacci Factorial Catalan, etc.

Logarithms Can simplify many operations Convert multiplication sequence to addition, or exponentiation to multiplication Solve the easier problem, then take exponent (if needed) Can use to convert from one base to another

Java BigInteger Provides arbitrary precision integer math When an unsigned long long is not large enough to hold Operates much slower than HW-supported integer operations Unfortunately, only available in Java So, if it’s needed, you need to code in Java Has other features Convert to Bases GCD Modulo arithmetic Probabilistic Prime Testing See book, section 5.3