Checkpoint B  If this population plays (and loses) the lottery 2 times: It could become [0,3,4,5,6], if the first individual played twice Or it could become [2,3,4,4,5], if the last two individuals each played once etc Continuing the example, scholarships might then award a total of $3 of awards to the population in the form of $1 scholarships. If the wealth had originally been [0,3,4,5,6], then: It could become[3,3,4,5,6], if the 1st individual got all three awards Or it could become [0,4,5,5,7], if it was distributed equally among the 2nd, 3rd, and 5th individuals etc We assume the lottery system is backed by a relatively huge pool of capital, so that scholarships are awarded no matter how many lottery winners there are. We also assume who plays the lottery and who benefits from scholarships will be random, at the individual-level. Later, at the population-level, we will select behaviors for our simulation based on social science research. The function generate_disparity_msg() returns a string summarizing the distribution of wealth. Here are examples of that analysis: highIncomeList lowIncomeList Wealth Distribution [2,3,4,5,6] [6,5,4,3,2] High income: 50% of wealthLow income: 50% of wealth [5, 6, 10, 14] [1, 5, 7, 2] High income: 70% of wealthLow income: 30% of wealth [4, 10, 2, 5, 8] [2, 7] High income: 76% of wealthLow income: 24% of wealth Implementation Strategy Implement each function from the template following the description in their docstring: sim_lottery() award_scholarship() generate_disparity_msg() For the messages returned by generate_disparity_msg(), adapt this fstring for your code: msg = f"Decade {decade}: High income group " +\ f"has {highIncomePercent:.0f}% of the community's wealth. "+\ f"Low income group has {lowIncomePercent:.0f}% "+\ f"of the community's wealth." Here is my code from checkpoint A :

Oh no! Our experts couldn't answer your question.

Don't worry! We won't leave you hanging. Plus, we're giving you back one question for the inconvenience.

Submit your question and receive a step-by-step explanation from our experts in as fast as 30 minutes.
You have no more questions left.
Message from our expert:
Our experts need more information to provide you with a solution. you haven't provided the code from checkpoint A. Please resubmit your question, making sure it's detailed and complete. We've credited a question to your account.
Your Question:

Checkpoint B 

If this population plays (and loses) the lottery 2 times:

  • It could become [0,3,4,5,6], if the first individual played twice
  • Or it could become [2,3,4,4,5], if the last two individuals each played once
  • etc

Continuing the example, scholarships might then award a total of $3 of awards to the population in the form of $1 scholarships. If the wealth had originally been [0,3,4,5,6], then:

  • It could become[3,3,4,5,6], if the 1st individual got all three awards
  • Or it could become [0,4,5,5,7], if it was distributed equally among the 2nd, 3rd, and 5th individuals
  • etc

We assume the lottery system is backed by a relatively huge pool of capital, so that scholarships are awarded no matter how many lottery winners there are. We also assume who plays the lottery and who benefits from scholarships will be random, at the individual-level. Later, at the population-level, we will select behaviors for our simulation based on social science research.

The function generate_disparity_msg() returns a string summarizing the distribution of wealth. Here are examples of that analysis:

highIncomeList lowIncomeList Wealth Distribution
[2,3,4,5,6] [6,5,4,3,2] High income: 50% of wealth
Low income: 50% of wealth
[5, 6, 10, 14] [1, 5, 7, 2] High income: 70% of wealth
Low income: 30% of wealth
[4, 10, 2, 5, 8] [2, 7] High income: 76% of wealth
Low income: 24% of wealth

Implementation Strategy

Implement each function from the template following the description in their docstring:

  • sim_lottery()
  • award_scholarship()
  • generate_disparity_msg()

For the messages returned by generate_disparity_msg(), adapt this fstring for your code:

msg = f"Decade {decade}: High income group " +\ f"has {highIncomePercent:.0f}% of the community's wealth. "+\ f"Low income group has {lowIncomePercent:.0f}% "+\ f"of the community's wealth."

Here is my code from checkpoint A :

 

Knowledge Booster
Bellman operator
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Operations Research : Applications and Algorithms
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole