[VA] My 2024's very first little teaser
|
01-30-2024, 08:54 PM
Post: #18
|
|||
|
|||
RE: [VA] My 2024's very first little teaser
Hi, PeterP, J-F Garnier, Maximilian Hohmann (and you lurkers,) A few comments re your recent posts to this thread, in order: PeterP Wrote:Wonderful! Thank you for sharing. I especially liked the clever use of the read and input statements to fill the matrix. You're welcome, PeterP, and thanks for your appreciation. I always strive to show new techniques to help people better use their calcs so I'm glad you found the read/input tricks useful. J-F Garnier Wrote:Great solutions, Valentin ! Your "elegant" solution is astonish, I'm not sure I would have thought about this efficient way to fill the 7x7 matrix. It is however specific to the 71B BASIC and will not work with other HP BASIC versions such as the HP-75C, and all in all I prefer your 2nd version, not only shorter but more standard. Thank you very much, J-F. The reason I specified that people should use the HP-71B and no other models was because my "elegant" solution wouldn't run unchanged in any other model, including the ungainly clunker aka HP-75C. Anyway, I prefer it vs. my "shorter" solution. By the way, I did try an optimization to the latter consisting in temporarily redimensioning the 7x7 matrix to a 49-element vector, so that the indexing would require just one index instead of two, like this: 1 OPTION BASE 1 @ DIM M(7,7) @ MAT M=IDN @ DIM M(49) 2 M(1)=0 @ INPUT M(2),M(43),M(20),M(3),M(29),M(13),M(4),M(36),M(12) 3 M(26)=M(20) @ M(21)=M(12) @ M(28)=M(13) @ DIM M(7,7) @ DISP DET(M) but no joy, it's actually 141 bytes long, i.e. 10 bytes longer than the non-redimensioned one. So much for the "optimization". By the way, I fully expected people to use DOT and DET for the easy teaser, but I'm mildly surprised that no one considered creatively using the HP-71B's Statistics functionality (STAT, ADD, DROP, TOTAL, etc.) though if I'm not wrong the clunker lacks those as well. He Also Wrote:Regarding the 7x7 matrix, I lately came to the idea that the solution was a single DET applied to a specifically built matrix, [...] Knowing what to look for, it's now quite easy to find it in the literature [...] Indeed, you just have to google it like this, and the very first link found points to the precise document where the 7x7 matrix I used can be found in page 9: and a somewhat simpler explanation on how to construct the 7x7 matrix (and the 7x7 matrix itself) can be found here: Permanent Determinant.
And He Finally Wrote:As for the low participation, there are probably several reasons, but one may be that the game was restricted to the HP-71B, that is unfortunately not the most popular machine on this forum. Well, so much for the forum, their loss. Maximilian Hohmann Wrote:However I learnt that HP-71B BASIC allows the use of variables in DATA statements which is an interesting feature that I completely overlooked so far! Thanks for that. You're welcome, Maximilian, thanks for your interest and I'm glad you became aware of a new technique, that meets one of my goals here. By the way, DATA statements can hold not just numbers, strings and variables, but whole numeric or string expressions, which will be evaluated upon being accessed by READ statements, e.g. 10 DATA 7.51E-23,"PARIS",35-LN(X)/LN(2),FNROOT(A,B,FVAR^5+FVAR-X) 20 DATA X$[1,5]&Y$,FNA(X,Y)-FNB(Y,Z),DET(M)/DET(N)
Regards. V. All My Articles & other Materials here: Valentin Albillo's HP Collection |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 4 Guest(s)