Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 87 88 [89] 90 91 ... 173

Author Topic: Mathematics Help Thread  (Read 216345 times)

ed boy

  • Bay Watcher
    • View Profile
Re: Mathematics Help Thread
« Reply #1320 on: October 27, 2013, 06:10:18 am »

Let's say you have a X by X grid of squares.  In each square, you can place an A or a B.  Each has the following value:

A is always worth 1 point.
B is worth 1 point plus one for each A in a square adjacent or diagonal to it.

Define the value of an X by X grid of squares as the sum of all A's and B's within it.

So if we look at a simple 3 by 3 grid with the following values:

A B A
B A A
A A B

We can see that it is worth:

6 (for the value of the A's)
plus 5 (for the value of B in the first row)
plus 5 (for the value of B in the second row)
plus 4 (for the value of B in the third row)

for a total of 20.

Is there a general rule to find a maximum value of an X by X grid?
Maximizing gets easier as X gets larger, as we can assume that none of the grid squares are on the edges. If X is not large, then there is no real solution other than trial and error of every possible arrangement.

So let's assume that X is sufficiently large that we can assume that the non-edge squares dominate the sum term.

Suppose that we have I squares labelled A and J squares labelled B. We can see that, given A and B, the more evenly spread out they are the better - after all, having large clumps of A and large clumps of B is inefficient (this is not a rigorous proof, but to prove it would be awkward). So for a maximal distribution, we shall assume that the As and the Bs are evenly spread out.

Each A is worth 1 point, and each B is worth 1 point plus 1 for every A adjacent to it. Since we assumed that the As and the Bs are evenly spread out, we shall assume that the Bs all have the same number of adjacent As (except the edge cases), which is eight times the proportion of As(since each B has 8 adjacent squares). If I is the number of As, J is the number of Bs, S is the score, and N is the total number of squares, then we have:
I+J=N
S=I+J*(1+8*I/N)
Hence:
S=I+(N-I)*(1+8*I/N)
S=N+(N-I)*(8*I/N)
S=N+8*I*(N-I)/N
As we can see, this is quadratic in I with a negative square term, so it has a single turning point which is a maximum. If we differentiate with respect to I, then we get:
dS/dI=8*(N-I)/N-8*I/N
at the maximum:
8*(N-I)/N-8*I/N=0
N-I-I=0
I=N/2
So the maximum score is obtained when there are as many As as Bs.

Note that this method does not consider the edge squares, those would have to be worked out by another method.
Logged

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: Mathematics Help Thread
« Reply #1321 on: October 27, 2013, 08:19:58 am »

Okay first of all, ed boy, your reasoning and estimated score result are false, because the proportion of As touching each B is not equal to the global ratio of As to Bs. Easiest example:
Code: [Select]
AAAAA
BBBBB
AAAAA
BBBBB
AAAAA
If you expand this pattern, it has a 1:1 ratio of As to Bs, but every B touches six As instead of only four, so it gives a larger score than your S=I+J*(1+8*I/N).

Here's an easier reasoning to get a perfectly accurate result:
You get exactly the same score if you assign points like this: One point for each letter, plus one point for each pair of touching A's and B's. So what we want to do is maximize the number of heterosymbolic relationships. The problem is that we have lots of "love triangles" of the form
Code: [Select]
XY
Z
which guarantee that there is at least one homosymbolic relationship inside. There are also "love quadrangles"  of the form
Code: [Select]
XY
ZW
which have at least two homosymbolic relationships inside. Our goal is to find an upper bound on the number of possible heterosymbolic relationships, and we can do this by finding a lower bound on the number of homosymbolic relationships. To do this, we'll have a look at this image:

Here I've placed some love triangles and quadrangles onto the board (in this case 4x4), and I've called them "special". Every special love n-drangle is disjoint from all others, which means that any homosymbolic relationship can only be part of at most one special n-drangle. This means that there are at least one HR per special triangle and two HRs per special quadrangle, and since there are (X-1)(X-2) special triangles and (X-1) special quadrangles, we find that we have at least X(X-1) homosymbolic relationships, regardless of our distribution of As and Bs.
Now since there are exactly (X-1)(4X-2) total relationships, we find that at most (X-1)(3X-2) relationships may be heterosymbolic at any time, so the total score of a character distribution is at most (X-1)(3X-2) + X².
To show that this score is actually possible, we simply give a distribution of As and Bs that has this score:
Code: [Select]
AAAAAA...
BBBBBB...
AAAAAA...
BBBBBB...
AAAAAA...
BBBBBB...
...
...
And that's a complete proof that (X-1)(3X-2) + X² is the maximum possible score for an X-by-X grid. This, fellas, is real mathematics.

Edit: If I may ask, Bouchart, where did you get this problem from?
« Last Edit: October 27, 2013, 11:54:51 am by MagmaMcFry »
Logged

Pnx

  • Bay Watcher
    • View Profile
Re: Mathematics Help Thread
« Reply #1322 on: October 28, 2013, 11:21:18 am »

Ok, I'm mostly done with my math stuff before the upcoming deadline. But there's two last problems giving me trouble.

The first is:  limx->1 of (2-x)tan[x*pi/2]

The second is: limx->0+ of xsin(x)

I know in both cases I should be using a natural log to figure it out, but I still can't seem to be able to solve either of them no matter what I do.
Logged

da_nang

  • Bay Watcher
  • Argonian Overlord
    • View Profile
Re: Mathematics Help Thread
« Reply #1323 on: October 28, 2013, 12:20:43 pm »

Ok, I'm mostly done with my math stuff before the upcoming deadline. But there's two last problems giving me trouble.

The first is:  limx->1 of (2-x)tan[x*pi/2]

The second is: limx->0+ of xsin(x)

I know in both cases I should be using a natural log to figure it out, but I still can't seem to be able to solve either of them no matter what I do.
You have 1±∞ on the former and 00 on the latter. If you rewrite the expressions as functions of the exponential function, you can move the limit into the exponent and use L'Hopital's rule on the resulting indeterminate forms respectively.
Logged
"Deliver yesterday, code today, think tomorrow."
Ceterum censeo Unionem Europaeam esse delendam.
Future supplanter of humanity.

Pnx

  • Bay Watcher
    • View Profile
Re: Mathematics Help Thread
« Reply #1324 on: October 28, 2013, 08:37:30 pm »

Ok, so I have the curve y3=2x3 and I want to find when it's perpendicular to x+2y-2=0
I got as far as figuring out that I want dx/dy to be 2. But I'm blanking on figuring out exactly how to get that.
Logged

ZetaX

  • Bay Watcher
    • View Profile
Re: Mathematics Help Thread
« Reply #1325 on: October 28, 2013, 09:25:18 pm »

Unless you are considering this in either the complex numbers or some algebra-geometric setting, both equations are just lines. Also, you ask for "when", but there is nothing to vary.
Logged

Virex

  • Bay Watcher
  • Subjects interest attracted. Annalyses pending...
    • View Profile
Re: Mathematics Help Thread
« Reply #1326 on: October 29, 2013, 02:57:05 am »

Ok, so I have the curve y3=2x3 and I want to find when it's perpendicular to x+2y-2=0
I got as far as figuring out that I want dx/dy to be 2. But I'm blanking on figuring out exactly how to get that.


If they are perpendicular then dx/dy1 = dx/dy2, so you just equate the derivatives and solve for x.
Logged

da_nang

  • Bay Watcher
  • Argonian Overlord
    • View Profile
Re: Mathematics Help Thread
« Reply #1327 on: October 29, 2013, 04:23:14 am »

Ok, so I have the curve y3=2x3 and I want to find when it's perpendicular to x+2y-2=0
I got as far as figuring out that I want dx/dy to be 2. But I'm blanking on figuring out exactly how to get that.


If they are perpendicular then dx/dy1 = dx/dy2, so you just equate the derivatives and solve for x.
If they're perpendicular, shouldn't it be (dy1/dx) * (dy2/dx) = -1 ? (With the exception of y'1 = 0 and y'2 = ±∞)
Of course, curves would only be perpendicular if they also intersect at that point, otherwise it's just perpendicular tangents.
« Last Edit: October 29, 2013, 04:29:02 am by da_nang »
Logged
"Deliver yesterday, code today, think tomorrow."
Ceterum censeo Unionem Europaeam esse delendam.
Future supplanter of humanity.

lemon10

  • Bay Watcher
  • Citrus Master
    • View Profile
Re: Mathematics Help Thread
« Reply #1328 on: October 29, 2013, 04:25:31 am »

Here's an easier reasoning to get a perfectly accurate result:
You get exactly the same score if you assign points like this: One point for each letter, plus one point for each pair of touching A's and B's. So what we want to do is maximize the number of heterosymbolic relationships. The problem is that we have lots of "love triangles" of the form
Code: [Select]
XY
Z
which guarantee that there is at least one homosymbolic relationship inside. There are also "love quadrangles"  of the form
Code: [Select]
XY
ZW
which have at least two homosymbolic relationships inside. Our goal is to find an upper bound on the number of possible heterosymbolic relationships, and we can do this by finding a lower bound on the number of homosymbolic relationships. To do this, we'll have a look at this image:

Here I've placed some love triangles and quadrangles onto the board (in this case 4x4), and I've called them "special". Every special love n-drangle is disjoint from all others, which means that any homosymbolic relationship can only be part of at most one special n-drangle. This means that there are at least one HR per special triangle and two HRs per special quadrangle, and since there are (X-1)(X-2) special triangles and (X-1) special quadrangles, we find that we have at least X(X-1) homosymbolic relationships, regardless of our distribution of As and Bs.
Now since there are exactly (X-1)(4X-2) total relationships, we find that at most (X-1)(3X-2) relationships may be heterosymbolic at any time, so the total score of a character distribution is at most (X-1)(3X-2) + X².
That whole thing reads hillariously. In my tired state it seems to be to be almost complete techno-babble and bizzare TV math. I trust that it isn't, but damn if it doesn't sound that way.
Logged
And with a mighty leap, the evil Conservative flies through the window, escaping our heroes once again!
Because the solution to not being able to control your dakka is MOAR DAKKA.

That's it. We've finally crossed over and become the nation of Da Orky Boyz.

Pnx

  • Bay Watcher
    • View Profile
Re: Mathematics Help Thread
« Reply #1329 on: October 29, 2013, 08:33:34 pm »

Unless you are considering this in either the complex numbers or some algebra-geometric setting, both equations are just lines. Also, you ask for "when", but there is nothing to vary.
I would have responded last night, but my internet chose the moment when I tried to post a reply to crap out, and it's only just come back.

It's sort of a moot point to ask for help with it now on account of no longer being able to get credit for solving it, but I should probably clear one or two things up.

What I meant was when the tangent line of  y3=2x3 is perpendicular to x+2y-2=0.

I know I can rewrite x+2y-2=0 to be y=(-1/2)x+1, and that that means that any tangent with a slope of 2 is perpendicular to that line. But apart from that I'm not really sure how to go about finding the right points off of the derivative of y3=2x3.
Logged

ZetaX

  • Bay Watcher
    • View Profile
Re: Mathematics Help Thread
« Reply #1330 on: October 29, 2013, 09:11:16 pm »

Take third roots (which are unique in reals) on both sides to see that you just have y = 2^(1/3) x, thus this is also a line (with the wrong slope).
Logged

Pnx

  • Bay Watcher
    • View Profile
Re: Mathematics Help Thread
« Reply #1331 on: October 29, 2013, 10:03:47 pm »

Hmm you're right... I think I transcribed it wrong, though I'm not feeling up to tracking down the original problem and doing it again.
Logged

Tsuchigumo550

  • Bay Watcher
  • Mad Artificer
    • View Profile
Re: Mathematics Help Thread
« Reply #1332 on: November 03, 2013, 05:14:59 pm »

Oh god i'm in way above my head with this one. I need to form it back into a standard equation, but my attempts resulted in gigantic numbers that didn't match my original equation.

-0000000000003322(x-45)(x-55)(2x-160)(x-190)((x^(4/3))-200)(x-250)


The one area with all the parenthesis reads "x to the power of four thirds minus 200."

I need this, like, un-factored. The problem is how fuck-off huge the numbers get and how quickly they do so, and that one fractional power. This is one of those "rollercoaster" projects.
Logged
There are words that make the booze plant possible. Just not those words.
Alright you two. Attempt to murder each other. Last one standing gets to participate in the next test.
DIRK: Pelvic thrusts will be my exclamation points.

Helgoland

  • Bay Watcher
  • No man is an island.
    • View Profile
Re: Mathematics Help Thread
« Reply #1333 on: November 03, 2013, 05:23:08 pm »

Just replace the numerical constants with, y'know, constants - a, b, c and so forth. Then you can punch the final expressions into a calculator, and that tiny number in the beginning (I'll assume you forgot a point) will cancel out the hugeness.
Logged
The Bay12 postcard club
Arguably he's already a progressive, just one in the style of an enlightened Kaiser.
I'm going to do the smart thing here and disengage. This isn't a hill I paticularly care to die on.

da_nang

  • Bay Watcher
  • Argonian Overlord
    • View Profile
Re: Mathematics Help Thread
« Reply #1334 on: November 03, 2013, 05:28:48 pm »

NEVERMIND
Logged
"Deliver yesterday, code today, think tomorrow."
Ceterum censeo Unionem Europaeam esse delendam.
Future supplanter of humanity.
Pages: 1 ... 87 88 [89] 90 91 ... 173