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

You are not logged in.

#1 Re: Help Me ! » [ASK] Are the Frequency and the Score Switched? » 2016-10-24 22:04:22


I agree with thickhead's reasoning and that the frequency and score should be switched for the problem to make sense.

If those two are switched, then the solution is one of those in the multiple-choice list.

Monox D. I-Fly has made an arithmetical error that accounts for his answer not appearing in the list.

#2 Re: Help Me ! » Permutation slot generator » 2016-10-21 02:15:17

I couldn't have destroyed that dream had not that word already been coined. You were bound to find out sooner or later...I'm just sorry it was through me!

In what sense?

In a totally tongue-in-cheek sense, zombies being fictional. As with 'photoshopped', you were bound to find out sooner or later; and so, if I've shattered another dream, I'm sorry it was through me...again!

Off to bed. I'll probably dream about zombies.

#3 Re: Help Me ! » Permutation slot generator » 2016-10-21 01:07:52

Very prudent, much more so than I am.

photoshopped: transitive, Internet To digitally edit or alter a picture or photograph.

#4 Re: Help Me ! » Permutation slot generator » 2016-10-21 00:44:16

Hi Bobby;

Getting in the mood early for Halloween?

Changing the subject...that picture of you in post #28 must have been taken quite some time before your avatar photo!!

The resemblance is still there, though - the distinctive, flared-out ears, the prominent mouth, the piercing gaze, the calm, unruffled look...

But that magnificent Rapunzel ponytail's gone, and the hat would be much more useful now than it was back then!

#5 Re: Help Me ! » Permutation slot generator » 2016-10-20 11:56:33

A happy (happier, even) slug, I hope.

I have to go...catch you later.

#6 Re: Help Me ! » Permutation slot generator » 2016-10-20 11:24:24

The early 90's...I remember them well! I couldn't even spell ASM back then! But that wasn't a requirement of ASM, was it? Unless you documented your code with rems to make sense of the blur!!

#7 Re: Help Me ! » Permutation slot generator » 2016-10-20 11:15:17

Well, I don't have your intimate knowledge of your machine.

#9 Re: Help Me ! » Permutation slot generator » 2016-10-20 11:10:11

That's using JM's, I guess. Have you tried it on George's yet?

#10 Re: Help Me ! » Permutation slot generator » 2016-10-20 10:57:15

Hmmm...that's odd! OneDrive has always worked for me before.

Try these links. They're on Filedropper, which I've never used before. It works when I tested it, but you have to complete a captcha for each file...which I didn't know before I uploaded them. sad 


What file host do you use for file sharing on forums?

#11 Re: Help Me ! » Permutation slot generator » 2016-10-20 00:38:46

Here is a link to the number, and here is a link to the solution.

Both in copyable text...and there's also an option to download the text file.

Btw, in JM's code the number variable is n, and in George's it's m.

Rest well! I may have gone to bed when you return. >yawn<

#12 Re: Help Me ! » Permutation slot generator » 2016-10-20 00:04:19

It's the same idea as my post #19, where I included it in the first line of your code that I changed.

This time I made it a bit bigger...and I'm not sure if I should try it on your code!

#13 Re: Help Me ! » Permutation slot generator » 2016-10-19 23:55:03

With n = RandomInteger[10^100000] in the first line of code.

Do you want to see it, and the solution?

#14 Re: Help Me ! » Permutation slot generator » 2016-10-19 23:36:14

Maybe you're a rough diamond?

J.M. is a very talented guy and a good EM too.

His code backs that up!. up

I tried his and George's codes on a random 100,000-digit number that has a solution. JM's took approx 14.3 seconds to solve it, and George's approx 767 seconds. So their speed comparison has changed dramatically with this much larger number!

#15 Re: Help Me ! » Permutation slot generator » 2016-10-19 10:09:56

Hi Bobby;

If he's checking his pulse to see if it's still ticking, something else isn't ticking as it should!

So, mine took 3 hours+ and his took .02 seconds....

George's time was 5 times that of JM's.

I ran yours again overnight on the same number, and solving time was just over 6 hours. Just to put the 'just' part into perspective when compared to JM's time, just that part alone (ie, without the 6 hours part) is just over 5732.31012092 times the speed of JM's. So now you know how many seconds yours took - within a smidgen.

I give JM's comment - "A ploddingly procedural implementation" - a like. smile

What is 'the diamond effect'?

#16 Re: Help Me ! » Permutation slot generator » 2016-10-19 01:03:54

Hi Bobby;

'Obsolete'?? I take it the meaning is in the teenage-speak word-inversion sense.

As wicked = good/great, and sick = cool/awesome, so obsolete = now/happening/up-to-the-minute. eg, someone referred to as being 'obsolete' is really a now (as in right now)/up-to-date person, with his finger right on the pulse. And no, he's not checking his pulse to see if it's still ticking!

Just to confirm that it's not the number size that's the problem with your code, I gave it this 1000-digit number to solve:

I don't know how long it took because I forgot to include the timer in the code, but it started looking for the answer late this afternoon, was still busy at it 3 hours or so later when I had to go out, but when I got home 2-and-a-half hours later it was waiting for me with the answer:

JM found the same solution as yours in 0.004 seconds, and George found it in 0.020 seconds.

George's check says "True" in each case, but I haven't checked it myself. I'm happy to accept George's code's say-so! smile

#17 Re: Help Me ! » Permutation slot generator » 2016-10-18 11:29:35

That's what it also does with the two numbers I mentioned in post #15 (12398 and 123476). Those two don't have a solution, but the 50-digit one does.

#18 Re: Help Me ! » Permutation slot generator » 2016-10-18 09:57:09

I don't know what the number was, as I used RandomInteger[10^50] to generate it and didn't save it.

This is my changed version of your code that I used. It includes George's check.

f=Sum[1/9 (-1+10^k) Subscript[a,k],{k,1,n}]==m;

I think you'll find most numbers will work: eg, 69586679352243945460884074620809492862023430738549. That works in JM's & George's too, and comes up as "True" in George's check.

38994141682523903136734583674252327906171348631335 has a solution, but your code complains. Try it! smile

#19 Re: Help Me ! » Permutation slot generator » 2016-10-18 02:08:08

Hi Bobby;

He must have edited it later on and left out a bracket.

He had one bracket too many.

In the end I had to accept J.M.'s code because it was the fastest.

Theirs were both instantaneous on a 50-digit number.

Mine gags on a large example, theirs do not.

Yours got the right answer on that same 50-digit number (in 0.14 seconds), so it wasn't the length of the input number that was the problem.

#20 Re: Help Me ! » Permutation slot generator » 2016-10-17 12:51:45

Interesting...what I understand of it! dizzy

Anyway, here are some things I've noticed:

1. A correctness check is needed, as george2079 said.
   eg, 12398 and 123476 have no solution, treated this way by the 3 codes:
    - george2079's code gives "the 'closest' value", and, helpfully, his check announces "False";
    - J. M.'s code just gives the 'closest' (I suppose) value - like george2079 - with no correctness announcement;
    - Your code gives strange-looking answers...which probably indicates that they don't have a solution.

2. george2079's code has an error that prevents me from running his program (one of the closing brackets after Divide @@ # has to go), and should be:

m = 308460277;
Reap[NestWhile[{#[[1]] - #[[2]] Sow@Floor[Divide @@ #], 
      Floor[#[[2]]/10]} &, {m, 
     FromDigits@ConstantArray[1, Ceiling@Log[10, m]]} , #[[2]] > 
      0 &]][[2, 1]] // FromDigits

3. george2079's check could be improved by replacing the answer input with "%", like so (his way would have been for clarity's sake, I guess):

Total@NestWhileList[ Floor[#/10] &, %, # > 0 &]==m

4. Your code fails on some valid inputs (answers found by the other two guys' codes): eg, 12333, 12344, 12355, 12366, 12377, 12388, 12399.
    They might be the only fails, but I didn't check right up to infinity. wink

5. A little tweak for your code (which I know you already know! smile )

First line: m = 308460277; n = IntegerLength[m];

I wonder what percentage of numbers fail, and their composition? But I don't really need to know...

#21 Re: Help Me ! » Permutation slot generator » 2016-10-16 16:39:55

Ah, yes...that's the one I missed. up

I'd been looking in the Tuples, Permutations and Subsets general area, but overlooked Outer for some reason, even though it appears as a 'See Also' under Tuples.

#22 Re: Help Me ! » Permutation slot generator » 2016-10-16 11:05:18

Hi Bobby;

I tried to code it in M, but only succeeded with the BASIC approach like in my post #6 (but with slightly shorter code):


Anyway, something new I learned was that uppercase E (in variable ee) is reserved for exponential constant e.

At first I thought I'd have to change the letter, but then discovered that although M's output prints E as e, when the output is copied as plain text and pasted here (and in other software), e prints as E.

#23 Re: Help Me ! » Permutation slot generator » 2016-10-14 00:48:18

Hi thickhead;

Yes, that's how I did it too, but without the plus sign in column E (not needed).

#24 Re: Help Me ! » Permutation slot generator » 2016-10-13 20:07:19

Hi thickhead;

Looks like you left out the opening instruction about writing {B,T,Z} into Column C.

Works fine, otherwise.

#25 Re: Help Me ! » Permutation slot generator » 2016-10-13 18:43:40

Hi Edossa;

Here's a program in BASIC that generates all possible answers...which are the same as those already posted.

The code is in LibertyBASIC, and can be run online here. Click on the 'Write Your Own' tab if the editor page doesn't open.

For a=1 To 4
    For f=1 To 2
        For b=1 To 3
            For e=1 To 4
                Print Mid$(a$,a,1);Mid$(f$,f,1);Mid$(b$,b,1);Mid$(e$,e,1)
            Next e
        Next b
    Next f
Next a

Board footer

Powered by FluxBB