A community for students.
Here's the question you clicked on:
 0 viewing
MOOCE
 3 years ago
The Mystery of the Missing Code: At about minute 20 of lecture 6 in 6.00SC (which is part of the week 5 assignment of the Mechanical MOOC course), Professor Grimson throws in two examples of code for recursive definitions that are not included in the downloadable code file. Has anyone out there recreated this code, and if so, can you share out?
MOOCE
 3 years ago
The Mystery of the Missing Code: At about minute 20 of lecture 6 in 6.00SC (which is part of the week 5 assignment of the Mechanical MOOC course), Professor Grimson throws in two examples of code for recursive definitions that are not included in the downloadable code file. Has anyone out there recreated this code, and if so, can you share out?

This Question is Closed

Screech
 3 years ago
Best ResponseYou've already chosen the best response.2Went to look at lecture 6. The code display is almost illegible. I zoomed in and the first looks like def simpleExp(b, n): if n == 0: return 1 else: return n * simpleExp( b, n1) and a few minutes later in the lecture after his demonstration with the stacking toy, he presents the Hanoi function def Hanoi(n, f, t, s): if n == 1: print "Move from " + f + " to " + t else: Hanoi( n1, f, s, t ) Hanoi( 1, f, t, s) Hanoi( n1, s, t, f ) I haven't coded or tested this but it seems to fit with what he presented and make sense logically. Was this what you wanted? Yeah it can be a real eyestrain trying to make out that fuzzy video sometimes.

MOOCE
 3 years ago
Best ResponseYou've already chosen the best response.0@Screech Yeah, that looks like the goods. Thanks for capturing!

JohnM
 3 years ago
Best ResponseYou've already chosen the best response.0What is a) the point of simpleExp and b) what is it doing (specifically, n * simpleExp( b, n1)? If I plug in b=4, n=3 I sort of see that it's moving through 3 x 2 x 1 = 6. But I get output 6 whether b is 4, 44, 72 etc. and n remains 3. Ultimately b is ignored. What are we supposed to learn from this?

Screech
 3 years ago
Best ResponseYou've already chosen the best response.2How about return b * simpleExp( b, n1) I could barely discern the letters and I made a quick guess. Might make more sense in order to raise b to the nth power (simulating b ** n)

JohnM
 3 years ago
Best ResponseYou've already chosen the best response.0This is what I frustrates me about MOOC's "Gentle Python" course. Too much of how about this, how about that, with people left scratching heads. My post has been up for around 24 hours and notice that no one from MOOC has jumped in with an authoritative answer. Another substantive MIT homework question I asked about a week ago has also gone unaddressed. Yet MOOC tells us in its weekly email to send our questions to OpenStudy  where there is no timely help with the MIT homework, at least in my experience. Meanwhile, give Codecademy credit. They have several moderators who jump in pretty quick and provided excellent direction and insight, or plain answers if you're really stuck. Plus some people who have programming experience who, though new to Python, know from past experience with Ruby or whatever how to include underlying logic in their advice.

MOOCE
 3 years ago
Best ResponseYou've already chosen the best response.0@JohnM Sorry to hear you aren't getting as much help as you'd like. We knew from the beginning that running a course without the direct involvement of subject matter experts was a risk, and it obviously comes up short at times. Over time, we hope we'll build a community that is larger a more responsive. In the mean time, we salute learners like @Screech who are spending a lot of their time helping others!
Ask your own question
Sign UpFind more explanations on OpenStudy
Your question is ready. Sign up for free to start getting answers.
spraguer
(Moderator)
5
→ View Detailed Profile
is replying to Can someone tell me what button the professor is hitting...
23
 Teamwork 19 Teammate
 Problem Solving 19 Hero
 Engagement 19 Mad Hatter
 You have blocked this person.
 ✔ You're a fan Checking fan status...
Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.