The ProgrammersTalk Community
Forum Register Search Today's Posts Mark Forums Read
Register

Go Back   The ProgrammersTalk Community > The ProgrammersTalk > General Talk


Welcome to the The ProgrammersTalk Community forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.
Reply
 
LinkBack Thread Tools    Display Modes   
  #1 (permalink)  
Old 06-11-2007, 10:53 AM
HelloWorld's Avatar
HelloWorld HelloWorld is offline
Programming Expert
Awards Showcase
Quality Tutorial 
Total Awards: 1
Join Date: Jun 2007
Location: In front of computer...
Posts: 1,111
iTrader: (0)
HelloWorld will become famous soon enoughHelloWorld will become famous soon enoughHelloWorld will become famous soon enough
Icon9 Becoming a Programmer: MATH vs. LOGIC

Personally, I have no clue why do we need bunch of math? Is that because we're just using math to play our logic?

Because I personally think that all these times during my programming training, I never encounter a problem where is required a high level math to solve. But, I also personally think that learning Sequence and Series in Calculus would help a lot, but, the rest seems pretty useless..? Or is it?

On what cases are high level math is really required in programming?

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!

Last edited by HelloWorld : 06-11-2007 at 10:56 AM.
Reply With Quote
  #2 (permalink)  
Old 06-11-2007, 11:14 AM
jbennet jbennet is offline
Novice
Join Date: Jun 2007
Posts: 39
iTrader: (0)
jbennet is on a distinguished road
For game programming you will need to be very good at maths as it uses a lot of triginomenry, calculus and algebra.

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote
  #3 (permalink)  
Old 06-11-2007, 11:21 AM
HelloWorld's Avatar
HelloWorld HelloWorld is offline
Programming Expert
Awards Showcase
Quality Tutorial 
Total Awards: 1
Join Date: Jun 2007
Location: In front of computer...
Posts: 1,111
iTrader: (0)
HelloWorld will become famous soon enoughHelloWorld will become famous soon enoughHelloWorld will become famous soon enough
In some sense it's not going to be a lot of math too though, if you see several game engines these days, they actually already have a collision detection implemented in engine. All things that we need to do is just specifying where are the boundaries.

GarageGames

We do need some math there, but it's now much simpler. Specifying velocity, reducing velocity, that's all.. haha.. you need some sense of trigonometry on 3D game programming, but that's more if you're going to deal more with the Physics aspects

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote
  #4 (permalink)  
Old 06-11-2007, 11:32 AM
Lee's Avatar
Lee Lee is offline
PT Staff*
Awards Showcase
Quality Tutorial 
Total Awards: 1
Join Date: Jun 2007
Location: Blackpool, UK
Posts: 616
iTrader: (0)
Lee will become famous soon enoughLee will become famous soon enoughLee will become famous soon enoughLee will become famous soon enough
I think if you can do "advanced" maths then that will help you a lot but if your just below that there shouldnt be a problem, being clueless at maths will not help you at all though.

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote
  #5 (permalink)  
Old 08-21-2007, 11:29 AM
TeraTask's Avatar
TeraTask TeraTask is offline
PT Staff*
Awards Showcase
Quality Tutorial Quality Tutorial Quality Tutorial 
Total Awards: 3
Join Date: Jun 2007
Location: Reno, NV
Posts: 428
iTrader: (0)
TeraTask will become famous soon enoughTeraTask will become famous soon enoughTeraTask will become famous soon enoughTeraTask will become famous soon enoughTeraTask will become famous soon enoughTeraTask will become famous soon enough
Here's a problem I was faced with just yesterday, so I thought I'd share it with you. I'm not posting my answer to the problem as that will encourage others to offer their suggestions, but I'd like to point out that the problem is simply-stated, requires no advanced math, and is substantially easier if you have a medium-strong background in mathematics. It comes from an upgrade I'm preparing for my automated blog posting software.

Problem Statement
One of my clients is posting to a blog using my automated blog posting program to a blog run by a blogging club. Club rules state that posts may not happen more than once per 24 hours. The program currently allows users to choose posting From X to Y times per Z days and spreads out the posting accordingly. Now, this means that sometimes posting happens a couple of times a day and then not again for a couple of days -- or any combination of things. Make an algorithm that will post the given number of times per the given time period with each post being on different days.

Example
Post from 4 to 7 times per 7 days
Currently the program randomly chooses to post, say 5 times per 7 days. That could be 2 posts on day 1, 1 post on day 4, and 2 posts on day 7.

Again, I have a solution -- I'm just withholding posting for a couple of days to see what others suggest.

Here's what the client suggested -- do you see what's wrong?

Quote:
Force the system to compare the "day" it is supposed to post and if it is equal == then maybe make it "add a day". Like if it is 7 and next post is also 7, then force it to add one to rewrite it to day 8.

__________________
Jeremy Miller
Content Farmer - Optimized Automated Blog Posting

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote
  #6 (permalink)  
Old 08-21-2007, 11:30 AM
TeraTask's Avatar
TeraTask TeraTask is offline
PT Staff*
Awards Showcase
Quality Tutorial Quality Tutorial Quality Tutorial 
Total Awards: 3
Join Date: Jun 2007
Location: Reno, NV
Posts: 428
iTrader: (0)
TeraTask will become famous soon enoughTeraTask will become famous soon enoughTeraTask will become famous soon enoughTeraTask will become famous soon enoughTeraTask will become famous soon enoughTeraTask will become famous soon enough
I should add that I have never had a need for using sequences or series in programming. Albeit my programming is usually business logic and not game programming.

__________________
Jeremy Miller
Content Farmer - Optimized Automated Blog Posting

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote
  #7 (permalink)  
Old 08-22-2007, 04:53 PM
HelloWorld's Avatar
HelloWorld HelloWorld is offline
Programming Expert
Awards Showcase
Quality Tutorial 
Total Awards: 1
Join Date: Jun 2007
Location: In front of computer...
Posts: 1,111
iTrader: (0)
HelloWorld will become famous soon enoughHelloWorld will become famous soon enoughHelloWorld will become famous soon enough
Quote:
Originally Posted by TeraTask View Post
I should add that I have never had a need for using sequences or series in programming. Albeit my programming is usually business logic and not game programming.
I'm not sure... but I believe that it will be used a lot when we're trying to figure out some sequences in some kind of for ... loops and patterns analysis...

__________________
PHP Code:
System.out.println("Hello World!"); 

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote
  #8 (permalink)  
Old 08-23-2007, 09:53 AM
molotov molotov is offline
Novice
Join Date: Jul 2007
Posts: 37
iTrader: (0)
molotov is on a distinguished road
Quote:
Originally Posted by HelloWorld View Post
In some sense it's not going to be a lot of math too though, if you see several game engines these days, they actually already have a collision detection implemented in engine. All things that we need to do is just specifying where are the boundaries.

GarageGames

We do need some math there, but it's now much simpler. Specifying velocity, reducing velocity, that's all.. haha.. you need some sense of trigonometry on 3D game programming, but that's more if you're going to deal more with the Physics aspects
If you're relying on your game engine to do all the work for you, what are you really doing?


TeraTask:
PHP Code:
/*
   because $y is less than or equal to $z, there will never be 
   more than one post per 24 hours, assuming $z is given in whole days.
   if someone tries to post faster than 1 per day, the interval will
   return as 1.
   $post_interval is in days.
  */
$post_interval = ($y <= $z) ? $z/$y 1
The client's suggestion is incoherent to me.

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote
  #9 (permalink)  
Old 08-23-2007, 11:49 AM
TeraTask's Avatar
TeraTask TeraTask is offline
PT Staff*
Awards Showcase
Quality Tutorial Quality Tutorial Quality Tutorial 
Total Awards: 3
Join Date: Jun 2007
Location: Reno, NV
Posts: 428
iTrader: (0)
TeraTask will become famous soon enoughTeraTask will become famous soon enoughTeraTask will become famous soon enoughTeraTask will become famous soon enoughTeraTask will become famous soon enoughTeraTask will become famous soon enough
Quote:
Originally Posted by molotov View Post
TeraTask:
PHP Code:
/*
   because $y is less than or equal to $z, there will never be 
   more than one post per 24 hours, assuming $z is given in whole days.
   if someone tries to post faster than 1 per day, the interval will
   return as 1.
   $post_interval is in days.
  */
$post_interval = ($y <= $z) ? $z/$y 1
The client's suggestion is incoherent to me.

That properly calculates the frequency, but not posting times. Here's my solution:

Quote:
Let x be the number of days to post across. Let y be the number of posts to post within the x days such that y <=x. Then, let z be defined to be equal to x-y. z is then the number of 24 hours periods not consumed by having to wait for 24 hours. Distribute x across z to get a collection of times spread across the "free" days. After each time in the collection, add in 1 day. You will have then distributed the posts as randomly as possible across the time frame with a minimal amount of calculations. The method suggested by the client has the problem of keeping the number of posts to fit within the given time frame; for example, if one had selected posting 4 times per 6 days and the random number was chosen to do the first post on the 4th day, then there would be only 1-2 posts per 6 days.

__________________
Jeremy Miller
Content Farmer - Optimized Automated Blog Posting

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote
  #10 (permalink)  
Old 08-23-2007, 12:55 PM
molotov molotov is offline
Novice
Join Date: Jul 2007
Posts: 37
iTrader: (0)
molotov is on a distinguished road
Quote:
Originally Posted by TeraTask View Post
That properly calculates the frequency, but not posting times. Here's my solution:
How is the frequency different from the posting times? Perhaps I misunderstood the problem.

Quote:
Originally Posted by TeraTask
Make an algorithm that will post the given number of times per the given time period with each post being on different days.
My solution does exactly this; $post_interval will always be greater than or equal to 1, so the posts will be made at least 24 hours apart.

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

   Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -7. The time now is 12:56 PM. Powered by vBulletin
Copyright © 2000 - 2007, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO © 2007 ProgrammersTalk Sedo - Buy and Sell Domain Names and Websites project info: programmerstalk.net Statistics for project programmerstalk.net etracker® web controlling instead of log file analysis


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50