text: # Homework Help: Uniform probability density function question
  
  1. Nov 18, 2007
  
  ### 1daj
  
  1. The problem statement, all variables and given/known data
  
  A vendor at a market buys mushrooms from a wholesaler for $3 a pound, and sells them for$4 a pound. The daily demand (in pounds) from custumers for the vendor;s mushrooms is a random variable X with pdf
  f(x) = 1/40 if 0 (greater than) x (less than) 40 and 0 elsewhere
  Unsold mushrooms must be thrown out at the end of the day.
  Suppose that the vendor buys a constant amount, say C pounds, of mushrooms from the wholesaler at the beginning of each day (0 (less than) C (greater than) 40). Find the expected value of the vendor's daily profit.
  
  2. Relevant equations
  
  3. The attempt at a solution
  
  I am really confused as to how to set up the solution to this problem and this is how i set it up:
  
  E(profit) = 4 E(demand) - 3C = 4 (integral from 0 to c) x/40 dx - 3C
  = 4 (c^2)/80 - 3C
  = (c^2)/20 -3C
  What troubles me about this solution is that the expected profit is never positive. Furthermore I think my problem is with finding the the Expected demand
  Any help is greatly appreciated.
  
  2. Nov 18, 2007
  
  ### Dick
  
  The problem comes from cutting off your x integral at C. If the demand x is greater than C, then you still make a profit. The function you really want the expectation value of is min(C,x). Integrate that from 0 to 40.
  
  3. Nov 18, 2007
  
  ### e(ho0n3
  
  Setting the upper limit of the integral to C implies that the demand can be at most C. The demand can be greater than C as Dick pointed out. The upper limit should be 40 since anything above 40 does not contribute to value of the integral.
  
  But why min(C,x) though? The expected value of the demand should not be influenced by C.
  
  4. Nov 18, 2007
  
  ### Dick
  
  If the demand is greater than C, then you still can only sell C. You don't want the expectation value of the demand, you want the expectation value of how much you can sell.
  
  5. Nov 18, 2007
  
  ### 1daj
  
  confused
  
  Function of min(C,x)? I'm confused as to how to construct this.
  
  6. Nov 18, 2007
  
  ### Dick
  
  If x<C then it's x. If x>C then it's the constant C. Just split your integral in two, between 0 and C it's what you have. From x in the range of C to 40, it's just the constant C.
  
  7. Nov 18, 2007
  
  ### e(ho0n3
  
  Ah, OK. Makes sense.
  
  8. Nov 18, 2007
  
  ### 1daj
  
  I've solved integral 0 to c (1/40)x dx + integral c to 40 c dx and got an answer that is scaring me. Im assuming I have mistaken what you meant. What is the reason that the second integral is set up the way it is? Sorry, about this, im really confused.
  
  9. Nov 18, 2007
  
  ### Dick
  
  You mean integral from c to 40 of c/40, right? Expectation value is the integral of value*probability density. You have a 1/40 in the first one, you should have a 1/40 in the second one. The reason you are splitting it up is because the amount you can sell maxes out at c for x>c. As I said before, you don't want expectation of demand, you want expectation of what you can sell.
  
  Last edited: Nov 18, 2007
explanation: The document is a forum post from a homework help section, where a student is asking for assistance with a probability and statistics problem. The student provides the problem statement, relevant equations, and their attempt at a solution. The problem involves calculating the expected value of a vendor's daily profit based on a uniform probability density function for daily demand. The post also includes responses from other users, offering guidance and corrections to the student's approach.
  
  The document contains a question and an attempt at an answer, but the answer is incomplete and the student is seeking further clarification.
distilabel_metadata.content: Evaluate the user given text extract and determine if it contains a math question and optionally and answer to this question.
  
  Output rules:
  
  1. Briefly describe the document and mention if it contains a question or a question and answer.
  2. Finalize the output with: Label: no-question,question,question-and-answer,multiple-question,multiple-question-and-answer
distilabel_metadata.role: system
distilabel_metadata.content: # Homework Help: Uniform probability density function question
  
  1. Nov 18, 2007
  
  ### 1daj
  
  1. The problem statement, all variables and given/known data
  
  A vendor at a market buys mushrooms from a wholesaler for $3 a pound, and sells them for$4 a pound. The daily demand (in pounds) from custumers for the vendor;s mushrooms is a random variable X with pdf
  f(x) = 1/40 if 0 (greater than) x (less than) 40 and 0 elsewhere
  Unsold mushrooms must be thrown out at the end of the day.
  Suppose that the vendor buys a constant amount, say C pounds, of mushrooms from the wholesaler at the beginning of each day (0 (less than) C (greater than) 40). Find the expected value of the vendor's daily profit.
  
  2. Relevant equations
  
  3. The attempt at a solution
  
  I am really confused as to how to set up the solution to this problem and this is how i set it up:
  
  E(profit) = 4 E(demand) - 3C = 4 (integral from 0 to c) x/40 dx - 3C
  = 4 (c^2)/80 - 3C
  = (c^2)/20 -3C
  What troubles me about this solution is that the expected profit is never positive. Furthermore I think my problem is with finding the the Expected demand
  Any help is greatly appreciated.
  
  2. Nov 18, 2007
  
  ### Dick
  
  The problem comes from cutting off your x integral at C. If the demand x is greater than C, then you still make a profit. The function you really want the expectation value of is min(C,x). Integrate that from 0 to 40.
  
  3. Nov 18, 2007
  
  ### e(ho0n3
  
  Setting the upper limit of the integral to C implies that the demand can be at most C. The demand can be greater than C as Dick pointed out. The upper limit should be 40 since anything above 40 does not contribute to value of the integral.
  
  But why min(C,x) though? The expected value of the demand should not be influenced by C.
  
  4. Nov 18, 2007
  
  ### Dick
  
  If the demand is greater than C, then you still can only sell C. You don't want the expectation value of the demand, you want the expectation value of how much you can sell.
  
  5. Nov 18, 2007
  
  ### 1daj
  
  confused
  
  Function of min(C,x)? I'm confused as to how to construct this.
  
  6. Nov 18, 2007
  
  ### Dick
  
  If x<C then it's x. If x>C then it's the constant C. Just split your integral in two, between 0 and C it's what you have. From x in the range of C to 40, it's just the constant C.
  
  7. Nov 18, 2007
  
  ### e(ho0n3
  
  Ah, OK. Makes sense.
  
  8. Nov 18, 2007
  
  ### 1daj
  
  I've solved integral 0 to c (1/40)x dx + integral c to 40 c dx and got an answer that is scaring me. Im assuming I have mistaken what you meant. What is the reason that the second integral is set up the way it is? Sorry, about this, im really confused.
  
  9. Nov 18, 2007
  
  ### Dick
  
  You mean integral from c to 40 of c/40, right? Expectation value is the integral of value*probability density. You have a 1/40 in the first one, you should have a 1/40 in the second one. The reason you are splitting it up is because the amount you can sell maxes out at c for x>c. As I said before, you don't want expectation of demand, you want expectation of what you can sell.
  
  Last edited: Nov 18, 2007
distilabel_metadata.role: user
distilabel_metadata.raw_output_q_a_detector_0: The document is a forum post from a homework help section, where a student is asking for assistance with a probability and statistics problem. The student provides the problem statement, relevant equations, and their attempt at a solution. The problem involves calculating the expected value of a vendor's daily profit based on a uniform probability density function for daily demand. The post also includes responses from other users, offering guidance and corrections to the student's approach.
  
  The document contains a question and an attempt at an answer, but the answer is incomplete and the student is seeking further clarification.
  
  Label: question-and-answer