Math Is Fun Forum
  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

Login

Username

Password

Not registered yet?

#126 2012-05-01 05:58:36

anonimnystefy
Real Member

Offline

Re: Generating Functions

I did use my function:

Input:

Code:

list : [6,6,6,6]$
expand(CombOGF(list)/6^4);

Output:

Code:

x^24/1296+x^23/324+(5*x^22)/648+(5*x^21)/324+(35*x^20)/1296+(7*x^19)/162+(7*x^18)/108+(29*x^17)/324+(149*x^16)/1296+(5*x^15)/36+(103*x^14)/648+(14*x^13)/81+(77*x^12)/432+(14*x^11)/81+
(103*x^10)/648+(5*x^9)/36+(149*x^8)/1296+(29*x^7)/324+(7*x^6)/108+(7*x^5)/162+(35*x^4)/1296+(5*x^3)/324+(5*x^2)/648+x/324+1/1296

And the term with exponent 20 has the coefficient of 35/1296.

Last edited by anonimnystefy (2012-05-01 06:00:36)


The limit operator is just an excuse for doing something you know you can't.
“It's the subject that nobody knows anything about that we can all talk about!” ― Richard Feynman
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
 

#127 2012-05-01 06:05:40

bobbym
Administrator

Online

Re: Generating Functions

Now supposing 2 die had faces of 2,4,6,8,10,12 and 2 other die had faces of 1,3,5,7,9,11.
All four die are thrown once. What is the probability of them summing to 20 or more?


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.
 

#128 2012-05-01 06:15:03

anonimnystefy
Real Member

Offline

Re: Generating Functions

493/648?


The limit operator is just an excuse for doing something you know you can't.
“It's the subject that nobody knows anything about that we can all talk about!” ― Richard Feynman
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
 

#129 2012-05-01 06:19:42

bobbym
Administrator

Online

Re: Generating Functions

That is not correct.


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.
 

#130 2012-05-01 06:31:03

anonimnystefy
Real Member

Offline

Re: Generating Functions

Thought so. hmm


The limit operator is just an excuse for doing something you know you can't.
“It's the subject that nobody knows anything about that we can all talk about!” ― Richard Feynman
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
 

#131 2012-05-01 06:32:33

bobbym
Administrator

Online

Re: Generating Functions

What did you have a problem with?


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.
 

#132 2012-05-01 07:01:19

anonimnystefy
Real Member

Offline

Re: Generating Functions

Altering the code to acompany the numbers on the dice.


The limit operator is just an excuse for doing something you know you can't.
“It's the subject that nobody knows anything about that we can all talk about!” ― Richard Feynman
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
 

#133 2012-05-01 07:04:08

bobbym
Administrator

Online

Re: Generating Functions

There is a rather succinct method to do that in mathematics. It is called
summation notation. It is perfect. It is implemented in Maxima. That is why I suggested you use
math commands to do math tasks.


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.
 

#134 2012-05-01 07:07:46

anonimnystefy
Real Member

Offline

Re: Generating Functions

I did use the summation un a part of my code.


The limit operator is just an excuse for doing something you know you can't.
“It's the subject that nobody knows anything about that we can all talk about!” ― Richard Feynman
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
 

#135 2012-05-01 07:10:42

bobbym
Administrator

Online

Re: Generating Functions

But you did not use parameters with the summation. Then the code is simple, fast and
complete.


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.
 

#136 2012-05-01 19:43:42

anonimnystefy
Real Member

Offline

Re: Generating Functions

Iwill try today you function. But I do not like that I have to type everything agin to make a GF for more dice.Here for 100 dice,I could just make code (agin to your disliking) to make me a list of 100 omes. I just put that list into my function and I am done.


The limit operator is just an excuse for doing something you know you can't.
“It's the subject that nobody knows anything about that we can all talk about!” ― Richard Feynman
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
 

#137 2012-05-01 19:48:06

bobbym
Administrator

Online

Re: Generating Functions

You are misunderstanding my reasoning. It is not an arbitrary decision. It is not bobbym's
function.

1) Built in functions are faster and use less memory than procedural code.

2) Your function can not handle gf's that increment by more than one. Remember yours
did not get the right answer.

3) Supposing you were throwing 10 million die? Do you want to create a list of
10 million numbers? My function does not grow in size when the problem does


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.
 

#138 2012-05-01 19:56:18

anonimnystefy
Real Member

Offline

Re: Generating Functions

The first one is right.

The second one is not correct. I made a new one that uses the parameter n for the increment.

Third one is also right.

4)Is yyour function applicable to dice with more sides?


The limit operator is just an excuse for doing something you know you can't.
“It's the subject that nobody knows anything about that we can all talk about!” ― Richard Feynman
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
 

#139 2012-05-01 19:58:44

bobbym
Administrator

Online

Re: Generating Functions

Of course!

About 2) Your new function is probably larger, uses more memory and is slightly slower.
In mine it easy to do things like that with no overhead increase. Bet it took you a couple of hours to
add your addition. In mine additions are part of the notation.


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.
 

#140 2012-05-01 20:19:34

anonimnystefy
Real Member

Offline

Re: Generating Functions

Nope,just one multiplication by n.


The limit operator is just an excuse for doing something you know you can't.
“It's the subject that nobody knows anything about that we can all talk about!” ― Richard Feynman
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
 

#141 2012-05-01 20:35:57

bobbym
Administrator

Online

Re: Generating Functions

But I hope you can see that the one I want you to use is smaller.


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.
 

#142 2012-05-02 06:37:55

anonimnystefy
Real Member

Offline

Re: Generating Functions

Yes,I will try your way.


The limit operator is just an excuse for doing something you know you can't.
“It's the subject that nobody knows anything about that we can all talk about!” ― Richard Feynman
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
 

#143 2012-05-02 17:26:04

bobbym
Administrator

Online

Re: Generating Functions

Is there something done?


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.
 

#144 2012-05-02 20:41:57

anonimnystefy
Real Member

Offline

Re: Generating Functions

Not yet. No access to Maxima yet. hmm


The limit operator is just an excuse for doing something you know you can't.
“It's the subject that nobody knows anything about that we can all talk about!” ― Richard Feynman
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
 

#145 2012-05-03 00:13:43

anonimnystefy
Real Member

Offline

Re: Generating Functions

Hi bobbym

Check out this link:A pdf file on GFs in counting problems

It isn't very much,but does explain some crucial things.


The limit operator is just an excuse for doing something you know you can't.
“It's the subject that nobody knows anything about that we can all talk about!” ― Richard Feynman
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
 

#146 2012-05-03 00:50:30

bobbym
Administrator

Online

Re: Generating Functions

Hi anonimnystefy;

I disagree it is quite good.


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.
 

#147 2012-05-03 00:56:17

anonimnystefy
Real Member

Offline

Re: Generating Functions

Who said it wasn't good. Everything that you need is in there. Maybe a few more solved harder examples and it would be even better.

Hay,I found somewhere a GF for partitions of a number but I disagree with the formula. Could you post the partition GF you think is right?


The limit operator is just an excuse for doing something you know you can't.
“It's the subject that nobody knows anything about that we can all talk about!” ― Richard Feynman
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
 

#148 2012-05-03 01:18:36

bobbym
Administrator

Online

Re: Generating Functions

Depends on what you are partitioning.


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.
 

#149 2012-05-03 01:20:18

anonimnystefy
Real Member

Offline

Re: Generating Functions

Partitions of a number.


The limit operator is just an excuse for doing something you know you can't.
“It's the subject that nobody knows anything about that we can all talk about!” ― Richard Feynman
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
 

#150 2012-05-03 01:21:15

bobbym
Administrator

Online

Re: Generating Functions

Which numbers?


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.
 

Board footer

Powered by FluxBB