Math: A bi-weekly journal describing the use of math in solving programming problems

This is just an introduction to the series. Basically, I've been challenged to point out various ways that I use math in order to solve programming problems and create business solutions. Now, thinking back over the past week, I constantly use math, but normally this results in simple arithmetic, counting, and some basic usage of sets. That isn't really a crowning endorsement to go out and study complex maths though if in 20,000 lines of code written each week only grade school techniques are required.

Over the course of a week, the majority of the code that I write currently is for a number of game engines soon to be released on G4. Lately, I've been working on the children's section of the site, and teaching kids that are already good at games, why they are good at games is the goal. That is going to give me a large number of commonly played miniature games to examine using math. And I definitely mean a lot. Of course games use a lot of math. In fact the original assertion was to leave out anything to do with path finding and collision detection. I could have given about 50 more areas I should stray from.

Another place I tend to use a lot of mathematics is in working with UI. Everything dealing with UI is math based from the layout and sizing of controls to the counless uses of functional interpolation in rendering shapes and other features. I've been living in Pov-Ray as well, so I should be able to point out where math comes in handy for creating things that we'd normally think are quite simple.

The remainder of the series will be related to hodge-podge items. I'll definitely throw some of the voodoo that is performance in there. I also use math for regular expressions, even if it does just come down to counting, so I"ll probably hit on a few of those. If I actually accomplish anything in artificial intelligence that isn't game related I'll toss that in as well.

The only stipulation is that none of the things I write about are made up. I have to be actively working on actual projects. That won't be a problem I can assure you. I'll try and keep the postings short and to the point, and I'll make sure to include the actual math with some pointers to MathWorld so you can check everything out. Well, see you 3 to 4 days from now (or maybe sooner, not sure yet).

Published Thursday, August 12, 2004 6:10 AM by Justin Rogers
Filed under:

Comments

Thursday, August 12, 2004 9:41 AM by John Kemp

# re: Math: A bi-weekly journal describing the use of math in solving programming problems

I'm planning on offering a 1 or 2 day workshop to middle-schoolers at my church who are interested in learning game programming. Do you have any suggestings for what language would be best? Most (all?) of these kids won't have any idea about C++/DirectX. I was thinking about going into basic game theory (I enjoyed your blackjack web casts), basic programming, and maybe a simple 2d scroller with simple collision detection. Any thoughts?
Thanks,
John
Thursday, August 12, 2004 10:20 AM by Justin Rogers

# re: Math: A bi-weekly journal describing the use of math in solving programming problems

Couple of thoughts.

1. If you are located in Washington State then I'd be more than happy to help you out by delivering some of the G4 content and see how the kids like it.

2. With middle-schoolers focus on games they are already familiar with and show them how they work. Hard-core mathematics might be too much for them to understand, but there are many relational concepts and hidden rules you can point out that they might not know yet.

3. Remember these kids are going to be more familiar with console games than computer games. Take advantage of that and build your samples around well-known mainstream games. Use icons like Mario, Pokemon and Tony Hawk, etc...

4. If you plan on using a game, make sure you have something playable and short that they can see. Don't expect them to know about the game already. I made this mistake when sampling a few games and only realized later that the target audience had never even played those games.

5. If you do make a game as complex as a 2D scroller, don't make the game itself the project. Instead spend the extra time to write the code for the 2D scroller, and give them some way of changing the levels and working with collision detection at the design level rather than the programming level.

The point here would be showing them how to construct worlds out of the blocks, letting them see the blocks and how things interact with them, and how the block doesn't have to represent the precise shape of the object being displayed.

By changing the parameters for the rectangles and/or collision spheres they can change how the game is played and interact with principles of consistency. Set up small challenges for them like creating a set of steps or something more ingenious like creating the entrance to a hidden zone by making use of the bounding regions in a creative way.

In the end, you only have 1 or maybe 2 days to push all of the content. Plan for 3 days worth of content and then judge interest. If the kids are happy with game theory and basic games then there is no reason to start into the process of programming. The programming tends to be an open ended tool, often more destructive than good until the user is adept with it.
Thursday, August 12, 2004 11:01 AM by John Kemp

# re: Math: A bi-weekly journal describing the use of math in solving programming problems

Thanks for the feedback. I really appreciate it. I'm actually in St. Louis, MO so it may be a bit far for you to come. I like what you said about staying more high level. I tend to get so excited about this stuff I would most likely try to do 4 semesters of material in 2 hours. Anyway, great insight, especially since you've presented to kids before, and keep up the good work. I really enjoy reading your blog.
Saturday, August 21, 2004 2:47 PM by Doug_H

# re: Math: A bi-weekly journal describing the use of math in solving programming problems

Enjoy following your blog (almost day by day). Have learned much! Hope you can keep posting.

My dilemma is in choosing a starting language for my (braniac) 17 year old son. He's a serious gamer and can, when he's interested, digest extremely complex technical stuff quickly. However, he's also pretty lazy and easily bored. I think maybe that if he got a taste of programming (esp. games) he'd be hooked.

I prefer C++ and so would like to teach him programming using that, coupled with his interest in gaming, as the "carrot dangling in front of the rabbit". I have voluminous C++ tools and resources, especially 2D and 3D graphics and gaming development - plus I'm comfortable in that area. The problem is that using that route requires a pretty substantial period where he wouldn't be seeing many stimulating rewards for the efforts that he'd be required to make. I've been checking out Blitz Basic (3D game development language) as a possible alternative learning environment but was wondering if you or anyone had any insights into how to help easily bored but talented kids in learning programming these days. If I can figure a way to do this successfully with my son I'd like to offer my skills to the community and maybe help some other bright but "problem" kids catch the programming bug.
Saturday, August 21, 2004 4:01 PM by Justin Rogers

# re: Math: A bi-weekly journal describing the use of math in solving programming problems

Something is wrong with the comment posting tool here and I can only post at about 700 characters at a time. Doug, contact me through my contact form, and I'll drop you the text I was going to post as a comment through email.
Thursday, January 10, 2008 11:28 AM by snoneycle

# re: Math: A bi-weekly journal describing the use of math in solving programming problems

Tuesday, January 15, 2008 5:11 AM by idiods

# re: Math: A bi-weekly journal describing the use of math in solving programming problems

hmmmm...very interesting!

Thanks <a href=http://google.com> google </a>

Thursday, January 17, 2008 11:46 AM by PawJeage

# re: Math: A bi-weekly journal describing the use of math in solving programming problems

hmmmm...very interesting!

Thanks <a href=http://bigoogle.com> google </a>

Sunday, May 17, 2009 9:21 AM by nick_orelac

# re: Math: A bi-weekly journal describing the use of math in solving programming problems

Leave a Comment

(required) 
(required) 
(optional)
(required)