Calculate Promotion Break-Even for Rental Discount
Math & Bit ManipulationAuto-graded · 18 test casesLast updated
Compute the break-even target for new customer acquisitions under base and spend-uplift promotional scenarios.
A financial services firm is assessing a promotional discount program for its home rental payments service. To evaluate the feasibility of the campaign, you need to calculate the number of additional customers needed to reach financial break-even under both baseline usage assumptions and enhanced spending scenarios.
Given the initial user demographics and promotional details:
base_cardholders: Total number of existing active accounts.rh_rate: Proportion of existing accounts currently utilizing the home rental service (e.g., $0.05$ for $5%$).base_rh_spend: Baseline annual expenditure on home rental per user.discount: Percentage discount rate funded by the provider (e.g., $0.30$ for $30%$).revenue_per_new_customer: Expected net annual revenue generated from each acquired customer (prior to promotional discount costs on their rental spend).existing_spend_uplift: Fractional increase in rental expenditure by existing users during the promotional period (e.g., $0.20$ for a $20%$ boost).new_customer_spend_multiplier: Expenditure multiplier on rental payments for new users relative to baseline spend (e.g., $2.0$ means new users spend double the baseline amount).
Task
Write a function to calculate break-even metrics under two scenarios:
-
Baseline Scenario:
- Existing rental service users equal
base_cardholders$\times$rh_rate. - Existing users spend
base_rh_spend. - New users spend
base_rh_spend. - Net margin per new customer =
revenue_per_new_customer$-$ (discount$\times$base_rh_spend). - Fixed discount liability =
discount$\times$ (existing users) $\times$base_rh_spend. - Baseline break-even count = Fixed discount liability / Net margin per new customer.
- Existing rental service users equal
-
Extended Scenario (Spend-Uplift):
- Existing rental service users spend
base_rh_spend$\times$ $(1 + \text{existing_spend_uplift})$. - New users spend
base_rh_spend$\times$new_customer_spend_multiplier. - Extended discount liability for existing users =
discount$\times$ (existing users) $\times$ (extended spend of existing users). - Net margin per new customer in extended scenario =
revenue_per_new_customer$-$ (discount$\times$ extended spend of new users). - Extended break-even count = Extended discount liability / Extended net margin per new customer.
- Existing rental service users spend
Return a dictionary with the following key-value pairs:
"original_break_even": Required new user acquisitions in the baseline scenario."original_percent_of_base": Baseline break-even acquisitions expressed as a percentage ofbase_cardholders."extended_break_even": Required new user acquisitions in the extended scenario."extended_percent_of_base": Extended break-even acquisitions expressed as a percentage ofbase_cardholders."change_in_customers": Difference between extended break-even count and baseline break-even count (extended_break_even$-$original_break_even).
Constraints
- $1 \le \text{base_cardholders} \le 10,000,000$
- $0.001 \le \text{rh_rate} \le 1.0$
- $1.0 \le \text{base_rh_spend} \le 10,000.0$
- $0.01 \le \text{discount} < 1.0$
- $\text{revenue_per_new_customer} > \text{discount} \times \text{base_rh_spend} \times \text{new_customer_spend_multiplier}$
- $0.0 \le \text{existing_spend_uplift} \le 5.0$
- $0.1 \le \text{new_customer_spend_multiplier} \le 10.0$
Examples
Example 1
Input: rent_a_home_break_even(2000000, 0.05, 500, 0.3, 550, 0.2, 2)
Output: {'original_break_even': 37500, 'original_percent_of_base': 1.875, 'extended_break_even': 72000, 'extended_percent_of_base': 3.5999999999999996, 'change_in_customers': 34500}
Example 2
Input: rent_a_home_break_even(1000000, 0.1, 400, 0.25, 600, 0.25, 1.5)
Output: {'original_break_even': 20000, 'original_percent_of_base': 2, 'extended_break_even': 27777.777777777777, 'extended_percent_of_base': 2.7777777777777777, 'change_in_customers': 7777.777777777777}
Hints
Hint 1
Identify the total fixed discount cost incurred on existing accounts who would spend regardless of the promotion.
Hint 2
Determine the net profit contribution of each newly acquired user by subtracting their promotional discount subsidy from their expected annual revenue.
Hint 3
The break-even count is simply the total fixed cost divided by the net contribution margin per new customer.
Worked solution
Medium Try it yourself first — then compare your approach, complexity and edge cases.
Approach
To solve for the financial break-even customer volume, we model unit economics by balancing fixed costs against marginal contributions:
-
Fixed Liability (Existing Users): Existing users who already utilize the rental service receive the promotional discount without providing additional card acquisition value. $$\text{Fixed Subsidy} = \text{discount} \times (\text{base_cardholders} \times \text{rh_rate}) \times \text{spend}$$
-
Marginal Contribution (New Customers): Each newly acquired user generates baseline annual revenue but incurs a discount subsidy on their rental spend: $$\text{Net Margin} = \text{revenue_per_new_customer} - (\text{discount} \times \text{new_user_spend})$$
-
Break-Even Target: $$\text{Break-Even Target } x = \frac{\text{Fixed Subsidy}}{\text{Net Margin}}$$
By evaluating this relationship for both initial spending patterns and elevated usage levels, we yield the required output metrics.
Complexity
- Time Complexity: $\mathcal{O}(1)$, as the solution consists of direct arithmetic evaluation.
- Space Complexity: $\mathcal{O}(1)$, requiring auxiliary memory only for key-value dictionary construction.
from typing import Dict
def rent_a_home_break_even(
base_cardholders: int,
rh_rate: float,
base_rh_spend: float,
discount: float,
revenue_per_new_customer: float,
existing_spend_uplift: float,
new_customer_spend_multiplier: float
) -> Dict[str, float]:
existing_rh_users = base_cardholders * rh_rate
# Baseline calculations
original_promo_cost_existing = discount * existing_rh_users * base_rh_spend
original_promo_cost_per_new = discount * base_rh_spend
original_break_even = original_promo_cost_existing / (revenue_per_new_customer - original_promo_cost_per_new)
# Extended calculations
extended_existing_spend = base_rh_spend * (1 + existing_spend_uplift)
new_customer_spend = base_rh_spend * new_customer_spend_multiplier
extended_promo_cost_existing = discount * existing_rh_users * extended_existing_spend
extended_promo_cost_per_new = discount * new_customer_spend
extended_break_even = extended_promo_cost_existing / (revenue_per_new_customer - extended_promo_cost_per_new)
return {
"original_break_even": original_break_even,
"original_percent_of_base": (original_break_even / base_cardholders) * 100,
"extended_break_even": extended_break_even,
"extended_percent_of_base": (extended_break_even / base_cardholders) * 100,
"change_in_customers": extended_break_even - original_break_even,
}