Re: Re: Re: Arithmetic Puzzle (so simple it's hard)

*To*: mathgroup at smc.vnet.net*Subject*: [mg71836] Re: [mg71748] Re: [mg71627] Re: Arithmetic Puzzle (so simple it's hard)*From*: Andrzej Kozlowski <akoz at mimuw.edu.pl>*Date*: Thu, 30 Nov 2006 06:05:43 -0500 (EST)*References*: <200611141006.FAA06684@smc.vnet.net><ejtda3$isg$1@smc.vnet.net> <200611251037.FAA15617@smc.vnet.net> <200611281104.GAA27839@smc.vnet.net>

Probably it would be wiser to stay out of this thread, particularly as I have no contribution to make to (and no interest in) the original problem, but since I have already once entered it, there are a few things I feel strongly tempted to add. One is, that I think it is quite misleading for Janos to keep describing his contributions as that of a newbie. I am not referring only the the duration of Janos' membership of this list but in fact to the standard of his contributions. If these are to be regarded as "newbie" programs, what are the real newbies (probably the majority of people who post to the list) to feel about their own? It it could easily make them feel like "neverbies". Secondly, it seems to me that, while it is true that many newbies are at first uncomfortable with functional programming, another typical newbie behaviour (in the next stage of newbeism) is excessive enthusiasm for it. Of course functional programming plays an important role in Mathematica, but it is not the best choice in every situation (for example, I have yet to see an efficient backtracking program written in functional style, that is, without assignments) and is generally far from being the most readable programming style (at least in the infamous form of "one-liners" ). Nor it it true that experienced users generally prefer this style. To those who doubt this doubts this, I suggest searching the archive for posts by Daniel Lichtblau (who, I think, even by Janos's standards does not qualify as a newbie) and count how what percentage contain Do loops and assignments. (They can start with Daniel's contribution to this thread). Next, they should try writing functional programs that perform better and are more efficient than Daniel's procedural ones (of course the programs should be based on the same algorithm). Only those who can do this are, in my opinion, qualified to proclaim the absolute superiority of functional programing in Mathematica. Andrzej Kozlowski Tokyo, Japan On 28 Nov 2006, at 20:04, János wrote: > Croddie, > > I am getting used to fun prog. However the purpose of my post was to > show that you can also get to a solution by not beating the beaten > path :) > > Simple and understandable are very subjective words. Let me say > this. When one of my al-gebra teacher - who came to substitute Andor > Kertész - open his mouth and emitted the word Permutation, I stood up > and walked out from the lecture hall. It sounded so gebrish that I > could not stay a minute for it. On the same time when my physics > teacher told that: Precessióra általában nutáció is superponálódik", > I asked him in the break: "What does it mean: "általában". > Well, if you are not getting it do not worry. > > I am never concerned by the readability of my newbies. They are like > new houses, a few 2X4 here and there hanged together by some nails. > I am posting it for fellow newbies. Professionals are not needed to > look at them. When I am asking for help I am asking fellow newbies > to reply. Expert advise would be anyway to much to my brain and just > would lay in my mailbox ununderstood. > > May be this group should be bifurcated. One for experts and one for > newbies. Anyone else should be quantum tunneling between the two. > > Just skip my posts. Do not even bother looking at them. Then peace > will be upon. > > High^5 > > János > > On Nov 25, 2006, at 5:37 AM, croddie at princeton.edu wrote: > >> Janos: get used to functional programming! >> >> Simple program, not too slow; plus you can read and understand it: >> >> doesitwork[partition_] := >> Module[{b, u, t, a, s, k, f, e}, >> {b, u, t, a, s, k, f, e} = partition; >> (100b + 10u +t)(100a + 10s + k) == 10000f + 1000e + >> 100a + 10s + t]; >> Timing[Select [Permutations[{0, 1, 2, 4, 5, 6, 7, 9}], doesitwork]] >> >> Output: >> {1.578 Second, {{0, 5, 6, 4, 9, 1, 2, 7}, {6, 7, 0, 1, 4, 2, 9, 5}}} >> >> >> János wrote: >> >>> Any suggestions to make it faster would be highly appreciated. /It >>> took 526 seconds to run with above parameters/ >>> >>> János >>> On Nov 14, 2006, at 5:06 AM, Bruce Colletti wrote: >>> >>>> How would this problem be solved in Mathematica? > > > > ---------------------------------------------- > Trying to argue with a politician is like lifting up the head of a > corpse. > (S. Lem: His Master Voice) >

**References**:**Arithmetic Puzzle (so simple it's hard)***From:*Bruce Colletti <vze269bv@verizon.net>

**Re: Arithmetic Puzzle (so simple it's hard)***From:*croddie@princeton.edu

**Re: Re: Arithmetic Puzzle (so simple it's hard)***From:*János <janos.lobb@yale.edu>