← Back to list

Python by Examples: Evaluating Goodwill and Noncompete Agreements

Introduction Noncompete agreements and goodwill assessments often seem like abstract legal concepts, but they can be examined and simulated…

MB20261 · 2025-03-22 19:31 · 0 claps · 4.0 min read paywalled
#goodwill #noncompete-agreement #valuation #python #finance
Open on Medium ↗
Wiki topics: TLS · Design Tools & Workflow ECO · Economy · General ⚖️ · Law & Justice

Python by Examples: Evaluating Goodwill and Noncompete Agreements

Introduction Noncompete agreements and goodwill assessments often seem like abstract legal concepts, but they can be examined and simulated with Python. This article introduces practical examples that blend valuation methodologies with programming techniques. We use Python code samples to demonstrate how to estimate profit loss due to competition, examine the components of goodwill, and compare personal contributions with enterprise value — making these complex topics more accessible.

The discussion provides an overview of noncompete agreements, the division of goodwill, and the valuation of personal goodwill in commercial scenarios. Each section delves into a specific aspect of goodwill valuation, supports it with clear, working Python examples, and walks you through practical computations. You will find step-by-step code samples that not only simulate the theoretical constructs but also encourage experimentation and further exploration of these valuation methods.

Valuing Noncompete Agreements

Overview:

Noncompete agreements restrict individuals from leveraging personal talent in competing ventures. This section illustrates how to compute potential loss to an enterprise when a covenantor departs, by simulating annual probability of competition and quantifying expected profit loss.

Sample Code 1 — Estimating Annual Loss Due to Noncompete Risk:

#!/usr/bin/env python3
import math

def compute_annual_loss(expected_annual_profit, competition_probability, loss_adjustment):
    lost_profit = expected_annual_profit * competition_probability * loss_adjustment
    return lost_profit

def simulate_loss_over_years(expected_annual_profit, initial_probability, loss_adjustment, years):
    losses = []
    for year in range(1, years + 1):
        current_probability = min(1.0, initial_probability + 0.02 * (year - 1))
        annual_loss = compute_annual_loss(expected_annual_profit, current_probability, loss_adjustment)
        losses.append((year, current_probability, annual_loss))
    return losses

def main():
    expected_profit = 100000  # assumed annual profit in dollars
    base_probability = 0.1    # initial risk of competing entry
    adjustment = 0.8          # 80% loss adjustment factor
    period = 10               # simulation over 10 years

    losses = simulate_loss_over_years(expected_profit, base_probability, adjustment, period)

    print("Year | Competition Probability | Estimated Loss")
    print("-" * 50)
    for year, prob, loss in losses:
        print(f"{year:4} | {prob:22.2%} | ${loss:,.2f}")

if __name__ == "__main__":
    main()

Sample Code 2 — Object-Oriented Simulation for Noncompete Valuation:

#!/usr/bin/env python3

class NoncompeteAgreement:
    def __init__(self, expected_profit, base_probability, loss_adjustment, duration):
        self.expected_profit = expected_profit
        self.base_probability = base_probability
        self.loss_adjustment = loss_adjustment
        self.duration = duration

    def compute_loss_for_year(self, year):
        prob = min(1.0, self.base_probability + 0.03 * (year - 1))
        loss = self.expected_profit * prob * self.loss_adjustment
        return prob, loss

    def simulate_agreement_value(self):
        results = []
        for year in range(1, self.duration + 1):
            prob, loss = self.compute_loss_for_year(year)
            results.append({'year': year, 'probability': prob, 'loss': loss})
        return results

def display_results(results):
    print("Year | Revised Competition Probability | Annual Lost Profit")
    print("=" * 60)
    for record in results:
        year = record['year']
        prob = record['probability']
        loss = record['loss']
        print(f"{year:4} | {prob:28.2%} | ${loss:15,.2f}")

def main():
    agreement = NoncompeteAgreement(expected_profit=120000, base_probability=0.08, loss_adjustment=0.85, duration=12)
    results = agreement.simulate_agreement_value()
    display_results(results)

if __name__ == "__main__":
    main()

Trifurcation of Goodwill and the Economic Reality Test

Overview:

Goodwill can be divided into pure personal, tradable personal, and enterprise goodwill. This section simulates the trifurcation process and the economic reality test factors using Python. The examples help quantify varying degrees of goodwill based on factors like competition probability, covenant duration, and individual influence.

Sample Code 1 — Classifying Goodwill Components:

#!/usr/bin/env python3

def classify_goodwill(total_value, purity_factor, tradeability_factor):
    pure_personal = total_value * purity_factor
    tradable = (total_value - pure_personal) * tradeability_factor
    enterprise = total_value - pure_personal - tradable
    return pure_personal, tradable, enterprise

def display_goodwill_breakdown(total_value, pure, tradable, enterprise):
    print("Goodwill Breakdown:")
    print("-------------------")
    print(f"Total Goodwill Value: ${total_value:,.2f}")
    print(f"Pure Personal Goodwill: ${pure:,.2f}")
    print(f"Tradable Personal Goodwill: ${tradable:,.2f}")
    print(f"Enterprise Goodwill: ${enterprise:,.2f}")
    print()

def main():
    total_value = 500000
    purity_factor = 0.3
    tradeability_factor = 0.5
    pure, tradable, enterprise = classify_goodwill(total_value, purity_factor, tradeability_factor)
    display_goodwill_breakdown(total_value, pure, tradable, enterprise)

if __name__ == "__main__":
    main()

Sample Code 2 — Simulating the Economic Reality Test:

#!/usr/bin/env python3
import random

def economic_reality_score(probability, covenant_length, individual_influence):
    factor1 = probability
    factor2 = max(0, 1 - (covenant_length / 10))
    factor3 = individual_influence
    score = (factor1 + factor2 + factor3) / 3
    return score

def simulate_economic_test(trials):
    results = []
    for i in range(trials):
        probability = random.uniform(0.05, 0.3)
        covenant_length = random.randint(1, 10)
        individual_influence = random.uniform(0.4, 0.9)
        score = economic_reality_score(probability, covenant_length, individual_influence)
        results.append((i+1, probability, covenant_length, individual_influence, score))
    return results

def main():
    trials = 10
    results = simulate_economic_test(trials)
    print("Trial | Prob  | Covenant Length | Influence | Score")
    print("-" * 60)
    for trial, prob, length, influence, score in results:
        print(f"{trial:5d} | {prob:.2f} | {length:15d} | {influence:.2f} | {score:.2f}")

if __name__ == "__main__":
    main()

Personal Goodwill in Commercial Businesses

Overview:

While professional practices have traditionally focused on goodwill evaluations, personal goodwill in commercial businesses requires thorough analysis. This section walks through a discounted cash flow valuation for personal goodwill in commercial scenarios and contrasts it with key person discount calculations using Python.

Sample Code 1 — Discounted Cash Flow for Personal Goodwill:

#!/usr/bin/env python3

def calculate_discounted_cash_flow(cash_flows, discount_rate):
    present_value = 0
    for t, cash in enumerate(cash_flows, start=1):
        present_value += cash / ((1 + discount_rate) ** t)
    return present_value

def simulate_cash_flows(initial_cash, growth_rate, periods):
    flows = []
    current_cash = initial_cash
    for period in range(periods):
        flows.append(current_cash)
        current_cash *= (1 + growth_rate)
    return flows

def main():
    initial_cash = 50000
    growth_rate = 0.05
    periods = 15
    discount_rate = 0.08

    cash_flows = simulate_cash_flows(initial_cash, growth_rate, periods)
    value = calculate_discounted_cash_flow(cash_flows, discount_rate)

    print("Simulated Cash Flows for Personal Goodwill:")
    for index, flow in enumerate(cash_flows, start=1):
        print(f"Year {index}: ${flow:,.2f}")
    print("-" * 40)
    print(f"Estimated Value (Discounted): ${value:,.2f}")

if __name__ == "__main__":
    main()

Sample Code 2 — Comparing Key Person Discount and Personal Goodwill:

#!/usr/bin/env python3

def key_person_discount(business_value, discount_rate):
    return business_value * discount_rate

def personal_goodwill_value(business_value, goodwill_fraction):
    return business_value * goodwill_fraction

def compare_values(business_value, discount_rate, goodwill_fraction):
    discount = key_person_discount(business_value, discount_rate)
    personal_goodwill = personal_goodwill_value(business_value, goodwill_fraction)
    return discount, personal_goodwill

def main():
    business_value = 800000
    discount_rate = 0.15
    goodwill_fraction = 0.25

    discount, personal_goodwill = compare_values(business_value, discount_rate, goodwill_fraction)

    print("Comparison of Valuation Adjustments:")
    print("-" * 45)
    print(f"Business Value: ${business_value:,.2f}")
    print(f"Key Person Discount: ${discount:,.2f}")
    print(f"Personal Goodwill Value: ${personal_goodwill:,.2f}")

if __name__ == "__main__":
    main()

Conclusion

By applying Python to model and simulate the nuances of noncompete agreements and goodwill valuation, we gain clearer insights into their practical implications. These examples demonstrate the versatility of programming in bridging the gap between legal-economic theories and data-driven analysis. Practitioners and learners alike can adapt and expand these models, fostering a deeper understanding of how personal contributions and contractual clauses shape enterprise value. Enjoy experimenting with these examples as a foundation for more sophisticated valuation tools.


메타데이터
post_id
fc05d3c18271
slug
python-by-examples-evaluating-goodwill-and-noncompete-agreements-fc05d3c18271
url
https://medium.com/@mb20261/python-by-examples-evaluating-goodwill-and-noncompete-agreements-fc05d3c18271
canonical_url
https://medium.com/@mb20261/python-by-examples-evaluating-goodwill-and-noncompete-agreements-fc05d3c18271
author_url
https://medium.com/@mb20261
status
ok
fetched_at
2026-06-23 03:48:11