   This is blowin my mind
Function where the issue isQuote:Consider the following problem:    Imagine the owner of a movie theater who has complete freedom in setting ticket prices. The more he charges, the fewer the people who can afford tickets. In a recent experiment the owner determined a precise relationship between the price of a ticket and average attendance. At a price of $5.00 per ticket, 120 people attend a performance. Decreasing the price by a dime ($.10) increases attendance by 15. Unfortunately, the increased attendance also comes at an increased cost. Every performance costs the owner $180. Each attendee costs another four cents ($0.04). The owner would like to know the exact relationship between profit and ticket price so that he can determine the price at which he can make the highest profit. Now the code they came up with is this: ;; How to design a program (define (profit ticket-price)  (- (revenue ticket-price)(cost ticket-price)))(define (revenue ticket-price)  (*  (attendees ticket-price) ticket-price))(define (cost ticket-price)  (+ 180 (* .04 (attendees ticket-price))))(define (attendees ticket-price)  (+ 120(* (/ 15 .10) (- 5.00 ticket-price))))I can follow everything but the attendees function. How are they coming up with that equation? My poor little brain does not compute. Really the (/15 .10) is what's throwing me off.sidenote: is there a source lang="scheme" for the forums?   
  15 / .10 is the number of attendees gained per dollar decrease in admission. Consider if you could buy 15 bananas for 10 cents. How many bananas could you get for a dollar?   ;  It's a little easier to follow in a language which syntax is actually meant for human consumption.def attendees( ticket-price )    # people + (increase_in_attendance / dollar) * (original_ticket_price - ticket_price)    120 + (15 / 0.10) * (5.00 - ticket-price)end;  Decreasing the price by a dime increases attendance by 15, as the problem description states. As such, (/ 15 .10) is the number of attendees added per dollar removed. Then you multiply that by $5 minus the actual ticket price (meaning if you charge <$5 you get an additional 150 attendees per dollar below $5).EDIT: Yarr! Beat me to it!   ;  Once I saw read the Sneftel's explanation and "u"'s code, it clicked! Everyone gets ++rate!   