
-----------------------------------
x-ecutioner
Fri Mar 27, 2009 9:07 pm

math topic arranging to descending
-----------------------------------
hi guys
im learning scheme
one of the excercises is to:
Define the program convert3. It consumes three digits, starting with the least significant digit, followed by the next most significant one, and so on. The program produces the corresponding number. For example, the expected value of

(convert3 1 2 3) 

is 321.

im googling away but any ideas?
bare in mind they waant it algebraically.
i havent learnt anything so far (as in like conditional statements or loops). its actaully the first page on basic constants.

thanks.

-----------------------------------
Prabhakar Ragde
Sat Mar 28, 2009 7:06 am

RE:math topic arranging to descending
-----------------------------------
I'd prefer not to see solutions to HtDP problems posted here, please.

I would also advise you to not Google for answers. The point is not to write down the answer, or to look at a correct answer and understand it. The point is to go through the exercise of figuring out the answer yourself.

In this case, you have to compute the number 321 (three hundred and twenty one) from the individual numbers 1, 2, 3, in a general fashion. So your function will look like

(define (convert3 a b c)
  ...)

where you fill in the ... with some expression involving a,b,c.

That's not too hard, if you think about it.

-----------------------------------
x-ecutioner
Sat Mar 28, 2009 10:38 pm

RE:math topic arranging to descending
-----------------------------------
oh i didnt know
im not arguging
but more out of curiousity, why is posting the problem considered objectionable?

ill look into your advice though thanks:)

i tried figuring it out myself for quite some time
i didnt tihnk itd hurt if i got help online and learn from this experience

-----------------------------------
Tony
Sat Mar 28, 2009 11:53 pm

Re: RE:math topic arranging to descending
-----------------------------------
but more out of curiousity, why is posting the problem considered objectionable?
Posting problems is not objectionable; the solutions are.

The point is not to write down the answer, or to look at a correct answer and understand it. The point is to go through the exercise of figuring out the answer yourself.

-----------------------------------
Prabhakar Ragde
Sun Mar 29, 2009 7:06 am

RE:math topic arranging to descending
-----------------------------------
It's fine to ask for help here.

I just wanted to make it clear (not just to you, but to everyone reading) that the help offered should be in the form of a gentle hint and not a complete solution.

It's typically hard to get gentle hints by Googling, which is why I don't think it's a good idea if the goal is to teach yourself something.

-----------------------------------
zero-impact
Sun Mar 29, 2009 6:09 pm

RE:math topic arranging to descending
-----------------------------------
Try thinking about the ones column, the tens column etc..

-----------------------------------
saltpro15
Sun Mar 29, 2009 8:03 pm

RE:math topic arranging to descending
-----------------------------------
quick question : I've heard scheme is taught at the first year of Waterloo CS/SE . Is this correct?

-----------------------------------
Prabhakar Ragde
Sun Mar 29, 2009 9:38 pm

RE:math topic arranging to descending
-----------------------------------
More so in CS (in fact for everyone in the Faculty of Math). The SE coverage is pretty minimal.

-----------------------------------
wtd
Sun Mar 29, 2009 10:15 pm

Re: RE:math topic arranging to descending
-----------------------------------
quick question : I've heard scheme is taught at the first year of Waterloo CS/SE . Is this correct?

And it's a wonderful thing.  :-)

-----------------------------------
wtd
Sun Mar 29, 2009 10:23 pm

Re: RE:math topic arranging to descending
-----------------------------------
Try thinking about the ones column, the tens column etc..

Listen to this.  Zero-impact's giving you good advice.

-----------------------------------
wtd
Sun Mar 29, 2009 10:24 pm

Re: math topic arranging to descending
-----------------------------------
hi guys
i havent learnt anything so far (as in like conditional statements or loops). its actaully the first page on basic constants.

Good.  Scheme doesn't have conditional statements or procedural loops.

-----------------------------------
Prabhakar Ragde
Mon Mar 30, 2009 5:38 am

RE:math topic arranging to descending
-----------------------------------
Don't frighten him.
