Skip to content

Instantly share code, notes, and snippets.

@mvcisback
Created September 2, 2014 00:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mvcisback/392f7ca515355b72fb28 to your computer and use it in GitHub Desktop.
Save mvcisback/392f7ca515355b72fb28 to your computer and use it in GitHub Desktop.
{
"metadata": {
"name": "",
"signature": "sha256:1ddd4a41de2fd581758a57a6abb740a94aabc0fdb33a638bbc55244b095d2f84"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Safety Deposit Analysis\n",
"\n",
"## Amount\n",
"\n",
"1 months rent + fees = 820 + fees $\\approx$ 1000\n",
"\n",
"## Copy of email from advantage\n",
"\n",
"> Hello Marcell\n",
"\n",
"> The amount of money deducted from the security deposit depends on the condition of the apartment after you move out. The main deductions are for cleaning, painting, and carpet cleaning. We charge you the amount the contractors charge us to paint/clean the apartment.\n",
"\n",
"> - The carpet cleaning fee per your lease will be approximately \\$130.\n",
"> - The painting charges would possibly range from \\$0(no damage)- \\$200 (for heavily marked walls).\n",
"> - The cleaning charges would possibly range from \\$0 (tenants have thoroughly cleaned) - \\$250 (very dirty apartment).\n",
"> - Use your judgement as to condition of how you will likely leave the apartment.\n",
"\n",
"> Thanks.\n",
"> Traci"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from sympy import symbols, solve\n",
"\n",
"safety_deposit, p, c = symbols('S, p, c')\n",
"\n",
"painting_pct = 0.3 # guess\n",
"cleaning_pct = 0.1 # guess\n",
"safety_deposit = 1003\n",
"\n",
"carpet_fee = 130\n",
"painting_fee = 200*p # only minor scuffs\n",
"cleaning_fee = 250*c # apt is clean\n",
"\n",
"net_deposit = safety_deposit - carpet_fee - painting_fee - cleaning_fee\n",
"print(\"net deposit: {}\".format(net_deposit))\n",
"print('c = cleaning percent, p = painting percent')\n",
"net_deposit = net_deposit.replace(p, painting_pct).replace(c, cleaning_pct).replace(safety_deposit, 1000)\n",
"print(\"net deposit: {}\".format(net_deposit))"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"net deposit: -250*c - 200*p + 873\n",
"c = cleaning percent, p = painting percent\n",
"net deposit: 788.000000000000\n"
]
}
],
"prompt_number": 4
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Break down of time spent at Apt"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"x, T = symbols('x, T') # estimated net deposit\n",
"\n",
"total = 3 # years\n",
"\n",
"marcell = 3\n",
"eric = 2\n",
"rod = 1\n",
"\n",
"x = solve(marcell*x + eric*x + rod*x - T, x)[0]\n",
"\n",
"print(\"marcell is responsible for: {}\".format(marcell*x))\n",
"print(\"rod is responsible for: {}\".format(rod*x))\n",
"print(\"eric is responsible for: {}\".format(eric*x))"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"marcell is responsible for: T/2\n",
"rod is responsible for: T/6\n",
"eric is responsible for: T/3\n"
]
}
],
"prompt_number": 5
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**but eric already paid half of the safety deposit so rod needs to pay the difference which is**"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"diff = T/2 - rod*x\n",
"print(diff)\n",
"print(diff.replace(T, net_deposit))"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"T/3\n",
"262.666666666667\n"
]
}
],
"prompt_number": 6
},
{
"cell_type": "code",
"collapsed": false,
"input": [],
"language": "python",
"metadata": {},
"outputs": []
}
],
"metadata": {}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment