Assignment 3 - Solutions

Assignment 3 - Solutions - NAME SID LAB SECTION February 9...

Info icon This preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
NAME LAB SECTION SID February 9, 2007 Assignment 3: Functions by Restriction and Simple Recursion 100 pts for problems Formatting: (-1 if any part of heading is incorrect, -1 for no assignment title, -1 if no page numbering, -1 if problems not numbered and labeled, -1 if incorrect filename or not in pdf format) take off all allotted points for each formatting aspect if any of each is not correct Problem 1: Getting to Know Boolean Operators (10) 1.1 Matlab uses a 1 to denote a true statement. Matlab uses a 0 to denote a false statement. +1 for both right 1.2 Note there are infinitely many possible input pairs. These are just examples. The important thing is that the outputs are 1. EDU>> gt(2,1) ans = 1 EDU>> lt(1,2) ans = 1 EDU>> eq(1,1) ans = 1 EDU>> ge(2,1) ans = 1 EDU>> le(1,2) ans = 1 EDU>> ne(0,1) ans = 1 +1 for all ones 1.3 EDU>> and(or(1,0), xor(0,1)) ans = 1 +1 1
Image of page 1

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

View Full Document Right Arrow Icon