# xshortguy

Member Since 09 Aug 2006
Offline Last Active Today, 02:12 AM

### In Topic: For Loop Not Working?

19 May 2013 - 12:47 PM

Run a loop to initialize all of the message variables to "" in the create event of that object.

### In Topic: Pvsnp Problem Example - Solved In Game Maker

13 May 2013 - 12:02 AM

Don't use an ini file. Use a csv file: just parse get the string up to each comma.

### In Topic: 0^0=1? Or Not? -0 Exists Or Not?

12 May 2013 - 11:56 PM

That's not a continuous function. Try differentiating it and you'll see what I mean.

You can't use the rule d(a^f(x)) = a^f(x) * ln(a) * f'(x) because that rule is specifically only for positive numbers. In fact, you'll see that that function is identically the zero function, since (x^2 + 1)/(x^4 + 1) > 0 for all x. So the derivative of the function is just 0 everywhere.

### In Topic: Pvsnp Problem Example - Solved In Game Maker

12 May 2013 - 03:28 PM

I wanted to look at your program, but the fact that I have to type in each student's name is a little over the top.

Instead, you should provide a utility to load a list of names from a document, and a list of incompatible pairs (comma delimited file).

I'll try and provide some insight on the problem, though:

1. The list of incompatible students will typically greatly exceed the number of applicants. For example, for 400 applicants, we can have at most (400 choose 2) = 400!/[(398!)2!] = 400 * 399 / 2 = 78900 incompatible pairs.
2. Assuming that we have half of those as incompatible pairs (39900), generating a list of 100 people involves that, for each person, we loop through all of those incompatible pairs to check to see if they are allowed to be included on the same list. We can choose the first person freely. The second person potentially cannot be paired with the first, the five person potentially cannot be compared with the first four, and so on. So for each pair, we have to check 39900 different combinations to be guaranteed to check.
3. The number of pairs that you will have to check for a group of 100 students is 99 + 98 + ... + 2 + 1 = 99 * 98 / 2 = 4851 . So in the best case scenario, we have to do 39900 * 4851 different checks just to build a list from the first 100 students. If that's not successful, then we have to repeat the entire process of checking 100 students for another pair. Obviously you can do less checks if you find an incompatible pair early, but for those that are OK, you can't avoid these checks.
4. Of course, we can cut down on operations by picking a new student if they aren't compatible on the existing running list that we have, since the goal is to come up with only one list. But even in this case there's no guarantee that we'll be able to generate a list with those first few students (if the first student is incompatible with every other student, then the running list will require a complete run-through in order to tell that (s)he won't be on the list.)

### In Topic: Math Noob Needs A Little Help

11 May 2013 - 01:39 PM

Taking a list of numbers and hoping to find a function for it is often a bad idea. (I can find a function that fits all of those points individually, but the in-between behavior is not what you would want it to be.)

Instead, find a function with some nice properties that behave the way you want it to. (One obvious property is that the function should always be increasing as the input increases.)

I'd recommend sticking to lines and quadratic equations. See a full discussion here:

http://gmc.yoyogames...howtopic=521564