A community for students.
Here's the question you clicked on:
 0 viewing
anonymous
 4 years ago
I'm having trouble on the 2.3 Math Module exercise. Maybe it's because I'm not great at math, but I have no idea what the angle_test or ceiling_test functions should look like. Any help?
anonymous
 4 years ago
I'm having trouble on the 2.3 Math Module exercise. Maybe it's because I'm not great at math, but I have no idea what the angle_test or ceiling_test functions should look like. Any help?

This Question is Closed

anonymous
 4 years ago
Best ResponseYou've already chosen the best response.0Just took a quick look at problem statement. angle_test and ceiling_test are not functions. They are just variables being assigned values. Looks like part 2 is only there to get some practice using the functions imported with the math module. The only one that should give you pause is the base 7 log. Normally, we think in terms of base 10 log or base e log. But the documents for the log function describes how to specify the base (default base is e, the natural log function).

anonymous
 4 years ago
Best ResponseYou've already chosen the best response.0I'm struggling with this too because I don't understand the instruction for 2.3 part 2:"Underneath your function definition, computer the following values using multadd and print out the result." I'm just not sure what's being asked for. You can get the output they want with this statement, but it doesn't use your multadd function: print "sin(pi/4) + cos(pi/4)/2 is: ", (math.sin(math.pi/4)+ math.cos(math.pi/4)/2)

anonymous
 4 years ago
Best ResponseYou've already chosen the best response.0You can use your multadd function. It looks rather contrived, though. I guess you could try it without using multadd and then repeat it forcing the use of multadd. angle_test = multadd( 0.5, cos(...), sin(...) and similarly ceiling_test = multadd( 2.0, log(...), ceil(...)) I, personally, don't see much value in using multadd here, but I'll go through the exercise just to confirm that my multadd function produces the correct result.

anonymous
 4 years ago
Best ResponseYou've already chosen the best response.0Okay, so I get: angle_test= multadd(math.sin(math.pi/4), 0.5, math.sin(math.pi/4)) print "sin(pi/4) + cos(pi/4)/2 is: \n", angle_test Seems a long way to go. I guess I was overthinking it, thanks. Oddly the ceiling function comes out at 16.55etc rather than 17.55etc. as in their example.

anonymous
 4 years ago
Best ResponseYou've already chosen the best response.0Thanks, I've gotten the angle_test one to work, just trying to get syntax correct for the ceiling_test, but I'm getting there.

anonymous
 4 years ago
Best ResponseYou've already chosen the best response.0So my answer isn't right, but it's at least working. I understand the concepts so I'm moving on :)

anonymous
 4 years ago
Best ResponseYou've already chosen the best response.0exchaoordo, I had the same result  16.55... instead of 17.55... I realised that being exactly 1.0 off the right answer must have had something to do with the ceiling function rounding up, combined with the truncation that happens when you divide with integers rather than floats. Changing one of my integers (19) to a float (19.0) gave me the correct answer: print multadd(math.log(12,7), 2.0, math.ceil(276/19)) >>>16.5539788165 print multadd(math.log(12,7), 2.0, math.ceil(276/19.0)) >>>17.5539788165
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.