[WP 34S] Evolutionary pressure ;-)



#63

Just committed a major update of the manual to SourceForge. I tried to take the opinions (pl.!) posted here into account, though keeping the target audience of experienced users - so it won't interfere with a Beginners Guide.

I'd like to call those of you who are experts in proofreading, critizizing, finding logical gaps, errors, etc. to check it. TIA :-)


#64

Sorry for hijacking your thread, but it's not worth to start a new one for this little info - and there has also been some 'pressure' on me to display the full menu "N I PV PMT FV" in my TVM solver. ;-)

After a few trials I've found a good combination of [narrow-space] to show now the full TVM menu after pressing the 'menu' key [A].

So here's the new version - no other changes:

http://www.hpmuseum.org/guest/fhub/tvm_5.zip

BTW, in the WP34s emulator you can also use the comfortable function keys <F1>..<F5> on the PC-keyboard for the 5 TVM-variables instead of [A]..[->].

And a question for Walter:

Are there any commands to display/write a text in the number display?

I could imagine that this may be possible in a program, because error messages also use this line!?

Franz

Edited: 23 May 2012, 4:47 p.m.


#65

Quote:
And a question for Walter:

Are there any commands to display/write a text in the number display?

No.


Quote:
I could imagine that this may be possible in a program, because error messages also use this line!?

Possible: certainly. Complicated: a little. I doubt you want text messages in the bottom line and a blank top line which would be straightforward to implement but really seems kind of useless.

The alpha character set and seven-segment character set aren't laid out quite the same -- mostly the same yes but not exactly. That is only where the seven segment set is defined, it stops much shorter than the full character set and has plenty of gaps -- not all alpha characters are even possible in seven segments. Recipe for confusion here?

We don't have a second alpha register to store these characters and there is insufficient space in a normal register to do so (not that we could tell them apart). We might try to use the same alpha register for both -- then we'd need to find some non-volatile memory to cache one in while the other is being set up. Without losing programme memory we've something under one byte of non-volatile memory which will be difficult to squeeze enough characters into to be worthwhile.

Some characters need to be doubled up in both cases to display properly -- W and M are expressed as Ww and Mm to render properly. We'd need to special case expand these. More code but not difficult.


So yes, it could be done. Some of the required infrastructure is in place since we do render some limited text to the lower line already. We really don't see the general purpose utility given the difficulties of implementation and the trade-offs involved.

Other might/will disagree of course,

- Pauli


#66

Quote:
Other might/will disagree of course,

No, I don't! ;-)

I know that it won't be easy, but I just thought there might be something 'in' already, because you're using this bottom line for error messages and e.g. for "Walter,Pauli".

I just had the idea to display "nP nI" in this line for the TVM solver, but it's definitely not worth the troubles.

Franz


#67

BTW, I just had another idea:

You could implement PEEK/POKE commands which allow access to each single byte in the WP34s - dangerous but powerful commands.

And Walter would have 2 new entries for his 'internal/experts' catalog! :-)

I guess with such a direct memory access we could even switch on and off every single segment of the bottom line!?

And still another 'BTW':

Did you forget my keyboard 'enhancement' for the console version? :-(

It won't take more than a few minutes to replace the console.c with my version

http://www.hpmuseum.org/guest/fhub/console.zip

and make a new compile of wp34s.exe.

If my new key-assignments won't work then just undo it again, but if it works then the console version would finally be usable.

I know, it's usable for Pauli, but not for anyone else. ;-)

Franz

Edited: 23 May 2012, 7:04 p.m. after one or more responses were posted


#68

Quote:
Did you forget my keyboard 'enhancement' for the console version?

I doubt Marcus has forgotten this, he is very busy at the moment.


- Pauli

#69

Quote:
You could implement PEEK/POKE commands which allow access to each single byte in the WP34s - dangerous but powerful commands. :-)

I guess with such a direct memory access we could even switch on and off every single segment of the bottom line!?

We won't do that :-)

#70

Quote:
We won't do that :-)

But you would have 2 new commands in 'Walters special catalog' (IOW in the internal/experts catalog)! ;-)
#71

Just count me as one more user asking (or begging) for PEEK/POKE. It may never happen, but those A/D and I/O pins are there waiting for us...


#72

POKE is definitely not being implemented by me. I'd consider PEEK but there isn't a lot of point.

Exposing the A/D and I/O should be done directly and safely not via a back door.


Of course, anyone is free to donate code to do all this and more. Conditionally compiled out and we'd likely include it in the subversion system.


- Pauli

#73

Quote:

So here's the new version - no other changes:

http://www.hpmuseum.org/guest/fhub/tvm_5.zip


Excellent! Very easy to use now - I like how only [A] is used up. I'm tempted to change mine to [C], though, since I often use Sigma+, 1/x and sqrt(x), but rarely y^x

Question about the program in general: why are NI and NP = 1 by default? Wouldn't 12 make more sense? These are equivalent to the HP-20b P/YR and C/YR right?


#74

Quote:
Excellent! Very easy to use now - I like how only [A] is used up. I'm tempted to change mine to [C], though, since I often use Sigma+, 1/x and sqrt(x), but rarely y^x

But I doubt you'll use these 3 functions during any TVM calculations!? ;-)

And these A-D labels are of course only used when the TVM program is active.

I would even prefer any other dedicated function key (than [A]) as prefix for the 5 financial variables, but XEQ fails because it doesn't work with [->]. I would like to have something like a [Fn] key which works as prefix with _every_ other WP34s key calling the label with the corresponding keycode - but there are just not enough keys on this calculator.
Quote:
Question about the program in general: why are NI and NP = 1 by default? Wouldn't 12 make more sense? These are equivalent to the HP-20b P/YR and C/YR right?

NP=P/YR and NI=C/YR, at least I hope so (because I don't have a HP-20b). I've used NP for 'number of payments' and NI for 'number of interests' - maybe 'compoundings' is more usual in English, but for me NI is easier to connect with the interest rate 'I' than NC (and my excuse is that I'm a native German speaker ;-))

And there's another difference to usual financial calcs: the sign of NP and NI specify when the payments/compoundings happen: a -sign means 'BEGin of period', a +sign 'END of period'.

(but that's all described in detail in my TVM sourcefile ...)

Well, al least NI=1 (yearly compounding) is the default here in Austria (I guess even in Europe), and for NP: ok, paying every month may indeed be more usual than once in a year. But of course everyone can change these parameter defaults to his own needs by modifying the program. :-)

Franz


Edited: 24 May 2012, 1:31 p.m.


#75

Quote:
But I doubt you'll use these 3 functions during any TVM calculations!? ;-)

Good point! I'm still stuck in 2.2 mindset where loading and dumping code was a bit of a pain. Now I can just do f CLP when I'm done and reload it from the CAT when I need it.

Quote:
And there's another difference to usual financial calcs: the sign of NP and NI specify when the payments/compoundings happen: a -sign means 'BEGin of period', a +sign 'END of period'.

yes, very nice!

Quote:
Well, al least NI=1 (yearly compounding) is the default here in Austria (I guess even in Europe), and for NP: ok, paying every month may indeed be more usual than once in a year. But of course everyone can change these parameter defaults to his own needs by modifying the program. :-)

True enough!


#76

Quote:
Now I can just do f CLP when I'm done and reload it from the CAT when I need it.

It's not even necessary to load TVM into the RAM, it works without problems when you directly run it in the flash-ROM. Just select it in the CATalog, press ENTER and then R/S.

So no need to clear the program after use, just do [g]RTN to set the program counter back to RAM.


Edited: 24 May 2012, 1:58 p.m.


#77

Quote:
...just do [g]RTN to set the program counter back to RAM.

thanks for the tip. I'm sure that's written somebody's manual somewhere...

#78

Quote:
Just select it in the CATalog, press ENTER and then R/S.

So no need to clear the program after use, just do [g]RTN to set the program counter back to RAM.

Even easier. Select it and press XEQ or R/S and it run directly. NO ENTER required.


- Pauli


#79

... and that's written on p. 105 :-)

@Dominic: It will be documented with the next commit ;-)

#80

Walter,

I am not finding any new manual.pdf at sourceforge.net.

Filename?

I am eager to read it.

Chris


#81

You need to get it from doc/Manual_wp_34s_3_1.pdf via subversion. It isn't in the release distribution archive yet.


- Pauli


#82

Pauli,

Thanks.

I'll try again, the file date was still 5/11/12; I was looking for a 5/23/12.

Chris

#83

Download it here.


#84

Dominic,

Thanks, that gave me the 3.1 version.

Chris

#85

All quiet on the western front? Unbelievable! Well, let's wait for the weekend d;-)


#86

Quote:

proofreading, critizizing, finding logical gaps, errors


Walter,

the main obstacle on the way to do all this is that one has to read the whole manual again as there is no other way to tell what you deleted or added and where potential errors could be hidden...

Would you consider making available a version with changes clearly marked as such - text in red or something - to ease the proofreading?


#87

Alexander,

Quote:
... where potential errors could be hidden ...

If I knew that I'd get rid of them ;-) My main problem is I see that text to often. So your main advantage is you see it with new eyes. Please just report everything that bothers you, regardless where you find it, whether it's an old error or newly introduced.

BTW, manually marking every change won't solve the problem for the time being, as it will always juat mark the difference to the previous version of this file. And normally SVN should do this automagically but unfortunately it can't do it for pdf files :-(


#88

Walter,

I still agree with Alexander. There should be a jump function edit to edit. Your way is too inefficient, although theoretically pure perhaps, pardon me for saying. I gave up hunting Easter eggs.

Even in pdf you can add bookmarks, can't you?

Chris

Edited: 25 May 2012, 11:32 a.m.


#89

Sorry folks, I won't mark anything manually. Spend too many hours already for writing, revising, and rewriting this. Things would change if somebody would pay me for doing it ;-)

And I don't require anybody hunting Easter eggs - just browse the text at your will, stop where you like to, and report anything "strange" you find :-)

Edited: 25 May 2012, 11:51 a.m.

#90

I doubt anybody reads the manual from cover to cover more than once. (That's a Chuck-Norris-task who even counted to infinity - twice!)

I read the whole thing when I converted my first machine to a WP-34s V2(!) and after that I only searched it for specific information when in doubt about one function.

I completely understand that you can't afford to mark all changes. But you could maybe for ten consecutive versions write in a different text color (or a different paragraph layout in MS Word) so that changes are obvious. Then in the eleventh version you change all text back to original color (or standard paragraph layout) and start anew with the next changes in the different color.

Edited: 25 May 2012, 1:27 p.m.


#91

Hi all,

Though not graceful to use, there is a tool in the ubuntu distribution (at least the one I have, version 11 something or other) that will 'diff' PDF file called (you guessed it) 'diffpdf'.

You have to go though each page individually and look for the colour coding but at least it is possible.

If you have access to SVN, you can get specific versions of the document. Simply gather and rename them as you go. Then run up the diff tool.

Also, Walter, can you not just turn on the "record changes" feature in Word and generate both a 'clean' copy and 'diff' version? There is no "manual" markup at all. You simply turn the "show" feature on or off. The facility is not perfect but is better than nothing.

Best regards...


#92

Neil,

Thanks for your hints. I didn't know that Ubuntu tool - no wonder since I don't run Linux ;-) Sounds suitable, however :-)

The MS Word tool I know quite well - but that won't help in pdf :-/ And I'm not going to rehash that Word topic: all said more than twice ...

Edited: 25 May 2012, 4:27 p.m.


#93

Diff report file of 3.1 manual, revisions downloaded on 20120511 and 20120525

HTH

Massimo

#94

Sorry Walter. Not meaning to rehash the past!

Actually, you can generate diff'd PDFs. I do it all the time at work. No manual tagging involved at all.

Since I now use LibreOffice (and before that, OpenOffice) and haven't used Word in a while I might have some of the terms and/or commands slightly incorrect but its pretty well universal in all modern word processors.

In an older version of Word I used Tools|Track changes and Show Markup or Show Final. Then just simply cut the PDF.

When you commit the new PDF(s) to SVN, Accept all the changes in the Word file so you can track changes between versions.

Simple!

#95

Quote:

the main obstacle on the way to do all this is that one has to read the whole manual again as there is no other way to tell what you deleted or added and where potential errors could be hidden...


I've been using diffpdf to see what Walter has changed.


#96

Quote:

I've been using diffpdf to see what Walter has changed.


Nice! I will try that!

Edit: I did try and found that it only produces a meaningful result if the pdf's versions are pretty close. As soon as you have new pagebreaks in it, the readabilty deteriorates. :-(


Edited: 26 May 2012, 11:15 a.m.


#97

Yes, if the total number of pages has changed it will flag each page as changed as the footer. However you can flip very fast through the pages and see which ones actually have significant changes to them.

#98

Walter,

I think they are waiting to have the sun behind their cannons.

Chris


#99

Quote:
I think they are waiting to have the sun behind their cannons.

Hmmmh, even American apprentice cannoneers should have made it by now. I'll continue updating ;-)

Walter,

They smoked a huge neutrino peace pipe, exchanged beaver hats, and decided to do great science. Maybe you missed the thread, but it now has surfaced that the medical dictonary terms actually were coded messages from Dr. L to his friend the Mad Scientist doing secret solar wind tests in the interior of Alaska which read:

"Cannot confirm that Walter, Pauli, and Marcus have not secretly been hired by HP to develop their new Windows Phone with a slanted keyboard and 41C-like expansion ports for medical instruments, GPS, Sat. Comm., Field Oscilloscope, etc. STOP. Cannot confirm that Pauli is still thinking about an alphabetic entry algorithm for the 34S. STOP. Cannot confirm that Walter will introduce editing bookmarks as they may be considered too modern & decadent. STOP.STOP."

Chris


Chris,

Please pass my warmest regards to the beavers. Hope they aren't cold without their hats. And for the others: run faster to catch the neutrinos - remember they got a speed ticket this year already.

Edited: 29 May 2012, 4:52 p.m.


Walter,

You are so correct, someone should have done their homework better. It could have been interesting though, a neutrino at the stated speed greater than "c" would never decay, in fact, interstellar radiation would cease due to the ultimate Lorentz time contraction.

Walter you do seem to be unusually well educated across multiple scientific platforms, and yet, Mein Lieber Herrn Professor, some questions always remain unanswered. This "selective amnesia" cannot possibly be of random nature according the the WP-34S and only adds to my conspiracy theories that you are working for HP? Kann das recht sein?

Apart from these musings I wonder just how random is the RAN# on your "W-P34S"? If I were to run (i.e. generate) 1,000,000 runs of random numbers x in Re([0,1]) and plot them (x,y) where y=x, would I have 250,000 exactly in the quardrant of [(0,0),(0.25,0.25)] or which number would be the most accurate to expect? Confidence interval? Exactly how does one theoretically establish "randomness"? This is the essence of Monte Carlo integration (I was reading the other threads about the Romberg integration convergence and got to thinking...).

Tundra Chris

Edited: 29 May 2012, 7:10 p.m.


Quote:
Apart from these musings I wonder just how random is the RAN# on your "W-P34S"? If I were to run (i.e. generate) 1,000,000 runs of random numbers x in Re([0,1]) and plot them (x,y) where y=x, would I have 250,000 exactly in the quardrant of [(0,0),(0.25,0.25)] or which number would be the most accurate to expect?

I'd hope it was very unlikely but not impossible.


The 34S uses a Tausworthe pseudo random number generator based on the one present in the GNU Scientific Library with period roughly 288.

This is a fairly well respected and fast pseudo random number generator that is not suitable for cryptographic purposes.


- Pauli


Pauli,

Thanks for explaining this. I am still going through the references. The WP-34S project must be presenting you guys with an unlimited number of decisions to make - I cannot imagine that but three people can achieve such consensus even with N=3 being odd.

Although somewhat irrelevant yet quasi traumatic to my ego, I wrote down y=x as being the basis for plotting which results in a straight line = bummer! I did mean, naturally, that you plot a two column x(i),y(i) array of RAN# in Re([0,1]) and achieve a hopefully equally distributed canvas of dots. Maybe my girlfriend is right when she says that I don't know what I'm talking about no matter what I'm talking about except when she needs Sugar Daddy's keys to the snowmachine which makes me Mr. Right every time!

Pauli, do you even have snowmachines in Australia? Is Walter now in the sleep time zone?

Chris


Quote:
The WP-34S project must be presenting you guys with an unlimited number of decisions to make - I cannot imagine that but three people can achieve such consensus even with N=3 being odd.

It was N=2 for much of the project.


Quote:
Pauli, do you even have snowmachines in Australia?

Yes. We use the term for machines that make snow which are a summer attraction from time to time. There are the other kind too (vehicles for travelling on snow) -- just not very many and none anyway near where I live. These are all confined to the skiing areas in the South East.


Quote:
Is Walter now in the sleep time zone?

Walter never seems to sleep :-)


- Pauli

Quote:
Apart from these musings I wonder just how random is the RAN# on your "W-P34S"?

The following program, resulting from a discussion in this thread from last year, computes an approximation to pi based on a Monte Carlo method:

001 LBL A			
002 STO 00
003 CLX
004 STO 01
005 STO 02
006 RAN#
007 x^2
008 RAN#
009 x^2
010 +
011 X<1?
012 INC 02
013 INC 01
014 DSE 00
015 BACK 009
016 4
017 RCL* 02
018 RCL/ 01
019 END
Six successive runs of the program give
EEX 6 A    -->   3.140712
EEX 6 A --> 3.140076
EEX 6 A --> 3.139152
EEX 6 A --> 3.141284
EEX 6 A --> 3.141680
EEX 6 A --> 3.141628

This should be compared to the expected number of correct digits for one million tries (which I don't know) in order to verify the randomness of RAN# on the WP 34S. Also, we can try the HP-42S program on Emu42, for instance, and see how the results compare to each other.

Gerson.


Gerson,

Now this is extremely interesting. I thank you for your post and for the laborious entry of the prgm. lines. And the historic link was interesting. Now the 34S can hardly handle that kind of speed but for my use a lot less accuracy is still good enough.

This will be fun to try. My thought was also if Monte Carlo integration at times may be faster on the 34S than the standard numerical integration. Perhaps not.

Thanks again for your kind efforts.

Chris


Quote:
My thought was also if Monte Carlo integration at times may be faster on the 34S than the standard numerical integration. Perhaps not.

It will be faster only when we are lucky. This means it will be much slower in average. Each run above took about 15 seconds on the emulator. On the real calculator this is enough for only 3,000 tries and only one digit of accuracy, no matter how random in the random number generator. There are problems, however, to which Monte Carlo methods are the only practical solution.

Gerson.

AFAIK, Monte Carlo integration is a "brute force" method used if you have absolutely no idea how to solve a problem another way. At least it was in the early eighties when I applied it last. It should be no wonder you've to pay a just price for such ignorance. Statistical methods allow for an error estimation for sure, if this is of any value/interest to financial applications at all (it seems to me sometimes those guys don't want to know about the errors they produce so they can better play being stroken out of the blue when their customers made losses).


Walter,

I apologize for my time frame confusion; I work through so many time zones in one day, not to mention that I am almost right on the International Date Line, but are you actually writing from Germany and if so do you ever need much sleep?

And you are right as to the brute force. As we all know the MC originated from the early Manhattan/Los Alamos atomic bomb project, but the application can be used to simulate - not exactly calculate - different financial scenarios in essence a neural network buildup without the memory. What is it you do not like about that statistical representation? Are you implying that all these Billion Dollar Institutions are thus fakes in their use thereof? And if so, upon which basis? Have you actually studied its exact use and can you criticize it from science and not from (political?) emotion? Details Bitte!

True - many finance people blow statistics out of their horn while not being able to pass fifth grade math. True - Wall Street sucks in their narcissism. But the rest of your statement is as speculative as any politician's. Some cheat some do not. Some scientists cheat and present speculation as fact, some do not. Some scientists suffer from extreme narcissism leading to delusion of grandeur. But not all.

Damn, all I want is to play with my WP-34S and I've got work to do in the morning so I can pay my own bills. Maybe Monte Carlo is a fake, but it seems to work for me and as we say in Yankee Country - if it ain't broke don't fix it. Of course, admittedly, my German stuff never breaks, so you may not relate (jokes)!

I love you guys but its getting night time and the wolves are howling. Gotta batten down the hatches!

Chris


Chris, I was talking about MC integration. And yes, I can criticize this from a scientific point of view - you'll need very large numbers to get the statistical error implied in this method down to a reasonable size.

What I said about financial people, OTOH, was half personal experience half 'politics' extrapolating the first half ;-) I've seen a lot of but guessing methods in my professional life (also in engineering) where I wondered why it didn't crash everyday, but there were many experienced people interfering periodically so the crashes didn't happen. Things may become dangerous when not enough experienced people are around there anymore. But that's another story.

Best regards to the wolves - may they find enough food.


Walter,

The other year a group of six wolves did in fact find food by killing a caribou not far from here. I was snowmachining the mountains a mile out and I looked over a cliff and saw them downhill. Unfortunately I was unarmed about 100 feet from my rifle and my stainless .44 Mag handgun having stepped off for a call of nature and I was faced with this tall-legged gray wolf looking at me with its robotic eyes from my right flank. The last thing you want to do is to run or show fear. So I proceeded with my activity, yawned a couple of times (in your language they call that ubersprunghandlungen or something) showing displacement behavior and the wolf disappeared in a second. Magnificent. On the same mountain two years earlier I had fallen asleep (exhausted by my climb to the mountain top) sitting against a large rock in a snowstorm under my Eskimo Atguk (parka) holding my large caliber rifle - a 45-70 Gov't with Buffalo loads - and when I woke up there were bear prints all around me. My lucky day! The Musk Ox are roaming my back yard today and last year they walked into my neigbor's dog yard and killed two dogs. So I stuff my Smith and Wesson with extra (gun powder) loads in my belt when I feed my own sled dogs, hardly enough stopping power but better than nothing.

Life around here is good. How is it over there? Any rote brigaden walking down the street somewhere this AM looking for anything but work?

Chris

Edited: 30 May 2012, 10:32 a.m.


Quote:
Any rote brigaden walking down the street somewhere this AM looking for anything but work?

Too late by some decades.

Walter,

I must have been watching too much History channel - I am encouraged by your response. When I was in your country 25 years ago (and your airport police pointed his machinegun right at my person so infuriating me that I have never returned later as I was entirely unarmed) everybody seemed to hate eveybody and now it seems your southern flank countries need some help paying their bills after discovering that consumption must be preceded by production - until now an unknown concept. It is good that socislism prides itself by helping each other as that now seems to allow you to show just how happy you are helping them sleep longer in the morning.

Ahhh, all this political stuff is boring.

Chris

Quote:
AFAIK, Monte Carlo integration is a "brute force" method used if you have absolutely no idea how to solve a problem another way.

Not so. For N-dimensional integration where N gets largish (say N>= 5) Monte Carlo methods are perfectly competitive and achieve similar number of correct digits using the same or less function evaluations.

Matter of fact, if I had to compute a 5- or 6- dimensional integral this is the very first thing I'd try and probably the only one (save for attempting some theoretical, symbolic approach to try and lower the dimensionality one or two notches).

Best regards from V.


Buenas tardes, Valentin,

I had a 2-dimensional integral in my mind when making my statement above. Way back I had to calculate the efficiency of a planar sensor and due to its position I found no other way than doing it using MC. You can't know this of course. I've absolutely no experience with any integrals in more than 3D.

Walter


Walter,

Somehow your instinct of theoretical exactness and logic gedanken prevents you from seeing the beauty of a chaotic approach. And somehow I do not see German psychology behind the invention of MC, but admittedly they excel everywhere else. Ordnung muss sein! Nicht kaos!

By the way did your Government release my friend Capt. Paul Watson from SeaShepherd from detention or does ordnung muss sein prevent such action even if the wrong man is arrested?

Chris


Quote:
By the way did your Government release my friend Capt. Paul Watson from SeaShepherd from detention or does ordnung muss sein prevent such action even if the wrong man is arrested?

AFAIK your friend was set free again per decision of the court as of May 18, but he is not allowed to leave Germany until his case is settled. IMHO worse things could have happened to him on this planet. My best regards to the sharks - may they get a full meal of fresh fishermen wherever it helps.

Walter,

Yes after watching live shark finning on TV I had to lower the minimum limit of how low humanity can sink. I was wondering why the Prime Minister of Costa Rica was not being detained for cooperating with the finning mafia.

Chris

Valentin,

You are likely correct. The interesting fact being that if MC takes 100,000 points and sum up the tiny dx wide rectangles in random but evenly spread order, that is somewhat identical to say an ordered Romberg or similar summation. Since the order of addends is immaterial to the summation value we are doing the exact same thing. Am I correct?

Chris


Quote:
The interesting fact being that if MC takes 100,000 points and sum up the tiny dx wide rectangles in random but evenly spread order, that is somewhat identical to say an ordered Romberg or similar summation. Since the order of addends is immaterial to the summation value we are doing the exact same thing. Am I correct?

I don't think so. There are perfectly obvious mathematical reasons why this isn't the case but the mere empirical fact that you can get an approximation to the integral of a run-of-the-mill f(x) to 10 or 12 decimal places using Romberg and a few hundred to a few thousand function evaluations while on the other hand some 10,000,000,000 MC evaluations would be needed to get you about 5 correct decimal places should be more than enough to shed some serious doubt on your 'interesting fact'.

Just for instance, let's demonstrate with ol'trusty HP-71B:

(the correct integral is I = 0.8442212060827432080689466565208005086522471127730390482171256577045...)


10 SUB MCINTEG(A,B,N,F$,T) @ S=0 @ R=B-A @ RANDOMIZE 1
20 FOR I=1 TO N @ X=RND*R+A @ S=S+VAL(F$) @ NEXT I @ T=S*R/N @ END SUB


>SETTIME 0 @ I=INTEGRAL(0.5,1.7,0,SIN(IVAR^2)) @ DISP I,TIME

.844221206082 .16

>SETTIME 0 @ CALL MCINTEG(0.5,1.7,1E4,"SIN(X^2)",I) @ DISP I,TIME

.842813335819 5.68

>SETTIME 0 @ CALL MCINTEG(0.5,1.7,1E6,"SIN(X^2)",I) @ DISP I,TIME

.844172047994 568.31

Regards.

V.


Valentin,

Thanks for your interesting and informative demonstration. I learn new stuff all the time in this Forum and your response made me think some more. The brute force MC has zero built in intelligence (as you well know, of course) and has thus no way of shortcutting via any prediction as to the function behavior. This means that it has to run its full course even for a straight line function like y=2. Obviously you are presenting great indication thereof and your statement is fully correct. But to me I don't really care not being interested in theory (in my endeavor at hand) but results right here right now as my computer speed is so fast and free that brute force is easy and quick - no time consuming thinking required as long as it is integrable.

Obviously your requirement of high precision will amplify this brute approch intelligence deficiency, each additional decimal adding hugely to the number of runs required. Conversely, with less decimal rquirements this works in my favor as I only use one decimal and I am not interested in one number. I am interested in seeing simulations of K possibe sequences of N elements to demonstrate variation not summarized but element by element movements via the inverse distrubution function. MC is not my problem, my problem is establishing exactly which function is the best representation. And on top thereof my data is history dependent, i.e. the population data doesn't jump quite as much as the distribution may indicate. I thus have to add a smoothing function. What I really need is a neural network adding "memory" to the MC simulation.

I am simply simulating cash flows, say the Euro/US$ time line ratio, showing possible outcomes to induce me to think of the future possible most likely movements. I think it works great for me, but some in this forum do not think it is real science. I simply use math as part of my decision process, human psychology and world events (like some Europen Prime Minister saying something about the Europe Zone integration or disintegration) add further to my considerations - a world quite unknown to my mathematical pure theory friends.

This is where the WP-34S comes into play as a great tool as I can quickly scroll the 100 mem. regs. and get a "feel" (a highly un-mathematical concept) for what to expect within the variation, as well as give me the theoretical distribution (like log normal) minimum value over say 1000 simulations.

You guys have it easy although all these worries about the 16th. or 50th. decimal seem pedantic (now this leaves me open for some irate responses doesn't it!).

Thanks again for your demonstrations. Pls. do more! I am always open to new ways.

Chris


Hi again:

Quote:
Thanks for your interesting and informative demonstration. I learn new stuff all the time in this Forum and your response made me think some more.

You're welcome, I'm glad you liked it. As for thinking, it's always a great thing to indulge in though most people can't be bothered to.

Quote:
The brute force MC has zero built in intelligence (as you well know, of course) and has thus no way of shortcutting via any prediction as to the function behavior

Certainly. For that you need something like VEGAS Monte Carlo integration.

Quote:
Obviously your requirement of high precision will amplify this brute approch intelligence deficiency, each additional decimal adding hugely to the number of runs required.

About a hundred times as many samples to be precise.

Quote:
This is where the WP-34S comes into play as a great tool as I can quickly scroll the 100 mem. regs. and get a "feel" (a highly un-mathematical concept) for what to expect within the variation, as well as give me the theoretical distribution (like log normal) minimum value over say 1000 simulations.

I'd use Mr. J-F. Garnier's awesome free HP-71B emulator (emu71) for that. I routinely use in excess of 20,000 "registers" (real-precision array elements actually) when dealing with tricky problems and simulations.

Quote:
You guys have it easy although all these worries about the 16th. or 50th. decimal seem pedantic (now this leaves me open for some irate responses doesn't it!).

You'd better not include me in the "you guys" because I could care less for the 16th or 50th decimal in some statistics-related functions let alone the 600th.

Quote:
Thanks again for your demonstrations. Pls. do more! I am always open to new ways.

You're welcome. Thanks for your interest, if the occasion arises I'll gladly post further contributions.

Regards.
V.


Valentin,

Thanks for you always well organized, well researched, and well documented responses. Such makes a great scientist which you must thus be.

I learn from your posts and especially from the last one with Vegas. Although I use Wikipedia.org all the time I may have inadvertantly overlooked that entry as I normally do not, actually never, use MC for integration having not had the need. I like MC for its ability to generate samle series based upon the distribution mean and variance, in essence a reverse use; I have precision in the distribution formula but generate less granular series. That said, I will revisit Vegas as it may have uses in my environment so it was a great link. Gracias.

I actually have an older 75C with some pull thru magnetic strips. However, it is not computing power nor formulae that I need as my primary work comes through Excel and 3rd. party add-ins which list numerous distributions' fitness numbers. By looking at the series' output I get a non-mathematical precision feel for the wait times involved between certain numbers do occur as well as how often we get like three low numbers in a row and still be within the distribution. I like your precision as to how many more runs we need per decimal accuracy, 100.

I always in my mind think of MC as the resolution of a 10 cm x 10 cm computer screen in which we increase the display resolution. If we go from one to ten intervals per unit in both dimensions x,y we do indeed get 100 more needed points. Now, you made me think again.

I will certainly look for any future post from you here as I win every time as I learn new ways of thinking.

Thanks Valentin,

Chris

Edited: 1 June 2012, 11:33 a.m.


Possibly Related Threads...
Thread Author Replies Views Last Post
  [WP-34S] Unfortunate key damage with update to V3 :( svisvanatha 5 1,666 12-10-2013, 11:37 PM
Last Post: Les Bell
  WP-34S (Emulator Program Load/Save) Barry Mead 1 911 12-09-2013, 05:29 PM
Last Post: Marcus von Cube, Germany
  DIY HP 30b WP 34s serial flash/programming cable Richard Wahl 2 1,239 12-04-2013, 11:14 AM
Last Post: Barry Mead
  WP 34S/43 ?'s Richard Berler 3 1,163 11-10-2013, 02:27 AM
Last Post: Walter B
  My FrankenCulator (wp-34s) FORTIN Pascal 4 1,226 11-09-2013, 06:18 PM
Last Post: FORTIN Pascal
  WP 34S Owner's Handbook Walter B 5 1,537 11-09-2013, 05:34 PM
Last Post: Harald
  wp 34s overlay and programming. FORTIN Pascal 6 1,690 11-08-2013, 01:28 PM
Last Post: Nick_S
  m.dy in display of WP-34S Harold A Climer 3 1,095 11-05-2013, 11:28 AM
Last Post: Andrew Nikitin
  WP 34s : An old problem coming back Miguel Toro 2 979 11-05-2013, 03:00 AM
Last Post: Marcus von Cube, Germany
  [WP 34s] Pressure Conversion Factors Timothy Roche 8 1,798 11-04-2013, 07:17 PM
Last Post: Dave Shaffer (Arizona)

Forum Jump: