Math Is Fun Forum

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

You are not logged in.

#1 2012-05-03 06:51:45

juantheron
Member
Registered: 2011-10-19
Posts: 312

sum of digit

The sum of all the no. that can be formed using the digit

without repetition is

Offline

#2 2012-05-04 01:19:30

gAr
Member
Registered: 2011-01-09
Posts: 3,482

Re: sum of digit

Hi juantheron,

Did you mean


is a number, and we need to find the sum of all the permutations possible?


"Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense"  - Buddha?

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

#3 2012-05-04 01:21:28

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

Re: sum of digit

Hi gAr

It seems so. Is there a way to compute it with a GF?


“Here lies the reader who will never open this book. He is forever dead.
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

#4 2012-05-04 02:06:51

gAr
Member
Registered: 2011-01-09
Posts: 3,482

Re: sum of digit

Hi anonimnystefy,

Why g.f for this?


"Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense"  - Buddha?

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

#5 2012-05-04 02:11:18

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

Re: sum of digit

Hi gAr

I was just wondering,that's all.

Why do you multiply by (n-1)! ?


“Here lies the reader who will never open this book. He is forever dead.
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

#6 2012-05-04 02:19:41

gAr
Member
Registered: 2011-01-09
Posts: 3,482

Re: sum of digit

Start from small examples, you'll understand!


"Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense"  - Buddha?

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

#7 2012-05-04 03:28:10

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

Re: sum of digit

Oh,ok.I got it now! Thanks for the solution and the clarification.Let's see if the OP will need explanation.


“Here lies the reader who will never open this book. He is forever dead.
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

#8 2012-05-04 04:02:39

gAr
Member
Registered: 2011-01-09
Posts: 3,482

Re: sum of digit

Glad that you got it.
Yes, we'll wait and see if that was the actual question.


"Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense"  - Buddha?

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

#9 2012-05-04 04:15:08

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

Re: sum of digit

I am too.

Asking again,do you think there is a GF solution?


“Here lies the reader who will never open this book. He is forever dead.
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

#10 2012-05-04 06:30:45

juantheron
Member
Registered: 2011-10-19
Posts: 312

Re: sum of digit

Thanks friends but would you like to explain it to me

Offline

#11 2012-05-04 06:36:12

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

Re: sum of digit

I'll leave this one for gAr to explain,because I don't how good I can explain it.


“Here lies the reader who will never open this book. He is forever dead.
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

#12 2012-05-05 03:22:25

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,877

Re: sum of digit

Hi all,

Well, I have no idea what GF is or what gAr did, but I wanted to see if I could get anywhere with this puzzle.

Firstly, I understand the problem to be this (paraphrased): Find the sum of all numbers with unique digits formed from the digits 0 to 9. I hope I'm right, otherwise LibertyBASIC worked all night for nothing.

The LibertyBASIC program I wrote is pretty raw, but it enabled me to spot a pattern. Then I transferred the idea to Excel and some sort of formula started to emerge. So I simplified it a bit more, put it back into LB (because of Excel's number length limitations) and got 19,829,418,676,096,455 as my final answer.

Last edited by phrontister (2012-05-05 20:59:08)


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

#13 2012-05-05 03:41:46

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

Re: sum of digit

GF-Generating Function

Did you check your answer against gAr's formula?


“Here lies the reader who will never open this book. He is forever dead.
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

#14 2012-05-05 04:03:33

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,877

Re: sum of digit

I'm sorry, stefy, but my maths standard is only 4th-year high school and I don't understand gAr's formula, nor Generating Functions.

I think my answer may be close because of how I wrote my BASIC program, but I'm not sure. And it depends too on whether or not I've understood the problem correctly.


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

#15 2012-05-05 04:04:57

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

Re: sum of digit

Which part of gAr's formula don't you understand?


“Here lies the reader who will never open this book. He is forever dead.
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

#16 2012-05-05 04:17:33

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,877

Re: sum of digit

Everything in the second set of brackets.

I don't know what this does:

Nor this:

I've seen that funny symbol in other posts but I've never tried to work out what it means.


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

#17 2012-05-05 04:20:13

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,877

Re: sum of digit

Just looked at my watch...it's way past midnight! I'd better go to bed!

Catch you later.


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

#18 2012-05-05 05:20:09

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: sum of digit

Hi phrontister;

That is great way to try to come up with a formula. Experimental mathematics! But you might have made an error somewhere, for 10 I am getting, 22175999997782400.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#19 2012-05-05 14:18:17

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,877

Re: sum of digit

Hi Bobby,

Yes, you're probably right. I was never happy with my result for 10. You'll see what I mean from my answer:


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

#20 2012-05-05 14:25:28

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: sum of digit

The answer may not agree but it sure is neat work.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#21 2012-05-05 14:35:44

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,877

Re: sum of digit

Which of my answers are correct (if any)?

The answers to numbers 1 to 8 are the same in both my original LB program and the simplified formula.

I haven't run 9 & 10 in the original program because of the time factor...they take HOURS (I said that program was raw!)

Last edited by phrontister (2012-05-05 14:46:07)


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

#22 2012-05-05 14:45:27

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: sum of digit

How did you get that for one?


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#23 2012-05-05 14:49:22

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,877

Re: sum of digit

These are my LB programs for 1-, 2- and 3-digit numbers:   



All the rest follow that strategy.

Here's the printout for 3:

Of course, I don't print that out during the normal calcs routine, as that would slow the process down to less than a crawl!

The program weeds out numbers with non-unique digits and sums the valid ones.

Sorry, but I have to go out now for a few hours. wave

Last edited by phrontister (2012-05-05 15:14:50)


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

#24 2012-05-05 15:15:38

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: sum of digit

Hi phrontister;

Looks like you and they are solving two different problems that is why the different answers. For instance if you have one number say 1. Its only permutation is 1 so the sum of the permutations is 1.

1 = 1

For two digit number say 12 then there are 2 permutations 12 and 21,

12 + 21 = 33

For three digit number say 123 we have 6 permutations 123, 132, 213,231, 312, 321,

123 +132 + 213 + 231 + 312 + 321 = 1332

That is how gAr is interpreting the problem.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#25 2012-05-05 22:37:03

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,877

Re: sum of digit

Hi Bobby,

Doesn't gAr's first post mean that he's summing all permutations of a number containing only unique digits, that is n digits long? Is that what the effect of his absence of commas is? juantheron's contains no commas?

I guess gAr's formula makes it clear what he's doing, but like I said to stefy, I don't understand his formula...which is my fault, not his.

I'm summing all permutations of unique-digit numbers of any length, but maybe I'm wrong about the number length. I went that way because of juantheron's commas, but I may have misread the intent.

Are numbers with a leading zero ignored? I ignored them.

Also, I'm not sure why the problem says "without repetition". Don't the differently-notated digits indicate their uniqueness anyway? So is that just tautology, or does it add a different meaning?

Last edited by phrontister (2012-05-05 23:05:17)


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

Board footer

Powered by FluxBB