Math BBC Radio Four Today Prog, puzzle of the day.

Notebook

Addon Developer
Addon Developer
News Reporter
Donator
Joined
Nov 20, 2007
Messages
11,816
Reaction score
641
Points
188
UK BBC Radio 4 Today programme is a news/current affairs programme that's been going donkeys years. Starts 06:00 for three hours, later on a Saturday.
Bit of an institution.

For some reason they have started a "puzzle of the day":
http://www.bbc.co.uk/programmes/articles/5wkxjTtqRvq8Cyrrjxtk7tc/puzzle-for-today

If I was paranoid, I'd think it was a recruiting drive for GCHQ, but I know folk here like a challenge.

May be co-incidence, but "book at bed-time" is Fahrenheit 451.

N.
 
Last edited:

asbjos

tuanibrO
Addon Developer
Joined
Jun 22, 2011
Messages
696
Reaction score
259
Points
78
Location
This place called "home".
A nice little challenge! I solved it in MATLAB with a small script, which found the 11 different solutions to the problem in 12 seconds on a laptop from 2012.

I won't post the solutions here, because I don't want to ruin the fun for you, but I can say that there are four solutions starting with '1+', two with '12+', one with '12-', two with '123+' and the last two with '123-'. The solution with the lowest number of signs contains two minus signs and one plus sign.
 

Notebook

Addon Developer
Addon Developer
News Reporter
Donator
Joined
Nov 20, 2007
Messages
11,816
Reaction score
641
Points
188
Excellent.

Bit of a wordy one this morning. Too much like hard work for me, but I'm sure lots of people will lap it up.

Any chance you could post your script please?

N.
 

dgatsoulis

ele2png user
Donator
Joined
Dec 2, 2009
Messages
1,927
Reaction score
340
Points
98
Location
Sparta
No plus or minus signs at all?

[math]1^{23456789}=10^0[/math]
:p
 

asbjos

tuanibrO
Addon Developer
Joined
Jun 22, 2011
Messages
696
Reaction score
259
Points
78
Location
This place called "home".
I know nested for-loops are not the most beautiful thing in the world, but at least it works.

PHP:
% Solution on problem on BBC (http://www.bbc.co.uk/programmes/articles/5wkxjTtqRvq8Cyrrjxtk7tc/puzzle-for-today)

filename = sprintf ('BBCsolutions.txt');
filID = fopen(filename, 'w');
tic

for a = 1 : 3
    for b = 1 : 3
        for c = 1 : 3
            for d = 1 : 3
                for e = 1 : 3
                    for f = 1 : 3
                        for g = 1 : 3
                            for h = 1 : 3
                                str1 = signChoice(a, 1);
                                str2 = signChoice(b, 2);
                                str3 = signChoice(c, 3);
                                str4 = signChoice(d, 4);
                                str5 = signChoice(e, 5);
                                str6 = signChoice(f, 6);
                                str7 = signChoice(g, 7);
                                str8 = signChoice(h, 8);
                                
                                str = strcat(str1, str2, str3, str4, str5, str6, str7, str8, '9');
                                
                                if str2num(str) == 100
                                    fprintf(filID,'%s%s%s%s%s%s%s%s9\n', str1, str2, str3, str4, str5, str6, str7, str8);
                                end
                            end
                        end
                    end
                end
            end
        end
    end
end

fprintf (filID, '\nDONE\n');
fprintf (filID, 'Time: %f s\n', toc);
fclose (filID);

And here the signChoice function:
PHP:
function str = signChoice (a, n)
    if a == 1
        sgn = '+';
    elseif a == 2
        sgn = '-';
    else
        sgn = '';
    end
    
    str = strcat(num2str(n), sgn);
end
 

kuddel

Donator
Donator
Joined
Apr 1, 2008
Messages
2,064
Reaction score
507
Points
113
A similar problem was presented at numberphile
 
Top