A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing


  • one year ago

in lec8: isn't exp3(a,b) linear? Shouldn't it say (b%2)*b != b instead of (b%2)*2 == b (b%2 can only be 0 or 1 so I don't see when this is true other than for b = 0?) to make it log? Or am i missing something (that is not entirely unlikely since I've been studying too many hours today)? here is the copy pasted code (can't get the indenting to work here but it isn't that important I guess): def exp3(a,b): if b == 1: return a if (b%2)*2 == b: return exp3(a*a, b/2) else: return a*exp3(a,b-1)

  • This Question is Open

    Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy

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...


  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • 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.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.