TutorMe homepage

SIGN IN

Start Free Trial

William Z.

Tutor for 4 Years, Experienced and Patient

Tutor Satisfaction Guarantee

Python Programming

TutorMe

Question:

Create a python program that reverses a linked list.

William Z.

Answer:

def reverse(list): list.prev = None list.current = list.head while(list.current is not None): list.next = list.current.next list.current.next = list.prev list.prev = list.current list.current = list.next list.head = list.prev This program recursively loops through a linked list, continually moving the front of the linked list to the back, until the end of the list is at the front of the list.

Calculus

TutorMe

Question:

A window is being built and the bottom is a rectangle and the top is a semicircle. If there is 12 meters of framing materials what must the dimensions of the window be to let in the most light?

William Z.

Answer:

Basically, this question is asking you to maximize the area of the window so that it is able to receive the most light. Now, we know that the area of the rectangle is width * height, and the area of the circle is pi*radius^2 (For those that did not know, ^2 denotes the preceding number to the power of 2. In an optimization problem, we have a equation to optimize and a constraint equation. Our constraint is that the perimeter of our window must be 12 meters long and we are attempting to maximize the area. Now, note that the width of the rectangle is equal to the diameter of the semicircle. We denote the radius of the circle as r. Now, the circumference of a circle is 2*pi*r, so that of a semicircle is pi*r. The perimeter of the rest of the window is 2r (width) + 2*L (length of the rectangle). Note that we did not use the standard perimeter of rectangles because one of the sides is not included. We have now derived our constraint equation 12 = pi*r + 2*r + 2*L. Now, we must find the equation we are aiming to optimize. Since the area of a circle is pi*r^2, then the area of a semicircle is (1/2)*pi*r^2. The area of the square portion is 2r (width) * 2L (length). Thus, putting all of those components together, we have our optimization equation, A = (1/2)*pi*r^2 + 2r * 2L. So, we solve the constraint for L and plug it into the optimization equation: 2L = 12 - pi*r - 2r L = 6 - 0.5pi*r - r So, A = 0.5pi*r^2 + 2r * (6 - 0.5pi*r - r). Simplifying, A = -0.5pi*r^2 + 12r + 2r^2 Taking the first derivative, A' = -pi*r + 12 - 4r Taking the second derivative, A'' = -pi - 4. Plugging in 0 for A', we have the critical point r = 12/(4 + pi). We can also see that the second derivative is always negative, which means our critical point must denote a maximum. So, plugging our critical point back into the original equation, we will get the optimal radius of 1.6803 and an optimal rectangle dimension of 3.3606 * 1.6803.

Algebra

TutorMe

Question:

You collect stamps. John decides to quadruple your stamps. Pearl gives you another 8 stamps. Miguel gives you another 22 stamps. Since you're nice, you give Sharon 80 stamps. Jose gives you another 10 stamps. At the end you have 60. How many stamps did you start with?

William Z.

Answer:

Since you ended up with 60 stamps, you had 60-10 = 50 stamps before Jose gave you 10 stamps. Then, since you gave Sharon 80 stamps, that means you had 50 + 80 = 130 stamps before you gave Sharon the stamps. Therefore, before Miguel gave you 22 stamps, you had 130 - 22 = 108 stamps, and before Pearl gave you 8 stamps, you had 108-8 = 100 stamps. Now, since John quadrupled the number of stamps you had, that means you started out with 100/4 = 25 stamps.

Send a message explaining your

needs and William will reply soon.

needs and William will reply soon.

Contact William

Ready now? Request a lesson.

Start Session

FAQs

What is a lesson?

A lesson is virtual lesson space on our platform where you and a tutor can communicate.
You'll have the option to communicate using video/audio as well as text chat.
You can also upload documents, edit papers in real time and use our cutting-edge virtual whiteboard.

How do I begin a lesson?

If the tutor is currently online, you can click the "Start Session" button above.
If they are offline, you can always send them a message to schedule a lesson.

Who are TutorMe tutors?

Many of our tutors are current college students or recent graduates of top-tier universities
like MIT, Harvard and USC.
TutorMe has thousands of top-quality tutors available to work with you.

Made in California

© 2019 TutorMe.com, Inc.