A flight carries passengers and meal options. Each passenger independently prefers option with probability , and option has portions loaded. Passengers are served one by one and receive their preferred meal if a portion is left. Compute how many passengers get their preferred meal on average, and how likely it is that everyone does.
Implement preference_fulfillment(n, probs, stock):
n: number of customers, .probs: list of preference probabilities, non-negative, summing to 1.stock: list of non-negative integer stock levels.Return (expected_fulfilled, prob_all_fulfilled):
expected_fulfilled , where is the number of customers preferring option .prob_all_fulfilled , where is multinomial with trials and probabilities probs.Return unrounded floats.