[VA] SRC#005 April, 1st Mean Minichallenge

04012019, 08:09 PM
Post: #1




[VA] SRC#005 April, 1st Mean Minichallenge
Hi all, welcome to my meaningless but wellmeaning SRC#005  April, 1st Mean Minichallenge. Given a set of data consisting of positive real numbers x_{1}, x_{2}, ..., x_{n}, consider these four wellknown means M_{k} for k = 1, 2, 3, 4: M_{1} = the Harmonic Mean = \(\frac{n}{\frac{1}{x_1} + \frac{1}{x_2} + ... + \frac{1}{x_n}} \) M_{2} = the Geometric Mean = \(\sqrt[n]{ x_1 x_2 ... x_n} \) M_{3} = the Arithmetic Mean = \(\frac{x_1 + x_2 + ... + x_n}{n} \) M_{4} = the Quadratic Mean = \(\sqrt{\frac{{x_1}^2 + {x_2}^2 + ... + {x_n}^2}{n}} \) The Minichallenge: Write code that accepts as input a dataset and the parameter k and returns the value of the corresponding mean M_{k}. For instance, for the sample dataset 4, 1, 20.19 your code should return: k = 1: M_{1} = 2.3085... (Harmonic mean) k = 2: M_{2} = 4.3224... (Geometric mean) k = 3: M_{3} = 8.3966... (Arithmetic mean) k = 4: M_{4} = 11.8972... (Quadratic mean) Now, with the same sample dataset, use your code to return the values of the means M_{5/2} , M_{Pi} , M_{2.019} and M_{0.61}. Also, find the value of k which makes M_{k} = Pi. In a day or so I'll post my original solution which is a 3line (138 bytes) subprogram for the HP71B, but in the meantime see what you can do with any HP calc (not Excel, Python, etc.) of your choice and please post both code and results, not just math expressions or text explanations and such. Enjoy ! V. 

04012019, 10:30 PM
Post: #2




RE: [VA] SRC#005 April, 1st Mean Minichallenge
(04012019 08:09 PM)Valentin Albillo Wrote: sample dataset 4, 1, 20.19 your code should return: Let x=k2, we have (4^{x} + 1^{x} + 20.19^{x}) / 3 = Pi^{x} Let f(x) = 4^{x} + 1 + 20.19^{x}  3 Pi^{x} ⇒ f'(x) = 4^{x} ln(4) + 20.19^{x} ln(20.19)  3 Pi^{x} ln(Pi) Use Newton's method to solve for x, x = x  f(x) / f'(x) guess(x) = guess(k)  2 = 1.5  2 = 0.5 → 0.4479070869 → 0.4457521188 → 0.4457475673 ⇒ k = x + 2 = 1.5542524327 

04022019, 02:18 PM
Post: #3




RE: [VA] SRC#005 April, 1st Mean Minichallenge
(04012019 08:09 PM)Valentin Albillo Wrote: sample dataset 4, 1, 20.19 ... return the values of the means M_{5/2} , M_{Pi} , M_{2.019} and M_{0.61}. To simplify code, geometric mean is better off (and more accurate) use multiply, then take nth root. Assuming all data positive, below HP12C code use 0 as signal for getting mean. 01 X=0 ; signal for getting mean 02 GTO 07 03 RCL 0; power = k2 ≠ 0 04 X^Y 05 Σ+ 06 GTO 00 07 g 0 ; mean before inverse power 08 RCL 0 09 1/X 10 X^Y 11 GTO 00 Example, for quadratic mean, k=4 [Clear Register] 2 [STO 0] ; stored power = k2 = 2 4 [R/S] 1 [R/S] 20.19 [R/S] 0 [R/S] ; quadratic mean = 11.89728401 M_{2.019} = 1.313123100 M_{0.61} = 1.979834390 M_{5/2} = 6.238885591 M_{Pi} = 8.981253690 

04032019, 11:56 PM
Post: #4




RE: [VA] SRC#005 April, 1st Mean Minichallenge
Hi, all: Well, I thought that this would make an interesting April, 1st entry but it seems I was pretty overoptimistic judging from Albert Chan being the only one who showed any interest by posting an amazingly concise solution for the HP12C no less, complete with all correct solutions and equations to boot. Thanks a lot, Albert ! My original solution is the following 3line subprogram (to vary a little from main programs and userdefined functions) for the HP71B, which also deals with the Geometric Mean as well (unlike Albert's HP12C program which does not, as he states himself): 60 SUB GMEAN(A(),L,M) @ N=UBND(A,1) @ K=L2 @ IF K THEN 70 S=0 @ FOR I=1 TO N @ S=S+A(I)^K @ NEXT I @ M=(S/N)^(1/K) @ ELSE 80 S=1 @ FOR I=1 TO N @ S=S*A(I) @ NEXT I @ M=S^(1/N) @ END IF The subprogram GMEAN (Generalized Mean), which can be called from any program in the RAM filesystem, accepts as parameters the array containing the dataset, the value of k, and returns in the specified variable (passed by reference) the value of the mean M_{k}. To test it and return the results I asked for, simply use this caller main program: 10 DESTROY ALL @ OPTION BASE 1 @ DIM A(3),M @ READ A 20 DATA 4,1,20.19 30 INPUT K @ CALL GMEAN(A,K,M) @ DISP K;M >RUN ? 1 > 2.30852787042 Harmonic mean ? 2 > 4.32247115132 Geometric mean ? 3 > 8.39666666667 Arithmetic mean ? 4 > 11.8972840038 Quadratic mean ? 5/2 > 6.2388855918 "midway" (!) between the Arithmetic Mean and the Geometric Mean ? PI > 8.98125368883 ? 2.019 > 1.31312310009 ? 0.61 > 1.97983439045 Notice that the limit of M_{k} when k tends to Infinity is the minimum of the values in the dataset (some mean !) while, conversely, the limit of M_{k} when k tends to +Infinity is the maximum of the values in the dataset (ditto). To approximately check this: >RUN ? 380 > 1.00288008791 { M_{Inf} = Min( x_{1}, x_{2}, ..., x_{n} ) = 1 } ? 380 > 20.1314053436 { M_{+Inf} = Max( x_{1}, x_{2}, ..., x_{n} ) = 20.19 } Finally, to find the value of k which makes M_{k} = Pi we use this wrapper code (which assumes you've run the main program at least once) : 40 INPUT M @ K=FNROOT(1,5,FNM(FVAR,M)M) @ DISP K;FNM(K,M) 50 DEF FNM(K,M) @ CALL GMEAN(A,K,M) @ FNM=M @ END DEF >RUN 40 ? PI 1.55425243272 3.14159265359 { = M_{1.55425243272} } That's all for now. Thanks again to Albert Chan for his interest and his worthy contribution, much appreciated. V. 

04062019, 11:41 AM
Post: #5




RE: [VA] SRC#005 April, 1st Mean Minichallenge
Hello!
(04032019 11:56 PM)Valentin Albillo Wrote: Well, I thought that this would make an interesting April, 1st entry but it seems I was pretty overoptimistic ... No no no! No lack of interest. At least not from my part. But firstly it was a very busy week and secondly after a quick read I was not really sure that I understood the problem but didn't want to give away my stupidity by asking silly questions ;) Will try it out for myself now on the HP71B and maybe the HP39GII that I got in the mail today. The latter one should be able to solve the Piproblem graphically. And by the way, wouldn't it be more elegant for finding the value for e.g. M 5/2, instead of taking the mean between the results M2 and M3, to fit a polynomial through all four results? Regards Max 

04062019, 10:34 PM
Post: #6




RE: [VA] SRC#005 April, 1st Mean Minichallenge
.
Hi, Maximilian: (04062019 11:41 AM)Maximilian Hohmann Wrote: No no no! No lack of interest. At least not from my part. Why, thank you ! It's always reassuring to know for a fact that some people find my productions interesting. Quote:after a quick read I was not really sure that I understood the problem but didn't want to give away my stupidity by asking silly questions ;) There are no such things as silly questions for mathrelated challenges but in any case, whenever you'd like to ask some question about some challenge of mine and you don't want people to deem your question 'silly', just sent me a PM and I'll promptly answer your question in perfect privacy. Quote:Will try it out for myself now on the HP71B and maybe the HP39GII that I got in the mail today. The latter one should be able to solve the Piproblem graphically. Good. If you do, please post your code in this thread, I'd love to see it. Quote:And by the way, wouldn't it be more elegant for finding the value for e.g. M 5/2, instead of taking the mean between the results M2 and M3, to fit a polynomial through all four results? I don't understand. The key to this minichallenge is that all four means mentioned (Harmonic, Geometric, Arithmetic, Quadratic) are but discrete cases of a continuous Generalized Mean which includes those four as particular cases. The Generalized Mean ( M_{k} for short) is defined as: M_{k} = \( \left( \frac{\sum_{i=1}^n a_i^k}{n} \right) ^ \frac{1}{k} \) and for k = 1, 0, 1, 2 it gives the Harmonic, Geometric (in the limit), Arithmetic and Quadratic means, respectively (for purely cosmetic purposes I did shift k by 2 to make it 1, 2, 3 and 4 instead). So you see, as k is a continuous parameter (so not necessarily an integer) from Inf to +Inf, you can compute M_{k} directly by using the above formula, no need to "take the mean" of any two results or perform any "polynomial fit", which matter of fact wouldn't succeed as the dependence on k is in the exponents and thus no polynomial fit would ever do. Thanks again for your interest, much appreciated, and have a nice weekend. V. . 

04072019, 12:01 AM
(This post was last modified: 04072019 12:09 AM by Albert Chan.)
Post: #7




RE: [VA] SRC#005 April, 1st Mean Minichallenge
Hi, Maximilian:
I too were afraid of posting a "stupid" solution (never heard of Generalized Mean) M_{k}^k = (a_{1}^k + ... + a_{n}^k) / n The case for k=0 doesn't fit quite right, getting meaningless result, M_{0} = 1^∞ I had to convince myself this work for Geometric Mean. For k=ε (small value, but not exactly 0): LHS = M_{ε}^ε = e^(ε ln(M_{ε})) ≈ 1 + ε ln(M_{ε}) RHS = (a_{1}^ε + ... + a_{n}^ε) / n ≈ ((1 + ε ln(a_{1})) + ... + (1 + ε ln(a_{n}))) / n ≈ 1 + ε ln(a_{1} ... a_{n}) / n ⇒ M_{ε} ≈ ^{n}√(a_{1} ... a_{n}) ⇒ M_{0} = ^{n}√(a_{1} ... a_{n}) 

04072019, 12:45 PM
(This post was last modified: 04072019 12:49 PM by Maximilian Hohmann.)
Post: #8




RE: [VA] SRC#005 April, 1st Mean Minichallenge
Hello Valentin and Albert,
(04062019 10:34 PM)Valentin Albillo Wrote: Good. If you do, please post your code in this thread, I'd love to see it. I will. First I have to read a little more of the HP39Gii manual... It has it's own programming langauge, a bit of a mix of everyting. Some BASIC, some keystroke programming and every line has to be terminated with a semicolon just like in C. Quote:I don't understand. The key to this minichallenge is that all four means mentioned ... are cases of a Generalized Mean ... is defined as: So this is the core of the stupid question I was too afraid to ask ;) Like Albert I had never heard of this before. Instead I falsely assumed that your April fool's challenge was based on arbitrarily assigning discrete indices to different ways of calculating means and then somehow interpolating between them. I asked Wikipedia about it and found out that in Germany it is actually called the "HölderMittel" (https://de.wikipedia.org/wiki/H%C3%B6lderMittel) of which I had never heard before either. A strange kind of April First sidenote is that it is also known as "Potenzmittel". Now this is a German word which also has a completely different meaning that one usually associates with malespecific medication, the most prominent brand name being "Viagra". But I will go back to my 39Gii (*) and see if I can administer the "Potenzmittel" somehow into it's memory :) Regards Max (*) In case anyone wants one: There is a guy in the UK who currently sells off these calculators for 10 GPB a piece + shipping on eBay. This is where I got mine from. They come from a girsonly boarding school on the outskirts of London and don't seem to have seen much usage  if any at all. Decent value for money if one does not want or need RPN/RPL. 

04072019, 01:21 PM
Post: #9




RE: [VA] SRC#005 April, 1st Mean Minichallenge
(04072019 12:45 PM)Maximilian Hohmann Wrote: ...First I have to read a little more of the HP39Gii manual... It has it's own programming langauge, a bit of a mix of everyting. Some BASIC, some keystroke programming and every line has to be terminated with a semicolon just like in C. The 39gii is really a Prime ; the immediate predecessor of the Prime, it's OS, language and many features are actually quite close to (the early) Prime. It's stark appearance and monoLCD are deceiving and make it appear much different, however they are far closer than they appear. Bob Prosperi 

04072019, 06:03 PM
(This post was last modified: 04112019 02:02 PM by Maximilian Hohmann.)
Post: #10




RE: [VA] SRC#005 April, 1st Mean Minichallenge
Hello!
(04072019 01:21 PM)rprosperi Wrote: The 39gii is really a Prime ; ... The "poor man's Prime" so to say :) I played all afternoon with it and it really is an interesting machine. Especially for the price you can find it for. It only crashed once during several hours (needed to take the batteries out to get it going again) which is not bad for this type of device. Unfortunately HP does not care the least about us Macintosh users (different to Ti whose "Ti Connect" software has always been running on Macs as well). Although I was able to install the connectivity kit inside a Virtual Box it does not "see" the connected calculator... So I have to post photograhs of my results instead. This is my 39Gii version of Valentin's program above. My attempts to pass a list, matrix or vector to a program resulted in the above mentioned crash, therefore I decided to use the inelegant way of storing the dataset in the global "L1" variable for lists. Entering the example data is done by typing {1,4,20.19} Sto Alpha L 1 Enter. (Note: Don't search for "Sto" on the keyboard, it is a menu funtion. What were these guys drinking when they designed this interface ?) As a genearal note, lots and lots of alternating "Alpha" and "Shift" pressing is necessary to program this calculator. A major, major, super major nuisance! The "GMEAN" program itself  not optimised in any way  reads like this, maintaining Valentin's variable names: EXPORT GMEAN(L) BEGIN LOCAL K,N,G,S,I; L2 > K; (Note: the ">" is in reality a black arrow that can be entered by menu command "STO" only) SIZE(L1) > N; (Note: L1 is one of ten global variables for lists) 0>G; IF K != 0 THEN (Note: Do not type "!=" here even if the manual says so. Use the crossedout equal sign accessible only from some menusubmenu instead. This took me almost an hour to find out and fix...) (extra Note: Back in the day when I paid for my mortgage by writing programs used to design large airliners I would not have checked against "0" here but against some very small number to make sure binary rounding stuff would not result in loss of human life. Now I couldn't care less.) 0>S; FOR I FROM 1 TO N DO (Note: Do insert all blank spaces manually here, using Alpha and the "+" key. The smart menu that creates the control expressions unsfortunately does not instert blank spaces around them which even more unfortunately are required for the program to work. My Sinclair ZX81 from 1981 did a lot better in that respect.) S+L1(I)^K > S; END; (S/N)^(1/K) > G; (Note: Some of the parentheses may actually not be necessary but I added them just in case. After some time I ran out of patiance for debugging and kept pressing the "(" and ")" instead  but the debugger itself is really not bad) ELSE 1>S; FOR I FROM 1 TO N DO S*L1(i)>S; (Note: As in Valentin's program "S" is actually a product here, not a sum  this is for the special case of the geometric mean) END; S^(1/N)>G; END; RETURN G; END; This programme, by using the "EXPORT" before it's name, makes the function "GMEAN" globally available on the calculator. Just like "SIN" or "LN". To try it out one can either type it into the "Home" screen as a command, e.g. GMEAN(1) or use the interface of the "Prgm" function which will smartly prompt for all function values (in this case there is only one). I like that latter functionality, otherwise one would have to code it oneself. Valentin's examples could be easily verified that way. To solve for the GMEAN = "Pi" challenge I used the graphing "App" of the calculator. It could of course have been done in many other ways as well. Also the necessary commands could have been added to the code, making it fully automatic. However I stayed with the semiautomatic way of doing things (like operating one's autopilot in "HDG" and "ALT HOLD" mode instead of using "LNAV" and "VNAV") and in the "Symb" menu defined and checked (the latter bit is very important  forget the check marks which are only available through the menu! and nothing will happen) two functions (I have to insert a photo here because, as already written, my Macintosh and the Hp39GII did not become intimate friends): Then I used the "Plot" key, manually set the boundaries for X from 1 to 5 and for Y from 1 to 20 and got the plot shown below. Within the Plotscreen simply use the "FCN>Intersect" menu and the value of K for which the generalized mean will be Pi is smartly shown at the bottom of the screen. Again, all this can somehow be programmed if one would want to present a fully autmatised version. Regards Max Note: Edited to reduce the picture size as requested 

04102019, 12:10 AM
Post: #11




RE: [VA] SRC#005 April, 1st Mean Minichallenge
Hi, Albert Chan: (04072019 12:01 AM)Albert Chan Wrote: The case for k=0 doesn't fit quite right, getting meaningless result, M_{0} = 1^∞ Good explanation. Though the code has to include the Geometric Mean as an special case to avoid the 1^∞ you mention, the generalized formula does actually work for values of k approaching from both sides. For instance, using my original solution we get: >RUN ? 1.999999 > 4.3224 57 34930 { M_{1.999999} (general case) } ? 2 > 4.3224 71 15132 { M_{2} (special case = Geometric Mean) } ? 2.000001 > 4.3224 78 34444 { M_{2.000001} (general case) } V. . 

04102019, 04:23 PM
Post: #12




RE: [VA] SRC#005 April, 1st Mean Minichallenge
This site has some practical information on calculating the geometric mean of data that includes zero values. Linked from the Wikipedia article on geometric mean.


04102019, 09:54 PM
Post: #13




RE: [VA] SRC#005 April, 1st Mean Minichallenge
.
Hi, Maximilian: (04072019 12:45 PM)Maximilian Hohmann Wrote: Like Albert I had never heard of this before. Instead I falsely assumed that your April fool's challenge was based on arbitrarily assigning discrete indices to different ways of calculating means and then somehow interpolating between them. Hehe, no, my "April Fool" minichallenges are intended to seem weird and/or impossible but they're never arbitrary or fake, they're solvable in a deterministic way with nothing arbitrary to them (see the archives for some others, like my "SSMC20April 1st 2008 Spring Special", for instance). Quote:I asked Wikipedia about it and found out that in Germany it is actually called the "HölderMittel" (https://de.wikipedia.org/wiki/H%C3%B6lderMittel) of which I had never heard before either. A strange kind of April First sidenote is that it is also known as "Potenzmittel". Now this is a German word which also has a completely different meaning that one usually associates with malespecific medication, the most prominent brand name being "Viagra". How unexpected (and fun!) ! Seems that both of us learned new things ! What an unexpected connection ! ... (and in German no less) Quote:This is my 39Gii version of Valentin's program above. [...]. What were these guys drinking when they designed this interface ?) As a genearal note, lots and lots of alternating "Alpha" and "Shift" pressing is necessary to program this calculator. A major, major, super major nuisance! Thanks a lot for your code, I find it perfectly understandable but unnecessarily complicated in the little details when compared to plain simple HP71B BASIC. I don't understand why HP kept and still keeps inventing new programming languages particularized for this or that new calc when they already had the very best, most powerful ones. In the case of (HP71Blike) BASIC, a few extensions here and there (i.e.: additional keywords and polls) would accommodate any new capabilities (such as graphics, lists, etc.), the same way HP did with the (71B) Math ROM, which added new data types (COMPLEX, COMPLEX SHORT) to the existing ones (INTEGER, SHORT, REAL) and extended/added the necessary capabilities to handle them. As for your "What were these guys drinking [...] ?" I've found myself thinking the same about some of the stupid decisions they made for the HP71B and its Math ROM, so nothing new there, it happens with many models. Quote:The "GMEAN" program itself  not optimised in any way  reads like this, Your comments (highlighted in dark red above) are hilarious, if sad. I guess there was little regard for usability tests when they designed the interface, else they'd have notice the many inconveniences and plain annoyances. Perhaps too strict deadlines or too few people assigned to do the checking. Anyway, if buyers can be (and actually are) used as beta testers for functionality, they may be for usability as well, Quote:I have to insert a photo here because, as already written, my Macintosh and the Hp39GII did not become intimate friends): Nice pics, thanks for including them but I'd like to ask you a favour: could you please edit your post to replace those large pictures with smaller versions ? The large size ruins the format of the PDF I intend to create with this thread, as I usually do. Thanks in advance ! ... Best regards. V. . 

04112019, 02:13 PM
(This post was last modified: 04112019 02:14 PM by Maximilian Hohmann.)
Post: #14




RE: [VA] SRC#005 April, 1st Mean Minichallenge
Hello Valentin,
(04102019 09:54 PM)Valentin Albillo Wrote: I don't understand why HP kept and still keeps inventing new programming languages particularized for this or that new calc when they already had the very best, most powerful ones. In the case of (HP71Blike) BASIC, a few extensions here and there ... I don't understand that either. They had everything in that calculator already. And there is still a market for good quality BASIC programmable calculators as Ti shows us every day... A reason why I like the Ti Voyage 200 so much is because for me it is kind of a 21st century successor of the HP71B: With a dedicated typewriter keyboard, an excellent BASIC language and connectivity. Plus of course some modern goodies like a fast processor, plenty of memory, a graphic display and CAS. (04102019 09:54 PM)Valentin Albillo Wrote: Nice pics, thanks for including them but I'd like to ask you a favour: could you please edit your post to replace those large pictures with smaller versions ? The large size ruins the format of the PDF I intend to create with this thread, as I usually do. I just resized them to 640 pixels (for nostalgic reasons only because 640 x 480 pixels was at one time _the_ standard for video graphics displays...). If this is still too large I can reduce them further. Regards Max 

04112019, 11:56 PM
Post: #15




RE: [VA] SRC#005 April, 1st Mean Minichallenge
.
Hi again, Maximilian: (04112019 02:13 PM)Maximilian Hohmann Wrote: II don't understand that either. They had everything in that calculator already. And there is still a market for good quality BASIC programmable calculators as Ti shows us every day... Seems like a very interesting machine, all the more if you recommend it as I know for sure that you're also very fond of HP71B BASIC, so I think I'll soon have a thorough look at it and if I like what I see it's perfectly possible that I'll get one for my ultraportable, onthego calc needs (as my Samsung tablet is not that ultraportable, go71b is nearly unusable on it, and also I do not like or trust the Prime). It would be my very first ever TI machine ! On a side note, I've never understood why HP calc fans are so uninterested (even dismissive) about the HP71B and 71B BASIC. It could be due to its unavailability when it was released, as it was so expensive that most HP fans couldn't lay their hands on one, but now that you can get one for peanuts (even as a gift) or in emulated form for nothing (Emu71/DOS, Emu71/Windows), the main reason for not owning and using one has become utterly moot. Matter of fact, it runs so many rings around anything RPN in all counts, and even exponentially more rings around RPL (all flavours) in terms of code readability and maintenance, that I find it very hard to understand why people would prefer to use those languages for anything other than simple throwaway programs or implementing "libraries" or doing stackrobatics and such. I think that the moment they must develop a significantly complex (even reallife) application, while further being expected to understand and maintain it in the notsonear future, they'll see what I mean. I still perfectly understand and am able to modify or extend very long, complex 71BASIC programs (say 100200 multistatement lines or more) just by looking at the listing and little else. Can that be done with an equally long and complex RPL program without extensive comments, stack mapping and lots of documentation ? I seriously doubt it. Quote:I just resized them to 640 pixels (for nostalgic reasons only because 640 x 480 pixels was at one time _the_ standard for video graphics displays...). If this is still too large I can reduce them further. That's perfect, no need for further size reduction. Thanks a lot for so promptly and efficiently honoring my request and for your entire post, much appreciated. Best regards. V. . 

04122019, 12:27 PM
(This post was last modified: 04122019 12:33 PM by Maximilian Hohmann.)
Post: #16




RE: [VA] SRC#005 April, 1st Mean Minichallenge
Hello,
(04112019 11:56 PM)Valentin Albillo Wrote: [Ti Voyaga] so I think I'll soon have a thorough look at it and if I like what I see it's perfectly possible that I'll get one for my ultraportable, onthego calc needs ... Well, the term "ultra portable" is of course open to interpretation. I took a quick photo of some scientific calcuators I pulled out from the heaps around my desk (all of which of course are functional and able to solve the problem from this thread with the exception of the orinial HP35). Interestingly their sizes do not differ as much as one would have thought. The notable exception is the cute "Woodstock" whose footprint is only 1/2 of most of the others. The biggest and heaviest one is actually the 2nd generation Ti Nspire. The Voyage has 14% more square centimeters than the HP71B but does not need a protective case and therefore uses less space in the briefcase than the HP. (Just for those readers unfamiliar with nonHP calculators, the top row shows: Ti Voyage 200, HP71B with an extra memory module in place of the card reader, Ti nSpire (2nd generation), HP39gii, Ti83plus, HP48G the bottom row: HP95LX, HP29C, HP35 version 3, HP35s, Ti59, HP41CV) (04112019 11:56 PM)Valentin Albillo Wrote: On a side note, I've never understood why HP calc fans are so uninterested (even dismissive) about the HP71B and 71B BASIC. It could be due to its unavailability when it was released, as it was so expensive that most HP fans couldn't lay their hands on one, but now that you can get one for peanuts (even as a gift) or in emulated form for nothing (Emu71/DOS, Emu71/Windows), the main reason for not owning and using one has become utterly moot. [unavailability] When it came out I was at univerisity and not even able to afford an HP41. The 71B cost over twice as much and a couple of accessories could drive the price up to the level of a decent family car. My Ti59 cost only half of the HP41 for comparison. (The car I was driving at the time had cost me 300 DM, an HP71B would have cost between 1500 and 2000 DM  just to show how outofthe world the price tag was  about as much a Commodre PET, Apple II or other firstgeneration "home computer" which then were really the things we wanted to have). I always wonder why so many of them are available on the collector market now, there must have been a lot of wealthy professionals back then who (or whose employer) could afford them. But that's good for us of course :) I wonder what would have happened if HP had brought out a direct successor in the early 1990ies, an HP72B. Leave the then obsolete card reader away, instead install a 2line display over the full width and solder some more memory onto the board. Maybe include the contents of some popular extension ROMs as standard. The competition (Sharp, Casio) did essentially that and were very successful with their Basicprogrammables. Regards Max 

04122019, 02:14 PM
Post: #17




RE: [VA] SRC#005 April, 1st Mean Minichallenge
(04122019 12:27 PM)Maximilian Hohmann Wrote: When it came out I was at univerisity and not even able to afford an HP41. The 71B cost over twice as much and a couple of accessories could drive the price up to the level of a decent family car. My Ti59 cost only half of the HP41 for comparison. (The car I was driving at the time had cost me 300 DM, an HP71B would have cost between 1500 and 2000 DM  just to show how outofthe world the price tag was  about as much a Commodre PET, Apple II or other firstgeneration "home computer" which then were really the things we wanted to have). Oh, definitely professionals. Stuff that's astronomically expensive from a hobbyist's point of view can make perfect sense in a business context. For example, one time when I had only been a professional programmer for a few years, I had to debug a memory leak. The application in question was large enough that simply staring at the code until I figured it out was not an option. I did a bit of research and found a tool that looked perfect for the job, but it was not something we already had. So, we would have to buy it, and the price was $1500 (U.S.). With my hobbyist sensibilities, I thought $1500 was insane. But I really needed this thing, so I went to my boss, fully expecting to be turned down at such an extreme price tag. Instead, he didn't even blink. He just asked, "do you need this?" And I told him that I expected it to save me about two weeks of work on the current project. That was all he needed to hear, he signed the purchase order right away. And once I thought of what two weeks of my time actually cost the company, it was clear that this really was a nobrainer. I'm sure that's how it goes with a lot of that seeminglyexpensive HP equipment. It saves people work and that's how it pays for itself. And if it is just a bit more reliable or easy to use than cheaper equivalents, that extra money usually pays for itself, too. 

04122019, 09:54 PM
Post: #18




RE: [VA] SRC#005 April, 1st Mean Minichallenge
Hello Valentin,
Sorry for being a bit late and thanks for the interesting challenge. I learned a lot about "mean" calculations (and about HP 15c prgramming). I always wondered how the geometric mean is connected to the other means. Here is my solution for the HP 15C: Code: 001 LBL A  42,21,11 # Mean calculation subroutine, expects data in Matrix A and k in x The value for the geometric mean calculated by the logarithmic summation is: M2=4.322471149 The value calculated by multiplication is M2=4.322471151 Here are the values for the requested parameters: M2.019 = 1.313123100 M0.61 = 1.979834390 M5/2 = 6.238885591 MPi = 8.981253690 The solution of Mp=pi is calculated by the sequence Code: 1 Best regards Bernd 

04132019, 12:08 AM
Post: #19




RE: [VA] SRC#005 April, 1st Mean Minichallenge
.
Hi, Maximilian and Bernd Grubert, Just some quick comments on your respective posts: Maximilian Hohmann Wrote:HP71B with an extra memory module in place of the card reader One of my physical HP71B is very similarly fitted, with a 128 Kb RAM module (CMT) in the card reader slot, plus a Math ROM, HPIL ROM, and 4 Kb RAM modules. Maximilian Hohmann Wrote:I was at univerisity and not even able to afford an HP41. The 71B cost over twice as much How lucky ! It was over three times as much here in Spain, completely unaffordable to me. However, I managed to get one via my then employer, exactly as Thomas Okken did. Maximilian Hohmann Wrote:I always wonder why so many of them are available on the collector market now, there must have been a lot of wealthy professionals back then who (or whose employer) could afford them. Nothing of the sort. The UK Government's DHSS (Department of Health and Social Security) ordered thousands of HP71Bs in the 80's, together with a specialized DHSS ROM, a wand, HPIL ROM and additional software and hardware. The DHSS ROM turned each HP71B into a terminal for a oneoff file tracking database system, you can read full details here. In the 90's they became obsolete and were all sold extremely cheaply so the second hand market for the HP71B was flooded with machines in good working condition fitted with HPIL ROM, at least one 4 Kb RAM module, and at times even the DHSS ROM itself and/or the wand, but no manuals or leather case or anything else. I bought several back then at US$ 25 each but afterwards I saw them being offered even cheaper and at one HPfan meeting each attendant was given one for free, as a door prize so to say. That's the real reason they're so cheap and so aplenty, no need to postulate 'wealthy professionals'. (PS: Also, I remember I bought four HP71B via TAS, this time at US$ 50 each, but everyone of them came fitted with a Math ROM (!!), to my immense delight. I doubt they were DHSS machines so: where did they come from ? Another large order by some technical department or something ?) Maximilian Hohmann Wrote:I wonder what would have happened if HP had brought out a direct successor in the early 1990ies, an HP72B. Perhaps HP intended to release a successor but then someone new was hired and made sure to push real hard stackbased models, putting an end to that possibility and so killing for sure any future HP BASIC pocket computers, thus leaving an enormously lucrative market to many very successful SHARP and CASIO models. HP's loss. (04122019 09:54 PM)Bernd Grubert Wrote: Sorry for being a bit late and thanks for the interesting challenge. I learned a lot about "mean" calculations (and about HP 15c prgramming). [...] Here is my solution for the HP 15C: You're welcome, and thanks to you for an excellent solution for the HP15C, which is very short (just 37 steps) and delivers all correct results to the questions the challenge asked for, so congratulations are in order. The trick of computing the Geometric Mean by adding logarithms and then a final exponential is perfectly Ok for strictly positive datasets, as in this case, and the precision lost amounts to but a few ulps in the worst case, so it's perfectly acceptable as well. Thanks again for your interest and for posting such a fine solution. Hope to see you participating in my next challenge or, if you're up to it and would rather not wait, Tier 2 got no solutions at all in my recent S&SMC#24 (still visible in the main page) and it's perfectly within the capabilities of an HP15C and a keen user like yourself. Wanna give it a try ? Best regards to all. V. . 

04132019, 05:31 AM
Post: #20




RE: [VA] SRC#005 April, 1st Mean Minichallenge
(04132019 12:08 AM)Valentin Albillo Wrote: Nothing of the sort. The UK Government's DHSS (Department of Health and Social Security) ordered thousands of HP71Bs in the 80's, together with a specialized DHSS ROM, a wand, HPIL ROM and additional software and hardware. The DHSS ROM turned each HP71B into a terminal for a oneoff file tracking database system, you can read full details here. I wasn't aware of this, a short but very enjoyable thread  thanks for the pointer. ÁM 

« Next Oldest  Next Newest »

User(s) browsing this thread: 1 Guest(s)