Computer Science Canada Programming C, C++, Java, PHP, Ruby, Turing, VB   Username:   Password: Wiki   Blog   Search   Turing   Chat Room  Members
Help with Computer Science Assignment
Author Message
xoxoxoxoxo

Posted: Mon Sep 17, 2012 8:06 am   Post subject: Help with Computer Science Assignment

I am a student in university currently enrolled in an advanced programming class. For an assignment, we were asked to prove that:
For all Nats x, for all Nats y, plus x y = add x y
Definitions:
plus x Z = x
plus x (S y) = S (plus x y)

I started attempting to prove this by using the structural method (which is like mathematical induction). The base step (proving for y = Z) is easy, but I can't seem to get through the induction step:
We assume that for a Nat w, plus x w = add x w
We want to prove that plus x (S w) = add x (S w), so:
plus x (S w) = S (plus x w) [from definition of plus]
= S (add x w) [from inductive hypothesis]
= ???

Posted: Mon Sep 17, 2012 7:06 pm   Post subject: Re: Help with Computer Science Assignment

Ah, good ol' CS 145, I miss that class. I personally feel that that the first assignments are very important, thus I'm afraid I can't help you.

However, you're on the right track.

Don't worry too much about it. If you're still stumped talk to classmates or go see Prabhakar during office hours.
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

Page 1 of 1  [ 2 Posts ]
 Jump to:  Select a forum  CompSci.ca ------------ - Network News - General Discussion     General Forums   -----------------   - Hello World   - Featured Poll   - Contests     Contest Forums   -----------------   - DWITE   - [FP] Contest 2006/2008   - [FP] 2005/2006 Archive   - [FP] 2004/2005 Archive   - Off Topic     Lounges   ---------   - User Lounge   - VIP Lounge     Programming -------------- - General Programming     General Programming Forums   --------------------------------   - Functional Programming   - Logical Programming   - C     C   --   - C Help   - C Tutorials   - C Submissions   - C++     C++   ----   - C++ Help   - C++ Tutorials   - C++ Submissions   - Java     Java   -----   - Java Help   - Java Tutorials   - Java Submissions   - Ruby     Ruby   -----   - Ruby Help   - Ruby Tutorials   - Ruby Submissions   - Turing     Turing   --------   - Turing Help   - Turing Tutorials   - Turing Submissions   - PHP     PHP   ----   - PHP Help   - PHP Tutorials   - PHP Submissions   - Python     Python   --------   - Python Help   - Python Tutorials   - Python Submissions   - Visual Basic and Other Basics     VB   ---   - Visual Basic Help   - Visual Basic Tutorials   - Visual Basic Submissions     Education ----------- - Student Life   Graphics and Design ----------------------- - Web Design     Web Design Forums   ---------------------   - (X)HTML Help   - (X)HTML Tutorials   - Flash MX Help   - Flash MX Tutorials   - Graphics     Graphics Forums   ------------------   - Photoshop Tutorials   - The Showroom   - 2D Graphics   - 3D Graphics     Teams ------ - dTeam Public

 Style: Appalachia blueSilver eMJay subAppalachia subBlue subCanvas subEmjay subGrey subSilver subVereor Search: