# Investing Mortgages

Optional Node

Note: Experimental challenge, feel free to skip.

You have a 20-year \$100,000 mortgage on your house and \$150,000 invested in a mutual fund. At the end of each year, you will need cash to pay the interest on what remains of your mortgage and \$5,000 of the principle. You can sell any amount from your fund first, but there's a \$500 fee on every sale.

• #### lyle

Can someone explain the challenge like I am 5?
I am not very good at this mortgage stuff and therefore I can't see the question properly.

• #### thales

One example to understand the question would be nice , yes.

• #### thales

It does not make sense. What if i payed the whole mortgage at once. In example 1 this will cost 106000 dollar. My fund will be 46500 dollar ( i first collect the rent). And done with it. right? Then the interest of the remaining 19 years will give me a total fund off 46500*1.0219=67741 dollar. Its a lot more then 11490?

• #### Learneroo

You need to pay \$5k + interest each year. The only decision is how much to sell from your mutual fund. (This is an 'alpha' challenge though, so don't worry about it too much.)

• #### thales

I do worry about it much. I want to do this. But i dont understand the question. Is there an example.. Can i sell all at onces or not? What happens when i sell?

• #### Learneroo

You can sell any amount at once (and save on fees), but you'll miss out on annual earning from your fund (`a`).

• #### thales

I am really sorry but i think your output is wrong. I i can sell everything at once, then for example one i have more then 11490 left.

• #### Learneroo

It's possible there's a mistake (it's an alpha challenge), but selling everything at once is not optimal, since you're giving up earnings in your fund, but still need to pay the same interest on mortgage.

• #### thales

No i i take al the money at once i can pay off my mortgage at once. I dont have to pay anything afther that. In example 1 the output then will bi higher. Try it for yourself. Example one, pay off everything at once. You will get a higher amount then what it says.

• #### Learneroo

As I mentioned, you need to pay \$5k + interest each year. You cannot pay off more than \$5k of the principal each year. The only decision is how much to sell from your mutual fund, not how much to pay for the mortgage.

• #### thales

Weird. Since the funds money i talk depends on the mortage. Nevermind, the question is still not clear. The rules arent clear to me at all.

But i give it up. Thx for the comments never the less!

• #### Gary

Very, very tough... I opted for the easier solution (:

my code

• #### Bolke

Hm, not getting it....You say "The only decision is how much to sell from your mutual fund".

But...you have a yearly income, and when the total sum you have to pay to the bank is larger than that income by x, then you have to sell off x from your fund. Where is there a decision in that?

• #### Bolke

And yes, like the others I feel there should have been one worked out example, like the challenges before this one had. Now I have no way of knowing whether my programming is wrong, or my understanding of the challenge.

• #### Bolke

my code

Dunno what's wrong with my code.