Arithmetic Optimizer

Discussion in 'General Off-Topic Chat' started by Zetta_x, Jun 25, 2012.

Jun 25, 2012

Arithmetic Optimizer by Zetta_x at 6:07 AM (394 Views / 0 Likes) 5 replies

  1. Zetta_x
    OP

    Member Zetta_x The Insane Statistician

    Joined:
    Mar 4, 2010
    Messages:
    1,844
    Country:
    United States
    Ok;

    I have taken a class in C++ a little over 6 years ago and haven't used it since. I have programmed in SAS, R and a number of other Statistics program language but I have completely forgot C++.

    I had an idea that I can make a program that spits out arithmetic problems but it alters the difficulty based on a number of factors. Some of the factors I have thought are the number of correct answers and the time it takes to finish each question.

    The idea is that a person can practice on the problems that is at their difficulty to optimize efficiency of practicing arithmetic. At it's current stage, it lets you pick how many questions you want to do (and it spits out start time). It has a variable called factor and for each correct problem the factor increases by 1 and for each wrong problem factor decreases by 1. As factor increases the difficulty increases.

    What I want to do is also increase/decrease difficulty based on time. However, time is also relative per person. It may take me a second to do a problem while it may take another person 10 seconds; so how do I create the time. Also, if the problems are going to change in difficulty, that means problem 100 is gonna be a lot harder/easier than problem 30. The idea is to use statistical models to use the collected previous problems to build an expected value for the next problem. If the person takes a significant longer time to do the problem with it's expected value, it decreases the difficulty (Same thing for the inverse case).

    The reason why I am building this program is to re-learn C++; also, I have always been fascinated with numbers and patterns. I used to be able to calculate arithmetic almost 100% accurate and extremely fast, however, I have lost touched with it as a lot of my studies do not involve numerical calculations. Now that I am in a PH.D. program for statistics, I wanted to take this Summer to catch up on what I used to have.

    What are your opinions; anything I can do to make it interesting, know any other factors I can use to build the difficulty model?


    Here is a picture of it currently

    Warning: Spoilers inside!
     
  2. Mewgia

    Member Mewgia drifter

    Joined:
    Dec 16, 2006
    Messages:
    2,161
    Location:
    Boston, MA
    Country:
    United States
    What's the measure of difficulty?
     
  3. FAST6191

    Reporter FAST6191 Techromancer

    pip
    Joined:
    Nov 21, 2005
    Messages:
    21,735
    Country:
    United Kingdom
    Yeah measuring difficulty is a tricky one. My first thoughts would be to go to fractions (whether you want to do actual fractions*, something more akin to money problems or things with fairly simple rational results is up for debate) and known results of equations (log 100 = 2 and such) as frankly being able to operate those leads to a far greater understanding of maths when I have seen it. This however runs the risk of pulling focus from what you have set out to do.

    *to so many decimal places/SF if you want but a lot of division is not that bad (an example I have used in the past but something like 55/3 = 45/3 + 10/3 = 15 + 3.33333.... = 18.33333).

    Also timing... tricky that as it encourages speed* rather than accuracy. Perhaps allow two stages with a second ten seconds to check results and enter a new one (penalised, noted or nothing I leave to you). "same thing for the inverse case" would scream game the system to me.

    *I always liked those tests where you are forced to turn over the page but they leave you with an answer sheet on which to write the answer as the next parts always seemed to be what does this word mean and memorising questions never seemed to be that hard.

    Bonus feature- maybe the odd question somewhat above their level wants to be tossed in there (scored or not is left for debate). If nothing else monotony, which can happen even on twenty questions, is rarely a good thing.

    I should note I do not place much stock in arithmetic (although it is preferable to knowing times tables) and if I may make an analogy it is a bit like being a walking dictionary when it comes to writing a properly structured argumentative essay.

    Anyway now I have just waffled for a few lines and probably said nothing of great interest I probably should catch up on the rest of the new posts.
     
    1 person likes this.
  4. Zetta_x
    OP

    Member Zetta_x The Insane Statistician

    Joined:
    Mar 4, 2010
    Messages:
    1,844
    Country:
    United States
    My fascination with arithmetic is pretty unique; not many people like numbers as much as I do ;)

    Thanks for the replies!

    The difficulty is going to be the average of the minimum and maximum integer that is possible. So when modeling difficulty, we would be modeling the minimum and maximum integers that can be displayed. Since multiplication takes two numbers and it's communitive, I can use the same model for both integers and it shouldn't make a significant difference.

    In C++, the model I currently have is (rand() % a) + b.

    The problem with this model is that if b is increased by 1, not only is the mimimum increased but also the maximum by 1. So to exclusively only increase the mimimum, by adding 1 to b, we would also subtract one from a. If we wanted to strictly increase the maximum, adding one to a would suffice.

    Now we have to model the minimum and maximum; I think if someone were to complete the problem extremely fast, we don't necessarily have to increase the maximum but increase the mimimum. For example, if the minimum is 1 and maximum is 85; it is possible (but not probable) to get 1 x 85. Instantly it would be 85 by the identity property of 1 and completing this problem would be significantly faster than all of the other problems. Therefore, the program would increase the minimum.

    Similarly, the number of correct answers would increase the maximum. If you are getting the answers correct, chances are that you are still in the realm of numbers you are comfortably working with.
    The models for maximum:

    maximum: (a + b) = c*factor (where factor is the number of correct answers); c is some proportionality constant to be decided (does not need to be an integer)
    minimum: b_0 + b = d_1*x1 + d_2*x2 (x1 and x2 are coded variables and b_0 is the previous value of b). If the time to complete the previous problem is two standard deviations away from average, then (x1 = 1, x2 = 0, d1 = some negative/positive constant of proportionality). If it falls from 3 standard deviations from average then (x1 = 0, x2 = 0, d2 = same deal). Obviously |d2| > |d1|.

    The constants of proportionality do not have to be integers, I can use ceiling or floor functions to create them into integers. If I do a .5 chance to be ceiling or floor integers, the expected value of both of them would make it unchanged. I can map the probability of doing the ceiling function = proportion of correct => higher of proportion of correct the more the integers will be rounded up => increased difficulty.

    Those are my ideas

    --

    So far I'm only building up multiplication but general arithmetic is my goal :)
     
  5. FAST6191

    Reporter FAST6191 Techromancer

    pip
    Joined:
    Nov 21, 2005
    Messages:
    21,735
    Country:
    United Kingdom
    I have no real quarrel with your setup at this point* but all through reading it I was recalling the time I was winding up my then quite young siblings doing the ???X999 trick but these days I rarely bother to multiply by anything more than the base I am working in at once in my head and will always split things and/or go to the next base multiple and take away from that.

    *no quarrel but maybe a suggestion, it feels cheap but that is what programming is about so I guess I will go it. In the realms of mental arithmetic multiplication not all numbers are made equal (and that is not just talking about 10) so perhaps a nice premade table of primes and/or certain odd numbers to spice things up a bit.

    As for numbers- number theory, relation of fractions and all things along those lines are great fun (if nothing else number theory is quite easy to smash into another area of physics or maths) but plain arithmetic seems kind of boring.
     
    1 person likes this.
  6. Zetta_x
    OP

    Member Zetta_x The Insane Statistician

    Joined:
    Mar 4, 2010
    Messages:
    1,844
    Country:
    United States
    I would love to implement a way to throw in prime numbers so it avoids numbers like 10 where it's amazingly easy. The main reason why I had chosen multiplication is because (and this is being a bit selfish) I know a lot of arithmetic tricks that involve addition and subtraction when multiplying.

    For example 37^2 = 35^2 + (some Number) | 35^2 = 1225 or (3 * 4)25 (you take the tens digit and multiply it with the next consecutive number then attach a 25). The (some number) is (the number we want to square + the number we mapped it to) * (the distance away from each other) so 37^2 = 35^2 + (35 + 37) * 2 = 1225 + 72 * 2 = 1225 + 144 = 1369

    Another trick: 21 * 18 = 20 * 18 + 18 = 360 + 18 = 378

    Another one is 18 * 24 = (21 - 3) * (21 + 3) (You take the average and then add/subtract the distance) = 21^2 - 3^2 (because (x-y)(x+y) = x^2 - y^2) = 441 - 9 = 441 - 10 + 1 (didn't really need to do this step, I find it easier to do tricks like this one) = 431 + 1 = 432

    Every once in a while I will do multiplication as taught in elementary school just to help develop my memory.

    So the really selfish reason why I like the multiplications is because is holds a little of everything for me. Another reason why I like doing arithmetic is:

    1) It helped build my memory. I can almost do 4 digit multiplication in my head, the prime challenge is remembering all of those numbers.
    2) There is almost no competition in my classes when it comes to accuracy and speed; while it seems selfish to be the fastest and most accurate, most of my overall grades were based on the position I was in my class relative to the other students.
    3) Algebra is easy with good arithmetic. Calculus is easy with good algebra. All other applied mathematics become fun when you don't need calculators.
    4) My confidence with numbers have lead me to good places. I have been a tutor for many years and part of my success is how fluently I can explain mathematics.
    5) My confidence with mathematics and patterns have helped me in many different areas outside arithmetic.

    I really do agree that a lot of the modeling that can be done can be carried outside to general problems such as statistics or some physics; I think the core idea would be to build a program that develops a model based on the user vs some pre-defined model.
     

Share This Page