Jump to content

Vitalius

Member
  • Posts

    8,166
  • Joined

  • Last visited

Reputation Activity

  1. Like
    Vitalius got a reaction from Sharif for a blog entry, My stock trading antics - Practice Mode   
    Disclaimers: I'm still learning. I can be wrong. This is not financial or legal advice, just me explaining what I've learned thus far. YMMV, but I'm not responsible for anything this knowledge is used for.
    All numbers are arbitrary, but somewhat realistic examples.
    It's confusing. I know. Tis life. I tried my best to explain it accurately. Concise is not something I do unless forced.
    So I've been learning stock trading basics for a while (terms, patterns, concepts, etc.), and I've been practicing along the way. Unfortunately, my program that I use resets sometimes (randomly) so I can't keep a running total of money lost/earned in this practice. Here is a picture of the program:

    Currently, I've lost 17% of my (paper, fake, monopoly) money, but this is a long play and I expected something different to happen (the huge dip in the DJIA was unexpected and threw me off). I should start making money Monday, Tuesday, or Wednesday of next week on this setup.
    To kind of help you read the above image, the top left is my totals. They give you $200,000 of paper money to invest, but $100,000 is for one type of trading and the other $100,000 is for the other type of trading. So it's more like I have $100,000 since I only trade with one half of it. Net Liq & Day Trades is what I use, and I don't "do" Day Trading. Right now anyway.
    I'm keeping an eye on Abbott and Tesla for reasons. I didn't straight up buy stock in either company. I purchased a Put for Abbott and a Call for Tesla. This means I make money if Tesla goes up and if Abbott goes down.
    Unfortunately, the opposite happened, so I lost like 30%, but it's reversing now.
    The bottom row of charts is the Weekly charts for Abbott, Tesla, & the Dow Jones Industrial Average (average of the an entire market's performance, not THE market, but A market). The top row is the daily chart for those things.
    But yeah. Still learning.
    I was really bummed out that the program reset on me. I had doubled my money on a stock going up $1 by selling Puts (literally, I had $100,000 worth of Puts and after I sold them, I had $200,000+). It was very lucky that the stock moved so strongly, but I knew it would go up.
    Options are Calls & Puts (There may be more, but I've only learned about these). The easiest analogy I've found to understand them is thus:
    Calls are Coupons on a stock price. i.e. If I buy a call for TSLA (Tesla) at $250, I have a coupon giving me the right to buy TSLA's stock at $250, no matter what the price currently is.
    Puts are Price Guarantees on a stock price. i.e. If I buy a put for TSLA at $250, I have a price guarantee that I can sell TSLA's stock at $250, no matter what the price currently is.

    So Calls are for buying stock, and Puts are for selling stock. If you are wondering how they make money doing that, if I buy a Call for TSLA at $250, but their current Stock Price is $255.50, I will pay $5.50 per Call. Then I will pay $250 per share of stock. So they still get the full price, at the time I purchased the Call, of the stock.
    However, Calls & Puts can expire. Just like normal Coupons and Price Guarantees. If I buy either of them, but I never buy or sell the stock, I lost money, but not a lot of money (what is $5.50?) That's one way the companies themselves make money on Options.
    What a Call & Put give you is time. If you think a stock is going up, you can buy a Call (Coupon) to buy that stock at, say $250, but then wait until it hits $300 to buy it at $250. So you know for a fact you are going to profit. Or you can let the Call expire because the stock dropped to $200 and you were wrong about it going up. So buying it at $250 would be stupid as it's currently $200.
    Options are just that. Options. They buy you time to think about whether you want to buy/sell the stock or not.
    Just for reference, here is how you make money buying & selling options (Calls & Puts):
    Buy Calls = You make money if the stock goes up - Because you have a coupon that says you can buy the stock at $250, if the stock goes to $300, you buy it cheaper than it currently is, then sell it for a profit.
    Buy Puts = You make money if the stock goes down - Because you have a price guarantee that says you can sell the stock at $250, if the stock goes to $200, you can sell it for more than it currently is.
    Sell Calls = You make money if the stock goes down - I'm still trying to understand why and how this works. It's complicated because you are selling someone else or a company the right to sell stock to you at $250 or wtv.
    Sell Puts = You make money if the stock goes up - I'm still trying to understand why and how this works. It's complicated because you are selling someone else or a company the right to buy stock from you at $250 or wtv.

    What each scenario does is it basically decides how much money you can profit or lose in the trade. i.e. if I sell a Put, my maximum profit is capped at 100% (double my money), but my maximum loss is infinite (I lose all of my money).
    However, the reason you would want to sell a Put is because you sold something. You immediately get paid for it, but the amount is small. And it's very likely you will profit, and very unlikely you will lose all your money.
    These are the things to consider when doing a trade with options:
    Profit potential (i.e. max profit is 100%, infinite, or what-have-you)
    Loss Potential (i.e. 100% AKA infinite, or what-have-you)
    Probability of both of those happening (i.e. odds of profit vs odds of loss)

    Each of those choices above (Buy Calls, Buy Puts, Sell Calls & Sell Puts) have different values for how much you can earn/lose and what the odds of each thing happening are.
    That's generally what I've learned so far. This is just practice mode, I'll give an update when I move to real money mode.
  2. Like
    Vitalius got a reaction from Sharif for a blog entry, My disturbing revelation.   
    Huh.
    ​So, I had this disturbing revelation. I wish there were a better way to share it with others, because it's hard to explain how everything connects for me. I guess I'll try and start at the beginning.
    One thing you may or may not know about me is that I don't like this world. Not at all. When I was young, I could see that my dreams could never be real in it. Because of this, I usually went to media like video games and anime because they didn't have the limitations this world does.
    As I've grown up, I've played and watched more and more of these stories. And as I've realized how many of them there are, I became disheartened because I realized I could never experience them all in a normal human lifetime (part of the limitations of the world).
    Well, while I was thinking about my relationship with God and stuff, I realized something. This disheartened feeling was causing an evil reaction in me. I mean, obviously being disheartened to things you love in general is bad, but there's a very special reason this particular reaction to this feeling of mine is evil. And that is because of what it implies. But I'll get to what it implies in a second.
    This feeling is based on the idea that I enjoy a certain something (for me, video games and anime, for others, whatever), and that I will do my best, with my spare time, to experience as much of it as I can with that time. And make more of that time when possible. It actually reminds me of a quote I saw once:
    "Everything changed the day she realized there was just enough time in life for the important things."
    Paraphrased, but close.
    Though that implies the same thing that my reaction (which is to experience as much as I can with what spare time I do have) does, but it helps explain what I'm saying, I think.
    The problem with that quote, and the problem with my reaction to that feeling (and the feeling itself, really) is that it implies I'm going to die.
    I'm effectively resigning myself to death by accepting this feeling and reacting to it in this way. That there will be a point where there is "no more time". Which obviously isn't true.
    And then I thought about how people normally lived their lives. How society views these types of things. And from what I can tell, it's the same thing.
    Everyone is living like they are going to die. Trying to claim whatever "life" they can before they do die. Which leads me to this:
    Matthew 16:24-25
    And that's when I realized I was being sucked into society's view of life. To take what you can before your gone, rather than to prepare for your "real" life.
    And so, personally, I've resolved myself to ask the simple question of "Why?" when I do things from now on. "Because I enjoy it." is not good enough anymore. In fact, I would say I should avoid such things where that is the only reason I do them (i.e. video games and anime for me).
    Because if they are really worth spending time on, I will see them again. I'm sure of it.
  3. Like
    Vitalius got a reaction from Askew for a blog entry, My disturbing revelation.   
    Huh.
    ​So, I had this disturbing revelation. I wish there were a better way to share it with others, because it's hard to explain how everything connects for me. I guess I'll try and start at the beginning.
    One thing you may or may not know about me is that I don't like this world. Not at all. When I was young, I could see that my dreams could never be real in it. Because of this, I usually went to media like video games and anime because they didn't have the limitations this world does.
    As I've grown up, I've played and watched more and more of these stories. And as I've realized how many of them there are, I became disheartened because I realized I could never experience them all in a normal human lifetime (part of the limitations of the world).
    Well, while I was thinking about my relationship with God and stuff, I realized something. This disheartened feeling was causing an evil reaction in me. I mean, obviously being disheartened to things you love in general is bad, but there's a very special reason this particular reaction to this feeling of mine is evil. And that is because of what it implies. But I'll get to what it implies in a second.
    This feeling is based on the idea that I enjoy a certain something (for me, video games and anime, for others, whatever), and that I will do my best, with my spare time, to experience as much of it as I can with that time. And make more of that time when possible. It actually reminds me of a quote I saw once:
    "Everything changed the day she realized there was just enough time in life for the important things."
    Paraphrased, but close.
    Though that implies the same thing that my reaction (which is to experience as much as I can with what spare time I do have) does, but it helps explain what I'm saying, I think.
    The problem with that quote, and the problem with my reaction to that feeling (and the feeling itself, really) is that it implies I'm going to die.
    I'm effectively resigning myself to death by accepting this feeling and reacting to it in this way. That there will be a point where there is "no more time". Which obviously isn't true.
    And then I thought about how people normally lived their lives. How society views these types of things. And from what I can tell, it's the same thing.
    Everyone is living like they are going to die. Trying to claim whatever "life" they can before they do die. Which leads me to this:
    Matthew 16:24-25
    And that's when I realized I was being sucked into society's view of life. To take what you can before your gone, rather than to prepare for your "real" life.
    And so, personally, I've resolved myself to ask the simple question of "Why?" when I do things from now on. "Because I enjoy it." is not good enough anymore. In fact, I would say I should avoid such things where that is the only reason I do them (i.e. video games and anime for me).
    Because if they are really worth spending time on, I will see them again. I'm sure of it.
  4. Like
    Vitalius reacted to Whaler_99 for a blog entry, Everyone else's systems...   
    So, now that you know a bit about the underlying makeup of the network in the house. In this Blog I will talk a bit about all the other systems.
    Each of the kids have a gaming class rig. My oldest saved up money for a while, and with some parts from dad is running a pretty sweet build. Corsair 540 with all the fans bitfenix spectre with the gold LED's. Asus Z87 pro board, 16GB ram, 4670k, plextar m5 256GB SSD boot, couple of 1TB for storage, and a massive phanteks cooler. Gold one with bitfenix fans on it with the LED's. 660ti,,, Looks really striking. All tied in with powerline to the network.
    For the other kids... an 24" all-in-one HP unit, course I did upgrade the CPU, disk, memory... so not so much an HP unit anymore. :) Rest are mid range gaming systems... All hooked up via wireless.
    My wife does photo editing and other things, so she has a CAD workstation, Xeon system.
    We also have a couple of laptops floating around for the kids to use for homework in the dinning room and to take to school when needed. On the TV's I have Patriot Box Office units as well as HTPC builds for all our viewing pleasure. My main storage system uses PLEX which I love! If you have a large movie/tv collection I recommend you check it out. Anyways, the HTPC's boot right into plex and all the computers in the house can also access it. With friends also using it, at anytime i might be streaming two or three items. Nights can get pretty busy as well with gaming.
    Hence the requirements for the rock solid network, at any given time I have an enormous amount of traffic coming in and out. Not to mention voice servers, sending data offsite for backups, etc.
    All in all, about 8-9 pc's that I don't directly use each day running here... Did I mention the power company sends me thank you cards? :)
  5. Like
    Vitalius reacted to Whaler_99 for a blog entry, The Start...   
    So, many people have asked about the Whale's Place - what hardware, how many PC's, where does it all come from... In this section I will work to describe my various systems builds (or link to my builds already on the forum), upcoming plans, my network layout, etc... I tell you, running CAT6 in coral is a pain in the butt...
    To generalize, I have a enterprise grade firewall, three redundant GB switches, high end wireless N and some powerline gear running as the core network. For backups of local systems, I have a backup-to-disk solution running that replicates to an offsite unit. I have a 40TB storage server that basically holds everything that also rsyncs to an offsite unit. I have the main Folding systems running, a Hyper-V host (here is where I do a lot of testing), a voice server, two HTPC systems, about 8 PC's in the house for various things and a couple of laptops floating around.
    In upcoming entries I will work to give more details on the various systems and config here that keep Whaler's Happy Fun House running.
    Cheers!
    Shot of my main work area....
    http://puu.sh/8gYAt
  6. Like
    Vitalius reacted to wpirobotbuilder for a blog entry, Best Buy, You're Not All That Bad   
    Okay, maybe you're bad at some things. Like charging exorbitant amounts for an HDMI cable (like most retailers do).

  7. Like
    Vitalius reacted to wpirobotbuilder for a blog entry, Programmers: Get Your Act Together Before You Disrupt The Internet   
    Start by reading this technical post from CloudFlare.
    UDP itself has uses, but the 'monlist' command in the Network Time Protocol is entirely useless. It was probably a "feature" some genius programmer thought they'd need but didn't, and it just got left in the code base.
    In proper software design, the majority of development strategies will prevent you from having code in your codebase that isn't used. If programmers for the NTP codebase had been developing code properly, this command would never have been implemented, and we wouldn't be dealing with these sorts of DDos attack. Apparently SNMP is being predicted to fall next, with almost three times the potential for DDos that NTP amplification can do, so better start cleaning up those vectors for DDos.
    If this attack had been using SNMP amplification, we would be seeing attacks on the Terabit scale (1 Tb/s), which is on the order of disrupting the infrastructure of the internet.
  8. Like
    Vitalius reacted to wpirobotbuilder for a blog entry, A More Flexible Way To RAID   
    In traditional RAID setups, the data is spread out across all drives in the RAID array. If you were running RAID 5 with six drives, for example you would have five drives worth of storage space, with the missing space being for parity data. If you lose one drive, you haven't yet lost all your data. Throw in a new drive, and rebuild your RAID array (and pray you don't run into an unrecoverable read error or silent corruption, because then you can kiss your data good-bye).
    This has obvious advantages: It is space efficient for the amount of redundancy it provides, and can increase read/write performance with good hardware, since there are multiple drives to run I/O on. However, a single drive going down will kill all of your data.
    What if you wanted to be able to choose how much overhead you wanted to use for parity calculations? Or what if you wanted a drive loss to not completely kill all of your data? Here's an approach.
    Here, we have a single giant parity RAID setup. Each color represents pieces of data belonging to a single data chunk (e.g. all the red blocks represent a chunk, spread out over all the drives). This is how traditional RAID works.

    The proposed "betterRAID" method is to have a fixed parity ratio in a RAID array. For instance, if I want a RAID volume with N parity drive worth of space for every M drives worth of space, then I will have N/(N+M) for my overhead (for N = 1 and M = 4, I have a RAID 5 with five drives, pretty common). However, let me use any number of drives with this setup, and write a given chunk of data to 5 of those drives, then the next chunk to the next 5 drives, and so on, like this:
    Here, the red data is written across five drives (twice as much data is written to an individual drive) instead of across all ten drives. The orange data gets written to the next five drives, then the green, etc.

    Notice that if I kill any two drives, I am guaranteed to have 50% of my data survive in the worst case, and 100% of my data survive in the best case. To gain this advantage over traditional RAID 5, I sacrificed one additional drive worth of space (one drive for every five, meaning two drives of the ten are reserved for parity). Obviously, for very large files that span tons of data chunks, they will become corrupted. For smaller files (which can fit inside of a single data chunk), they would survive if the chunk survived, and therefore would be recoverable.
    Here is a slightly more complicated example. Black lines indicate dead drives.

    In this case, we write chunks of data across five drives (with 20% of that space used for single-parity), and have 18 drives total in our array. In this case, we can kill two drives, and in the worst case we have lost only 25% of our data.
    To clarify: A "chunk" is not a complete file. A chunk is just a chunk of data (say, 512KB). If I was writing a 10KB file, it would fit within that chunk, and the next file I wrote might also fit within that chunk. When the chunk is completely full of data, the next one would start to be filled with new incoming data. Writing a multi-gigabyte file would span thousands of chunks.
    There are obvious upsides to this, most notably the fact that losing more drives than there are parity will not destroy all data, though much of it would likely be corrupted if it spanned many chunks. This also makes disaster recovery a little bit better, ensuring that a failure will not necessarily kill absolutely everything. In addition, if we used dual-parity we could make it even harder to kill data.
    The downside is that now it is harder to manage the data for an individual file, since you have to find which drives the data lives on.
    This doesn't provide the same level of protection that dual-parity or triple-parity RAID does. It provides a measure of disaster recovery in case a RAID fails completely. I think it'd be really cool for a software RAID solution like ZFS to implement something like this for RAID Z1, Z2 and Z3.
  9. Like
    Vitalius reacted to Whaler_99 for a blog entry, The Network...   
    Every good system boils down to the network. This is the underlying foundation for your entire setup. If this isn't rock solid and supports everything you need to do, it doesn't matter how fast that rig of yours is, you will still lag as your switch drops packets due to a network flood.
    Most people seem to think when they need one, the thirty dollar switch is just a good as the fifty dollar one. Most cases they are correct, when you only have a few connections not pushing the limits of the switch. But, a two hundred dollar one? In networking most times you get what you pay for. There are reasons why we have five hundred dollar switches and five thousand dollar ones. Course some brand names carry their own costs, <cough> cisco <cough> but that is another story... Why do I rant away on this? So, you might better understand why I have some of the gear I have. Because when it comes down to it, I do not want the network to be the cause of any issues in the house.
    So, first off, I have my main network hub in the crawl space. Coming into the house I have my cable connection on which modem I have reset in bridge mode (don't get me started on these crap cable and DSL modem/router units) and use my own firewall.
    The firewall is a higher end SonicWall unit. Why this? Due to my job, certifications and partnerships I have access to this and other gear a very low costs for personal use and training. So voila... For those of you that know, I am running all the security services on the unit.
    Feeding of the firewall is what I referencing as my "server" switch. This is a mid range HP 24 port GB switch with a very decent back plane. Off this switch are all my secondary connections as well as my Folding farm, which also resides in the crawl space, my Hyper-V server, unRAID server and my voice server. I also have a redundant one sitting there. Why... just in case and because I could.
    From this switch I lead out to:
    My wireless AP unit, an Aruba unit, powered via PoE, which is nice. I ran cabling up through wall and roof and this sucker sits nicely hidden away on the main floor. A HP GB Switch, a specific edge model, to my main desk. I have a few of my desktops there, test beds, etc. A low end HP GB switch at the main media area, hooked into this is a HTPC, media streaming device and few other things. A powerline adapter for one of the bedrooms. I always wanted to test this and was having wireless issues to this one spot, so voila. And works really well.  
    All the networking gear in the crawl space runs off a nice UPS, mostly to protect against power surges. Don't forget a good power surge unit for that shiny gear.
    All in all a fairly complicated setup and more then what 99% of home users need, but I work a lot with this gear, so I also do lots of testing and such as well with this gear. Should hear people scream when I reboot the firewall to test something.
    As you can see, my underlining network is more then adequate to support the throughput I may have from various sources. The system gets hardest hit when say all of the kids are streaming movies from the unRAID server (I use PLEX, what an awesome product), as well as some buddies and lots of folks on the voice system. Then myself playing some game or other... But everything works without a hiccup.
    Now I just need the cable company to stop calling me because I am flooding their network.
    The "network room"
    http://puu.sh/8gYCh
    Closer in...
    http://puu.sh/8gYB0
    Here you can see the firewall, switch, cable modem and VoIP unit, along with a spare switch. PDU unit...
    And here is what my Aruba AP looks like...
    http://puu.sh/8gYyP
    Yep.. in the floor... In case wondering, that is not a ducted vent - just open to the basement to let air pass through between floors. Very handy.
  10. Like
    Vitalius got a reaction from SLW for a blog entry, My disturbing revelation.   
    Huh.
    ​So, I had this disturbing revelation. I wish there were a better way to share it with others, because it's hard to explain how everything connects for me. I guess I'll try and start at the beginning.
    One thing you may or may not know about me is that I don't like this world. Not at all. When I was young, I could see that my dreams could never be real in it. Because of this, I usually went to media like video games and anime because they didn't have the limitations this world does.
    As I've grown up, I've played and watched more and more of these stories. And as I've realized how many of them there are, I became disheartened because I realized I could never experience them all in a normal human lifetime (part of the limitations of the world).
    Well, while I was thinking about my relationship with God and stuff, I realized something. This disheartened feeling was causing an evil reaction in me. I mean, obviously being disheartened to things you love in general is bad, but there's a very special reason this particular reaction to this feeling of mine is evil. And that is because of what it implies. But I'll get to what it implies in a second.
    This feeling is based on the idea that I enjoy a certain something (for me, video games and anime, for others, whatever), and that I will do my best, with my spare time, to experience as much of it as I can with that time. And make more of that time when possible. It actually reminds me of a quote I saw once:
    "Everything changed the day she realized there was just enough time in life for the important things."
    Paraphrased, but close.
    Though that implies the same thing that my reaction (which is to experience as much as I can with what spare time I do have) does, but it helps explain what I'm saying, I think.
    The problem with that quote, and the problem with my reaction to that feeling (and the feeling itself, really) is that it implies I'm going to die.
    I'm effectively resigning myself to death by accepting this feeling and reacting to it in this way. That there will be a point where there is "no more time". Which obviously isn't true.
    And then I thought about how people normally lived their lives. How society views these types of things. And from what I can tell, it's the same thing.
    Everyone is living like they are going to die. Trying to claim whatever "life" they can before they do die. Which leads me to this:
    Matthew 16:24-25
    And that's when I realized I was being sucked into society's view of life. To take what you can before your gone, rather than to prepare for your "real" life.
    And so, personally, I've resolved myself to ask the simple question of "Why?" when I do things from now on. "Because I enjoy it." is not good enough anymore. In fact, I would say I should avoid such things where that is the only reason I do them (i.e. video games and anime for me).
    Because if they are really worth spending time on, I will see them again. I'm sure of it.
  11. Like
    Vitalius got a reaction from mr.squishy for a blog entry, My disturbing revelation.   
    Huh.
    ​So, I had this disturbing revelation. I wish there were a better way to share it with others, because it's hard to explain how everything connects for me. I guess I'll try and start at the beginning.
    One thing you may or may not know about me is that I don't like this world. Not at all. When I was young, I could see that my dreams could never be real in it. Because of this, I usually went to media like video games and anime because they didn't have the limitations this world does.
    As I've grown up, I've played and watched more and more of these stories. And as I've realized how many of them there are, I became disheartened because I realized I could never experience them all in a normal human lifetime (part of the limitations of the world).
    Well, while I was thinking about my relationship with God and stuff, I realized something. This disheartened feeling was causing an evil reaction in me. I mean, obviously being disheartened to things you love in general is bad, but there's a very special reason this particular reaction to this feeling of mine is evil. And that is because of what it implies. But I'll get to what it implies in a second.
    This feeling is based on the idea that I enjoy a certain something (for me, video games and anime, for others, whatever), and that I will do my best, with my spare time, to experience as much of it as I can with that time. And make more of that time when possible. It actually reminds me of a quote I saw once:
    "Everything changed the day she realized there was just enough time in life for the important things."
    Paraphrased, but close.
    Though that implies the same thing that my reaction (which is to experience as much as I can with what spare time I do have) does, but it helps explain what I'm saying, I think.
    The problem with that quote, and the problem with my reaction to that feeling (and the feeling itself, really) is that it implies I'm going to die.
    I'm effectively resigning myself to death by accepting this feeling and reacting to it in this way. That there will be a point where there is "no more time". Which obviously isn't true.
    And then I thought about how people normally lived their lives. How society views these types of things. And from what I can tell, it's the same thing.
    Everyone is living like they are going to die. Trying to claim whatever "life" they can before they do die. Which leads me to this:
    Matthew 16:24-25
    And that's when I realized I was being sucked into society's view of life. To take what you can before your gone, rather than to prepare for your "real" life.
    And so, personally, I've resolved myself to ask the simple question of "Why?" when I do things from now on. "Because I enjoy it." is not good enough anymore. In fact, I would say I should avoid such things where that is the only reason I do them (i.e. video games and anime for me).
    Because if they are really worth spending time on, I will see them again. I'm sure of it.
  12. Like
    Vitalius reacted to wpirobotbuilder for a blog entry, On The Computational Complexity of Being Greedy   
    During my lunch break today, I wrote this MATLAB function:
    function [rate] = greedy( balance, periods, profit)
    % greedy Takes in a numerical balance, an integer number of periods, and
    % the desired profit to be made from the loan holder. Returns the optimal
    % APR in decimal form (i.e. 3.94% = .0394)
    payment = (profit + balance)/periods;
    syms x
    fun = 0;
    for i = 0:periods-1
    fun = fun - payment*(1+x/12)^i;
    end
    fun = fun + balance*(1+x/12)^periods;
    solns= double(solve(fun == 0, x));
    rate = solns(solns> 0);
    end
    The coding description is pretty brief; I'll outline it a little more:
    P is the desired monthly payment from the loan holder such that, over a given number of periods n, we will obtain the desired profit R, in dollars, from an initial loan balance B, also in dollars. It can be calculated as follows:
    P = (B + R)/n
    fun(x) is the amount of money left on the balance B after n periods of interest, which compounds at rate x, assuming the loan holder makes a single payment of amount P every period of interest. It is generated as a symbolic expression of the variable x, which evaluates to:
    fun(x) = B*(1 + ax)n-1 - P(1 + ax)n-2 - P(1 + ax)n-3 - ... - P(1 + ax)1 - P
    Where B is the starting loan balance, P is the required monthly payment, n is the number of periods for interest to compound, and a is the inverse of the rate of interest compounding (1/12).
    The goal is to find a zero of the function fun(x), i.e. (x : fun(x) = 0). This will return the optimal APR such that the loan is paid off in full after n periods of interest compounding.
    This is not easy to solve. The polynomial order of fun(x) grows linearly with n, which means finding the roots of an (n-1)th order polynomial. If your loan compounds over 5 years (60 months), you are solving for the roots of a polynomial that looks like this:
    f(x) = a0x59 + a1x58+ ... + a58x + a59
    Yikes. Fortunately, MATLAB has the beautiful function solve, which you see in the script above. This allows us to solve for all the roots of the polynomial. As it turns out, most of them are complex numbers with a nonzero imaginary part, but most of the time there is one real root, which is the one you care about.
    For example:
    I have a $14162 car loan with a 3.94% APR, to be paid back monthly for 5 years. According to calculator.net, I will give the bank approximately $1463.89 over those 5 years, paying out $260.43 per month.
    Running the MATLAB function,

    We can see that our function works. And if the bank wanted to make a large sum, say $3200:

    That is about the original APR I was offered before I got a cosigner with good credit.
    This algorithm doesn't take very long to run on modern computers, making it incredibly easy to do this. Of course, it didn't stop loaners before, because you could work in reverse, trying different APRs and calculating the profit from each APR until you got something close to what you wanted.
    It was a good lunch break.
  13. Like
    Vitalius got a reaction from Geekazoid for a blog entry, My disturbing revelation.   
    Huh.
    ​So, I had this disturbing revelation. I wish there were a better way to share it with others, because it's hard to explain how everything connects for me. I guess I'll try and start at the beginning.
    One thing you may or may not know about me is that I don't like this world. Not at all. When I was young, I could see that my dreams could never be real in it. Because of this, I usually went to media like video games and anime because they didn't have the limitations this world does.
    As I've grown up, I've played and watched more and more of these stories. And as I've realized how many of them there are, I became disheartened because I realized I could never experience them all in a normal human lifetime (part of the limitations of the world).
    Well, while I was thinking about my relationship with God and stuff, I realized something. This disheartened feeling was causing an evil reaction in me. I mean, obviously being disheartened to things you love in general is bad, but there's a very special reason this particular reaction to this feeling of mine is evil. And that is because of what it implies. But I'll get to what it implies in a second.
    This feeling is based on the idea that I enjoy a certain something (for me, video games and anime, for others, whatever), and that I will do my best, with my spare time, to experience as much of it as I can with that time. And make more of that time when possible. It actually reminds me of a quote I saw once:
    "Everything changed the day she realized there was just enough time in life for the important things."
    Paraphrased, but close.
    Though that implies the same thing that my reaction (which is to experience as much as I can with what spare time I do have) does, but it helps explain what I'm saying, I think.
    The problem with that quote, and the problem with my reaction to that feeling (and the feeling itself, really) is that it implies I'm going to die.
    I'm effectively resigning myself to death by accepting this feeling and reacting to it in this way. That there will be a point where there is "no more time". Which obviously isn't true.
    And then I thought about how people normally lived their lives. How society views these types of things. And from what I can tell, it's the same thing.
    Everyone is living like they are going to die. Trying to claim whatever "life" they can before they do die. Which leads me to this:
    Matthew 16:24-25
    And that's when I realized I was being sucked into society's view of life. To take what you can before your gone, rather than to prepare for your "real" life.
    And so, personally, I've resolved myself to ask the simple question of "Why?" when I do things from now on. "Because I enjoy it." is not good enough anymore. In fact, I would say I should avoid such things where that is the only reason I do them (i.e. video games and anime for me).
    Because if they are really worth spending time on, I will see them again. I'm sure of it.
  14. Like
    Vitalius got a reaction from SirReallySam for a blog entry, My disturbing revelation.   
    Huh.
    ​So, I had this disturbing revelation. I wish there were a better way to share it with others, because it's hard to explain how everything connects for me. I guess I'll try and start at the beginning.
    One thing you may or may not know about me is that I don't like this world. Not at all. When I was young, I could see that my dreams could never be real in it. Because of this, I usually went to media like video games and anime because they didn't have the limitations this world does.
    As I've grown up, I've played and watched more and more of these stories. And as I've realized how many of them there are, I became disheartened because I realized I could never experience them all in a normal human lifetime (part of the limitations of the world).
    Well, while I was thinking about my relationship with God and stuff, I realized something. This disheartened feeling was causing an evil reaction in me. I mean, obviously being disheartened to things you love in general is bad, but there's a very special reason this particular reaction to this feeling of mine is evil. And that is because of what it implies. But I'll get to what it implies in a second.
    This feeling is based on the idea that I enjoy a certain something (for me, video games and anime, for others, whatever), and that I will do my best, with my spare time, to experience as much of it as I can with that time. And make more of that time when possible. It actually reminds me of a quote I saw once:
    "Everything changed the day she realized there was just enough time in life for the important things."
    Paraphrased, but close.
    Though that implies the same thing that my reaction (which is to experience as much as I can with what spare time I do have) does, but it helps explain what I'm saying, I think.
    The problem with that quote, and the problem with my reaction to that feeling (and the feeling itself, really) is that it implies I'm going to die.
    I'm effectively resigning myself to death by accepting this feeling and reacting to it in this way. That there will be a point where there is "no more time". Which obviously isn't true.
    And then I thought about how people normally lived their lives. How society views these types of things. And from what I can tell, it's the same thing.
    Everyone is living like they are going to die. Trying to claim whatever "life" they can before they do die. Which leads me to this:
    Matthew 16:24-25
    And that's when I realized I was being sucked into society's view of life. To take what you can before your gone, rather than to prepare for your "real" life.
    And so, personally, I've resolved myself to ask the simple question of "Why?" when I do things from now on. "Because I enjoy it." is not good enough anymore. In fact, I would say I should avoid such things where that is the only reason I do them (i.e. video games and anime for me).
    Because if they are really worth spending time on, I will see them again. I'm sure of it.
×