Rent and Occupancy Targets for a 100-Unit Apartment Building
Math & Bit ManipulationAuto-graded · 2 test casesLast updated
Apply a simple profit model with fixed costs, a rent-proportional cost and a target return to find a required rent and a required occupancy.
Rent and Occupancy Targets for a 100-Unit Apartment Building
An investor owns a residential building and wants to know what rent it must charge to earn a target return. All inputs are fixed constants, so your function takes no arguments.
Property data
- Number of units: 100
- Current occupancy: 80% (so 80 units are rented)
- Purchase and build cost: $10,000,000
- Annual mortgage interest: $600,000
- Other fixed annual costs: $400,000
- Variable costs: 10% of the rent actually collected. Empty units generate no rent and therefore no variable cost.
- Required annual return: 10% of the $10,000,000 cost
Profit model
Every occupied unit pays the same monthly rent for all 12 months of the year.
annual profit = 0.90 * (occupied units * 12 * monthly rent) - (interest + other fixed costs)
Principal repayments, taxes and depreciation are ignored. The target annual profit is 10% of the project cost.
Task
Implement a function that returns a dictionary with two numbers:
"minimum_monthly_rent": the lowest monthly rent per unit that gives the target annual profit while occupancy stays at 80%."occupancy_percentage_at_1200": if the monthly rent is $1,200 instead, the occupancy, expressed as a percentage of the 100 units, needed to earn the same target annual profit.
Output rules
- Return plain floats with no rounding.
- Do not round the required unit count up to a whole number. Treat occupancy as a continuous value.
- Do not cap the occupancy percentage at 100. If the target cannot be reached even with every unit rented, report the raw number, which will be above 100.
- The dictionary must have exactly the two keys above.
Constraints
- No input parameters. Use the constants given above.
- Both returned values are floats.
- Variable costs apply only to collected rent.
- The target profit is a profit figure, which means it comes on top of the interest and fixed costs.
Examples
Example 1
Input: property_rent_targets()
Output: {'minimum_monthly_rent': 2314.814814814815, 'occupancy_percentage_at_1200': 154.320987654321}
Hints
Hint 1
Add the interest and the other fixed costs, then add the target profit. That total is what the rent, after the variable-cost share is removed, must cover.
Hint 2
Only 90% of each rent dollar is left after variable costs, so divide the total to be covered by 0.9 to get the required gross annual rent.
Hint 3
For the first answer, divide the required gross annual rent by occupied units times 12. For the second, divide the same total by the yearly contribution of one occupied unit at $1,200, then convert the unit count into a percentage of 100.
Worked solution
Easy Try it yourself first — then compare your approach, complexity and edge cases.
Approach
The model is linear, so both answers come from one rearranged equation.
Step 1: What must be covered. Profit is the rent left after variable costs, minus the fixed costs. To reach a target profit, the post-variable-cost rent must equal:
amount_to_cover = interest + other fixed + target profit
= 600,000 + 400,000 + 1,000,000
= 2,000,000
The target profit is 10% of $10,000,000, which is $1,000,000.
Step 2: Remove the variable-cost share. Only 90% of each collected dollar remains, so the gross annual rent must be:
gross_revenue_needed = 2,000,000 / 0.9 ≈ 2,222,222.22
Step 3: Minimum rent at 80% occupancy. With 80 occupied units paying for 12 months, gross rent is 80 * 12 * R = 960R. Solving 960R = 2,222,222.22 gives R ≈ 2314.81.
Step 4: Occupancy at $1,200. One occupied unit contributes 1,200 * 12 * 0.9 = 12,960 per year after variable costs. The number of units needed is 2,000,000 / 12,960 ≈ 154.32. As a percentage of 100 units, that is 154.32%. This exceeds 100%, so the target cannot be reached at that rent. The function reports the raw value instead of capping it.
Why it is correct
Profit is linear in rent for a fixed number of occupied units, and linear in the number of occupied units for a fixed rent. Setting profit equal to the target and solving for the one unknown gives a unique answer in each case. Variable costs apply only to collected rent, so the factor 0.9 multiplies revenue only, never the fixed costs.
Complexity
Time O(1) and space O(1), since this is a fixed number of arithmetic operations.
Reference solution
from typing import Dict
def property_rent_targets() -> Dict[str, float]:
total_units = 100
occupancy_rate = 0.80
project_cost = 10_000_000
mortgage_interest = 600_000
other_fixed = 400_000
variable_share = 0.10
target_return = 0.10
alt_rent = 1_200
fixed_total = mortgage_interest + other_fixed
target_profit = project_cost * target_return
amount_to_cover = fixed_total + target_profit
gross_revenue_needed = amount_to_cover / (1 - variable_share)
min_rent = gross_revenue_needed / (total_units * occupancy_rate * 12)
occupancy_needed = amount_to_cover / (
total_units * alt_rent * 12 * (1 - variable_share)
)
return {
"minimum_monthly_rent": min_rent,
"occupancy_percentage_at_1200": occupancy_needed * 100,
}