Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 47 48 [49] 50 51 ... 173

Author Topic: Mathematics Help Thread  (Read 227216 times)

Christes

  • Bay Watcher
    • View Profile
Re: Mathematics Help Thread
« Reply #720 on: June 02, 2011, 03:01:05 pm »

Well, I'm just happy I remembered some linear algebra since, you know,  I suck at it generally.
Logged

Miggy

  • Bay Watcher
    • View Profile
Re: Mathematics Help Thread
« Reply #721 on: June 02, 2011, 03:36:54 pm »

...
I guess if a real matrix has exclusively complex eigenvectors, the proof falls apart. But then comes the question: Is that actually possible? I'm positively sure I remember something like that being impossible, but looking through my literature again I can't find out where it's mentioned.
...
I think that this question is easy to answer by demonstration
0 1
-1 0
it's eigenvalues are i and -i and eigenvectors are (-i,1) and (i,1).

Thanks a bunch! That helped.

This thread made me happy today.

Well, I'm just happy I remembered some linear algebra since, you know,  I suck at it generally.

I'm happy that I got my question answered and got a bit smarter. :D Oh, and I understood Putzer's algorithm today which means another evil vanquished. More or less got all of the nasty stuff out of the way so now I just need to memorise all of the little stuff so I don't botch up on some silly misspeak. Exams should be all-right!
Logged

Vector

  • Bay Watcher
    • View Profile
Re: Mathematics Help Thread
« Reply #722 on: June 02, 2011, 11:24:25 pm »

Well, I'm just happy I remembered some linear algebra since, you know,  I suck at it generally.

Haha, yeah.  Me too.  Worst grade I have ever gotten in anything: Honors Linear Algebra class.


On the original subject, though, I think you should check around in your book.  IIRC there's a weaker version of Schur's, unnamed, which linear algebra texts classically prove first.  I'm almost certain of it.
Logged
"The question of the usefulness of poetry arises only in periods of its decline, while in periods of its flowering, no one doubts its total uselessness." - Boris Pasternak

nonbinary/genderfluid/genderqueer renegade mathematician and mafia subforum limpet. please avoid quoting me.

pronouns: prefer neutral ones, others are fine. height: 5'3".

Christes

  • Bay Watcher
    • View Profile
Re: Mathematics Help Thread
« Reply #723 on: June 05, 2011, 12:39:10 am »

Anyone here know anything about GAP?  I need a simple command to test if an integer is a perfect square.  Currently I'm checking it with:

Code: [Select]
IsInt(Tau(n)/2)=false
Which is way inefficient (though cool in a theoretical way :) ).  There's probably a simple command I'm missing.
Logged

Another

  • Bay Watcher
    • View Profile
Re: Mathematics Help Thread
« Reply #724 on: June 05, 2011, 03:01:10 am »

((Int(Sqrt(n)))^2-n)!=0 should be reasonably efficient. I am not familiar with GAP syntax though.

If you really want to optimize - you could probably perform a few hand-made tests for divisibilities into smallest primes and their powers to quickly weed out ~99% of cases before performing Sqrt() or any other non-linear function.
Logged

Grek

  • Bay Watcher
    • View Profile
Re: Mathematics Help Thread
« Reply #725 on: June 05, 2011, 10:27:40 am »

Probably a reasonably simple question, but one that I don't have the calculus for none the less:

What is the volume of the space between the plane defined by y=0, the plane defined by y=1 and the curve y=kx(1-x2)=kz(1-z2), where kx and kz are both constants, and x, y and z are variables?

It's for a probability problem that I'd rather not get into if it's not relevant to the caluculation of the volume.
Logged

Another

  • Bay Watcher
    • View Profile
Re: Mathematics Help Thread
« Reply #726 on: June 05, 2011, 12:11:11 pm »

What is the volume of the space between the plane defined by y=0, the plane defined by y=1 and the curve y=kx(1-x2)=kz(1-z2), where kx and kz are both constants, and x, y and z are variables?
I presume that you mean the volume of a figure made by rotating said curve around the Y axis, right? Or was it a typo, meaning the surface y=kx(1-x2)+kz(1-z2)?

In the first case x=(1-y/kx)^0.5,z=(1-y/kz)^0.5, V=Int[0;1](pi*(x^2+z^2)) dy = pi*(2-1/2(1/kx+1/kz)).

In the second case V=Int[S1](1-kx*(1-x^2)-kz(1-z)^2) dx dz + Int[S2](1-0) dx dz where S1 is where 0<kx(1-x2)+kz(1-z2)<1 and S2 is all (x,z) points inside S1 where kx(1-x2)+kz(1-z2)<0. For 0<kx+kz<1 V=pi/(kx*kz)^0.5*((kx+kz)^2/2-(kx+kz)+0.5). It is also a part of a paraboloid, stretched along Z by (kx/kz)^0.5.
Logged

Christes

  • Bay Watcher
    • View Profile
Re: Mathematics Help Thread
« Reply #727 on: June 05, 2011, 09:31:44 pm »

((Int(Sqrt(n)))^2-n)!=0 should be reasonably efficient. I am not familiar with GAP syntax though.

If you really want to optimize - you could probably perform a few hand-made tests for divisibilities into smallest primes and their powers to quickly weed out ~99% of cases before performing Sqrt() or any other non-linear function.

I actually didn't check back here.  My code was efficient enough to do what it needed to do, but that should work.  Of course, GAP doesn't have a sqrt command, but it does have RootInt, which returns the floor function of the square root, so it would have to look like:

Code: [Select]
RootInt(n)^2=n
Where RootInt returns the floor function of the square root.
Logged

Bauglir

  • Bay Watcher
  • Let us make Good
    • View Profile
Re: Mathematics Help Thread
« Reply #728 on: June 20, 2011, 10:46:05 pm »

This D&D problem is eating my brain. Okay, so, there are abilities that let you reroll dice. My first question was, "Given that I can roll 2 twenty sided dice (or 2d20, in the common notation), what are the chances of any particular result?" Well, after way too much time, I solved that one (it turns out a general formula for 2 dice is P=(2n-1)/x^2 where P is the probability of rolling n on an x-sided die). But then I started wondering about the even more general case of arbitrarily many dice. I worked out P=(3n^2-3n+1)/x^3 for that, and while I have a functional algorithm for adding additional dice, it gets ever more annoying to apply with each die. So, can anyone help me work out the general case?

The algorithm treats the rolls as a series of sequential rolls, since this should be indistinguishable from rolling them all simultaneously (since it is assumed you cannot decide to stop rolling until the sequence completes). The above formulae are simplified versions of the results from below, which may be more informative. When I say "term" below, I'm referring to a number (obtained by multiplying other numbers) added to another term; I am pretty sure I probably deviate from the real definition of the word.


EDIT: Added a crucial step 4 to the algorithm that I forgot about because it's easy.
« Last Edit: June 20, 2011, 11:03:31 pm by Bauglir »
Logged
In the days when Sussman was a novice, Minsky once came to him as he sat hacking at the PDP-6.
“What are you doing?”, asked Minsky. “I am training a randomly wired neural net to play Tic-Tac-Toe” Sussman replied. “Why is the net wired randomly?”, asked Minsky. “I do not want it to have any preconceptions of how to play”, Sussman said.
Minsky then shut his eyes. “Why do you close your eyes?”, Sussman asked his teacher.
“So that the room will be empty.”
At that moment, Sussman was enlightened.

Christes

  • Bay Watcher
    • View Profile
Re: Mathematics Help Thread
« Reply #729 on: June 21, 2011, 12:21:08 am »

I'm a little unclear on some of the words you're using.  What does each "term" represent?  The rolls of dice?  Or probabilities?

You're multiplying them, but also listing them in sequence and that is confusing me.

An example would be helpful - say the probability of rolling a 9 on a 3d6.
Logged

ed boy

  • Bay Watcher
    • View Profile
Re: Mathematics Help Thread
« Reply #730 on: June 21, 2011, 04:43:31 am »

First, I'd like to say that your current algorithms are wrong (or I have misunderstood them). Your two-dice version should be following a Triangular distribution.

I've had a stab at it:
Spoiler: maths (click to show/hide)
Logged

Bauglir

  • Bay Watcher
  • Let us make Good
    • View Profile
Re: Mathematics Help Thread
« Reply #731 on: June 21, 2011, 08:31:26 am »

Well, to clarify, it looks something like this (using my earlier variables):

1/x
(1/x)(n/x)+(1/x)((n-1)/x)
(1/x)(n/x)(n/x)+(1/x)(n/x)((n-1)/x)+(1/x)((n-1)/x)((n-1)/x)

Simplifying these yields the short formulae above (I've checked the second by writing a dice roller program to roll 2d20 a million times and choose the best of each pair, but I haven't had time to write the third yet). I was referring to each of the number summed as a "term", which like I said, is probably wrong.

So, that example asked for can't happen; on 3d6, the highest individual die result is a 6. But if you wanted the probability of that, it's (1/6)(6/6)(6/6)+(1/6)(6/6)(5/6)+(1/6)(5/6)(5/6), or about 42% (if I did it right, which if ed boy is correct, I may well not have).

Huh, looking above, I obviously forgot to state in the quotation "... and choose the best". Derp.

@ed boy
I followed your explanation until the multinomial distribution link. Unfortunately, wikipedia's math articles are denser than I can parse. Any chance at an explanation of that?
Logged
In the days when Sussman was a novice, Minsky once came to him as he sat hacking at the PDP-6.
“What are you doing?”, asked Minsky. “I am training a randomly wired neural net to play Tic-Tac-Toe” Sussman replied. “Why is the net wired randomly?”, asked Minsky. “I do not want it to have any preconceptions of how to play”, Sussman said.
Minsky then shut his eyes. “Why do you close your eyes?”, Sussman asked his teacher.
“So that the room will be empty.”
At that moment, Sussman was enlightened.

Another

  • Bay Watcher
    • View Profile
Re: Mathematics Help Thread
« Reply #732 on: June 21, 2011, 11:22:41 am »

I was quite puzzled at your formulas before the "... and choose the best" words. 2d20 is commonly well defined as the sum.

Probability of getting N in k rolls of 1dN is PN=1-(1-p)k, where p=1/N. Probability that N-1 will be the maximum is PN-1=1-(1-2*p)k-PN. Iterative formula is Pl=1-(1-(N-l+1)*p)k-Pl+1-Pl+2-...-PN.
 
From the other side P1=pk and you can construct an "ascending" iterative formula Pl=(l*p)k-Pl-1-Pl-2-...-P1.

I would probably check this for a few arbitrary N, k and l versus a brute-force "roll a virtual die a few million times" data first if I were to apply it anywhere. I remember finding all probabilities of (4d6 - minimum) some years ago and plotting a nice graph of that.
Logged

ILikePie

  • Bay Watcher
  • Call me Ron
    • View Profile
Re: Mathematics Help Thread
« Reply #733 on: June 22, 2011, 02:28:01 am »

1/mx = 4m/(x + 4m - 2)

How do I solve for x?
Logged

Darvi

  • Bay Watcher
  • <Cript> Darvi is my wifi.
    • View Profile
Re: Mathematics Help Thread
« Reply #734 on: June 22, 2011, 02:32:51 am »

Scrap that. Can't think straight.

It's a simple second degree equation with a parametre though. Easy enough.
« Last Edit: June 22, 2011, 02:35:32 am by Darvi »
Logged
Pages: 1 ... 47 48 [49] 50 51 ... 173