Author Topic: How to improve math skills?  (Read 42227 times)

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: How to improve math skills?
« Reply #15 on: February 16, 2015, 01:03:26 PM »
Wouldn't it be easier to find a good implementation of the algorithm?

Well, it looks like I did found one that is working properly. What do you know! And I even got the filled version working by using a trick where first the fill was done and then outlines, because there is some kind of logic problem in filling routine which is always destroying x coordinate edges.
« Last Edit: February 16, 2015, 01:37:02 PM by Krice »

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: How to improve math skills?
« Reply #16 on: March 04, 2015, 12:36:23 PM »
I'm reading "A History of Mathematics" third edition by Merzbach and Boyer. I like history and even math history seems to be interesting. I'm sure this is not the best way to actually learn math, but I guess some concepts may become somewhat clearer. The book is nice 600+ pages of text mainly, with readable old school book font.

Pickledtezcat

  • Rogueliker
  • ***
  • Posts: 62
  • Karma: +0/-0
    • View Profile
    • Pickledtezcat Game Development Blog
Re: How to improve math skills?
« Reply #17 on: March 07, 2015, 12:49:56 PM »
I know where Krice is coming from with this.

I last studied math properly in high school (secondary school, I'm from the UK) and we dealt with trig and algebra and other stuff, but most of the time I was thinking "I'm never going to use any of this in real life" so I didn't bother to remember any of it beyond the final exams.

Now I sometimes find myself having to deal with things like vectors, matrix transformations and other things which I have no formal education in.
Usually if I go through a couple of code examples which show the concept in action, I can understand it through code, but I can't understand it through "math".

Dot Product

As a layman trying to understand that wiki page just gives me a headache, so I end up resorting to pages with titles like "math is fun!" Which I can actually understand pretty quickly.

Is there anywhere I can find a guide to the kind of notation I frequently run in to when looking up a complicated math concept? I'm not an idiot but I studied Fine Art in University, not Mathematics.

Or do I really need to understand the maths notation at all? When trying to write a convex hull algorithm in python I first checked the wiki page about convex hulls and got this equation which just made my eyes bleed.

But when I started reading more and got in to the algorithms I had no trouble following the steps of the pseudo code to write my own python implementation. I guess if I really knew what was going on it might help me if I made a mistake in the coding, or if I wanted to optimize my algorithm, but mainly it doesn't seem that hard to get something that works. And I don't expect I'm going to invent a better algorithm all on my own.
 
A blog about my 3d Roguelike: http://pickleddevblog.blogspot.kr/

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: How to improve math skills?
« Reply #18 on: March 07, 2015, 06:37:53 PM »
The way I understand it is that notation is like the language syntax of a programming language, which is used to describe underlying concepts (like inheritance or private data in programming). You need to learn both, of course. The modern notation of math is "short" as in Lisp so I think it's not that easy to read, but it's equally important to understand the concepts. Some people can understand those concepts easier, while others have more difficulties with them. I don't know if there is a direct relationship to intelligence, because even I have difficulties with math I don't think I'm less intelligent in other ways. In a way math can be too simple to understand for highly creative people like myself, whereas many of those who are good at math are far less creative.

Eudoxus

  • Newcomer
  • Posts: 20
  • Karma: +0/-0
    • View Profile
    • Email
Re: How to improve math skills?
« Reply #19 on: March 07, 2015, 07:59:24 PM »
and got this equation which just made my eyes bleed.

Believe it or not, that equation is actually not bad once you know what the symbols mean.  Krice is correct,  math language/symbols tend to be very dense and you have to read it a bit slower.

Have you ever used list comprehensions in python?   Python comprehensions are very similar to the notion being used in that equation.  The convex hull equation is just saying "take all linear combinations of S with this certain property".  Where the property is "the coefficients are all non-negative and they sum to 1".  The big symbol, the capital sigma, is just saying to add things up (ie the linear combinations).
« Last Edit: March 07, 2015, 08:15:36 PM by Eudoxus »

mushroom patch

  • Rogueliker
  • ***
  • Posts: 554
  • Karma: +0/-0
    • View Profile
Re: How to improve math skills?
« Reply #20 on: March 07, 2015, 09:17:25 PM »
re: the offending formula on wikipedia:

That's indefensibly badly written, especially for a general audience. Use of that carrot notation for "and" is not widespread even in the mathematics literature. It just shouldn't be there. Unfortunately, wikipedia articles on mathematical topics that can be easily grasped by people outside of the research community are plagued with this kind of garbage. It gives the half-educated a sense of accomplishment to write expressions like that.

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: How to improve math skills?
« Reply #21 on: March 08, 2015, 12:41:51 PM »
Or maybe creative people are stupid and creativity is simply a by-product of their attempts to find out how things work.

mushroom patch

  • Rogueliker
  • ***
  • Posts: 554
  • Karma: +0/-0
    • View Profile
Re: How to improve math skills?
« Reply #22 on: March 09, 2015, 01:12:37 PM »
No, I don't think so.

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: How to improve math skills?
« Reply #23 on: March 21, 2015, 04:23:38 PM »
Still 300 pages to read from History Of Mathematics. I was surprised to learn the relationship between geometry and numbers, or at least that it seems to have been an important part of maths. Also, I'm now interested to know why it was (and is?) important to find normalized values for series of numbers that in normal logic has infinite value. Even the concept of series is kind of hazy. Why they are important in the first place?

Themace

  • Newcomer
  • Posts: 1
  • Karma: +0/-0
    • View Profile
    • Email
Re: How to improve math skills?
« Reply #24 on: March 23, 2015, 02:49:38 AM »
I'm not sure what your current level or where the gaps are. If you might brush up on what is taught is US elementary and high school you could consider going through the Common Core resources at Khan Academy:

https://www.khanacademy.org/commoncore

From there the more advanced resources at Khan Academy or MIT OpenCourseWare

http://ocw.mit.edu/courses/find-by-topic/#cat=mathematics

might work for you. Also wikipedia has a decent starting glossary of math symbols:

http://en.wikipedia.org/wiki/List_of_mathematical_symbols

if you run across equations with unfamiliar symbols. Beyond that if you post specific questions I'll try to help. Or if you and/or others want to talk about specific math issues over Mumble we can setup a time to meet on my server.

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: How to improve math skills?
« Reply #25 on: March 23, 2015, 01:17:32 PM »
Calm down. My method for learning math is read anything I can and try to pick up pieces, but not take it too seriously. So it's much like my way of learning how to play drums.

Soulmask

  • Newcomer
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: How to improve math skills?
« Reply #26 on: April 13, 2015, 11:28:07 PM »
I don't think reading math books will improve your programming skills.

This is something I found true of a lot of developers. Unless they use the most complicated math or physics, they think their game will be bad. Other developers who are good at math focus on making complicated maths and then when their game is done no one sees the math going on and the actual game sucks(while nobody cares about their I'm good at math look at my shiny maths rants). Focus on simulating realistic gameplay instead of trying to do real physics simulation. There is no difference between a direction, speed and acceleration variable together and a mathematical vector. A matrix is not much different then an excel chart. A lot of people reading this will think I'm saying this because I suck at math but in fact I don't. Math comes naturally to me. Complicated math doesn't belong in a game, the player won't notice any difference between realistic simulation vs real physics simulation and like in dwarf fortress the physics even if based in reality will end up making weird game play like whips being lightsabers, some blunt weapons being super bad, and naked+4 adamantine cloaks being the best armor.

If you need to focus on math, you should try to think a lot about "financial" type math, ie exponential functions(x=x+x*0.1 recursive loops), if you want RNG, look for mersenne twister and int normal distribution libraries and real normal disbution, if you're in c++ then there's random in the STL which is FAR better than rand from c.

For reference charts I mostly use excel and do a beta chart, and then when I finished the design of the chart(every basic thing as a value) I look for formulas that could automate the charts. Once, the tab I came up with was too complicated to ever find a formula without wasting ridiculous amounts of time, so I just made a function that took an int and then returned an int. This started with my "Building" skill, I wanted to get a quality modifier depending on building skill of a character to randomize building quality. I'll attach the chart I finalized.

So maybe this can help you so I'll describe the process that I used to come up with this chart, at first I was trying for formulas to automatically get % for quality types, but I never came close to get a beginning of formula. If anything I'd have to get 10 different and huge formulas to make a chart resembling this I think(I might be wrong). In the end I chose to do the whole chart by hand, but even this needed some work. I started from the terrible quality at 100% odds. then it decreases rapidly, and for every other quality except the 2 last ones the "peak" is 30% so I chose my numbers depending on that and sometimes approximately approaching a normal distribution and sometimes a "thinner" distribution.

So you cant see the terrible at 100% and masterwork at 100% that ended up in the code, but it's very simple really, I just took 5% from terrible at every step(for 100% terrible you need negative skill which you can only have with debuffs) until it reached 0 and gave the 5 percent somewhat randomly and to get at masterwork 100%, I took back 4% of the last quality past skill lvl 50 and gave them to exquisite and masterwork(if the quality has <4% then i take it all and the rest from the next), then when exquisite and masterwork were 50-50, i gave 5 percent from exquisite to masterwork until it goes to 100%. The "hardest" thing was to know how to add percents between 0 and 50 skill, and once I went with "every quality has a peak of 30% except the first and 2 last ones" then I built around from there. The end result is not perfect, but it's charming, at least to me, and I think I ended up with a good solution.

edit: also the normal skill cap is 50 and you can only get to 100% masterwork with a lot of skill buffs.

I'll never use overly complicated maths like integrals in the code, this is a game after all and not a scientific simulation software. I'm not bad at math, if anything I'm good at it, but I have the principle to use the simplest method until I'm forced to use a more complicated one.

Heres the link to excel file
http://www.filedropper.com/buildingqualityhiroguetemple

I hope you read my whole post and deduce that reading math books is not the best option for you :D
« Last Edit: April 14, 2015, 01:34:25 AM by Soulmask »

Soulmask

  • Newcomer
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: How to improve math skills?
« Reply #27 on: April 13, 2015, 11:57:25 PM »
If you only need to understand one thing from my post it is this, determine how you want the basic numbers to look like, and determine how they should behave. What does strength stat represent? Will having twice has much STR mean that I'm twice as strong or every 10 points of STR means that you are twice as strong? Do I want a normal distribution for attribute randomization? How high does the new game attributes need to be in order to represent correctly the attributes of a character VS a mob? Focus on what every variable means exactly and try to make them not be too broad, for example agility in my game represents quickness of muscles(str of muscle relative to body weight) and hand-eye coordination, while perception means acuity of the senses(mostly sight and smell). Also the detection and stealth skill represent training and experience(not game XP but real life experience). By that sense, a blind monk would have low perception but high detection skill. Once you know what every variable means exactly, its much easier to know how to give values to the numbers and build formulas for them.

Soulmask

  • Newcomer
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: How to improve math skills?
« Reply #28 on: April 14, 2015, 12:25:58 AM »
Ok I think there's a lot of mathematical elitism in here so I changed this post.

Math is a tool. It is as good as you can use it. If you make a bad game with huge level math, you've haven't achieved anything. Einstein thought that creativity came with intelligence, but I think he was mixing the two kinds of real intelligence(not talking about g here). There's technical intelligence and then there's divergent thinking. Technical helps you understand math. Divergent thinking helps you being creative. A person who has both, like Einstein, can be a genius and invent new concepts that are actually true. Meanwhile, the people who have the best IQ might be living calculators but they will not achieve anything significant apart from being good in their day job.

There's a ton of technically good programmers, but a lot of them are code hermits. They focus on making the best code, the best physics engine and high level maths. Meanwhile, their game sucks. On the other spectrum, only "better than average" IQ people with divergent thinking make unique fun creative games. Then there's the high technical intelligence AND divergent thinking people who are good at both.

Finally, if you think programming is about mathematics, you are wrong. It's about abstraction. If there's 2 games, and in both you have a dwarf smashing a rock with his warhammer in 2, but in one game it uses complex physics and the other uses simple abstractions, the most efficient game is the latter one. We're not making scientific simulation software. To the player, both games will be the same, but it will have taken a lot less time for the latter game to be made, allowing more time to complete the game and focus on other things. The more realistic the physics you try to make into the game, the more you'll break your teeth on the code and the more likely weird stuff will happen in the game afterwards because it's too complicated(dwarf fortress).

Unfortunately, both technical intelligence and divergent thinking can't be thought, but the more you focus on mathematics and the less you focus on the actual GAME. What's the point of making a game if all you do i think about maths and physics and you never think about the fun stuff?
« Last Edit: April 14, 2015, 02:28:26 AM by Soulmask »

Soulmask

  • Newcomer
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: How to improve math skills?
« Reply #29 on: April 14, 2015, 03:19:44 AM »
re: the offending formula on wikipedia:

That's indefensibly badly written, especially for a general audience. Use of that carrot notation for "and" is not widespread even in the mathematics literature. It just shouldn't be there. Unfortunately, wikipedia articles on mathematical topics that can be easily grasped by people outside of the research community are plagued with this kind of garbage. It gives the half-educated a sense of accomplishment to write expressions like that.

I was planning to be subtle but the way you insult people while saying incorrect statements is just too much. You imply that the notation for carrot AND is not widespread. Not only it doesn't matter at all, but discreet mathematics use it. Arguing about correct notations is like arguing over the best color. You refer to people outside the math research community has half-educated and laymen while calling a notation garbage. It is you who is trying to give yourself a sense of superiority over futile things, and not only that you're insulting everybody else in the meantime. You are criticizing the method rather than the concrete content. Especially in programming, many different ways can achieve the same thing.
« Last Edit: April 14, 2015, 04:44:47 AM by Soulmask »