lecture05_unary

# lecture05_unary - COMPSCI 102 Discrete Mathematics for...

This preview shows pages 1–20. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: COMPSCI 102 Discrete Mathematics for Computer Science Lecture 5 Ancient Wisdom: Unary and Binary 1 2 3 4 Prehistoric Unary Hang on a minute! Isnt unary too literal as a representation? Does it deserve to be an abstract representation? Its important to respect each representation, no matter how primitive Unary is a perfect example Consider the problem of finding a formula for the sum of the first n numbers You already used induction to verify that the answer is n(n+1) 1 + 2 3 n-1 n S + + + + = 1 + 2 n-1 n S + + n-2 + + = n+1 + n+1 n+1 n+1 2S + + n+1 + + = n(n+1) = 2S S = n(n+1) 2 1 + 2 3 n-1 n S + + + + = 1 + 2 n-1 n S + + n-2 + + = n(n+1) = 2S 1 2 . . . . . . . . n n . . . . . . . 2 1 There are n(n+1) dots in the grid! S = n(n+1) 2 n th Triangular Number n = 1 + 2 + 3 + . . . + n-1 + n = n(n+1)/2 n th Square Number n = n 2 = n + n-1 Breaking a square up in a new way Breaking a square up in a new way 1 Breaking a square up in a new way 1 + 3 Breaking a square up in a new way 1 + 3 + 5 Breaking a square up in a new way 1 + 3 + 5 + 7 Breaking a square up in a new way 1 + 3 + 5 + 7 + 9 1 + 3 + 5 + 7 + 9 = 5 2 Breaking a square up in a new way Pythagoras The sum of the first n odd numbers is n 2 Here is an alternative dot proof of the same sum. sum....
View Full Document

## This document was uploaded on 01/17/2012.

### Page1 / 48

lecture05_unary - COMPSCI 102 Discrete Mathematics for...

This preview shows document pages 1 - 20. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online