<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: More on Random Number in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/more-on-random-number/m-p/3565981#M32401</link>
    <description>Jan,&lt;BR /&gt;&lt;BR /&gt;&amp;gt;my only objection to any SEEDed &lt;BR /&gt;&amp;gt;procedure I have seen until now: &lt;BR /&gt;&amp;gt;Once the seed is given, the whole &lt;BR /&gt;&amp;gt;sequence is entirely deterministic, &lt;BR /&gt;&amp;gt;and so, absolutely _NOT_ random. Ok, &lt;BR /&gt;&amp;gt;the pattern may be erratic, but it &lt;BR /&gt;&amp;gt;_IS_ deterministic.&lt;BR /&gt;&lt;BR /&gt;  By definition, anything you generate using a mathematical algorithm will be, at best, "pseudo random". That is, the sequence is deterministic, but it has many of the properties of truly random numbers. The more statistical tests you can perform that FAIL to determine any patterns, the better your generator.&lt;BR /&gt;&lt;BR /&gt;  For most purposes, repeatability of the sequence is a FEATURE, as it allows (say) a simulation run to be repeated exactly.&lt;BR /&gt;&lt;BR /&gt;About the only way you will get REALLY random numbers out of any deterministic machine is to add some kind of truly random component. For example, a small sample of radioactive material and a geiger counter type sensor counting decays per unit time, or if time isn't critical, something like a lotto ball selector you see on TV.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Could you explain on which basis &lt;BR /&gt;&amp;gt;f$unique works?&lt;BR /&gt;&lt;BR /&gt;F$UNIQUE returns a 32 byte HEX string. It has two requirements: &lt;BR /&gt;1) the value must be unique across a cluster for "all time". &lt;BR /&gt;2) the value should be monotonic increasing&lt;BR /&gt;&lt;BR /&gt;It's implemented very simply by calling the system service $CREATE_UID and formatting the result as a HEX string.&lt;BR /&gt;&lt;BR /&gt;"$CREATE_UID&lt;BR /&gt;&lt;BR /&gt;Generates a universally unique identifier (UID). &lt;BR /&gt;Description&lt;BR /&gt;Generates a identifier that is unique across all computer systems."&lt;BR /&gt;&lt;BR /&gt;If you want the exact details, you'll have to hunt through the source code, but it's some kind of combination of node ID, current time and some bits to make sure it's not a duplicate.&lt;BR /&gt;&lt;BR /&gt;In fact the numbers generated by my one liner are decidedly NOT random, they have some very definite patterns, especially if called in a tight loop, or a loop with a constant execution interval. You might be able to do better by concatenating single low order digits. The only advantage over the other suggestions in this thread is it's small and fast.</description>
    <pubDate>Tue, 21 Jun 2005 01:32:58 GMT</pubDate>
    <dc:creator>John Gillings</dc:creator>
    <dc:date>2005-06-21T01:32:58Z</dc:date>
    <item>
      <title>More on Random Number</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/more-on-random-number/m-p/3565967#M32387</link>
      <description>Thread&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=910190" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=910190&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;has been closed, but I like to add some more.&lt;BR /&gt;&lt;BR /&gt;@Hein:&lt;BR /&gt;&lt;QUOTE&gt;&lt;BR /&gt;Watch out (sic) using just the clock, of system page faults, or such as a seed, as it may readily result in steady progression in the low order digits.&lt;BR /&gt;&lt;/QUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;Care to explain?&lt;BR /&gt;&lt;BR /&gt;If you read the procedure, the rand begins with the current centi-second reading of the system clock. I have always been convinced that those 100 different values have VERY equal probability of being picked.&lt;BR /&gt;Then the current seconds reading is taken, with only last digit used. For the same reasons as above, 10 equal chances.&lt;BR /&gt;Or do you happen to know of any relation between integer and fractional part of timestamp seconds reading?&lt;BR /&gt;A new call for hundredth gives 2 more digits.&lt;BR /&gt;Then "seconds integer last digit" (0 - 9) is used as deci-seconds to wait, before again getting hundredths. Please explain any tendency to drift away from pure randomness here!&lt;BR /&gt;Then those digits are string-concatenated.&lt;BR /&gt;Given a multiprocessing system, I do believe that the various invocations of f$cvtim will not be spaced predictable if measured in centiseconds.&lt;BR /&gt;If you REALLY are afraid that the clock time for processing the first and second determination of hundredths is too predictable, maybe giving predictable relations between the first and forth digit of rand, then do another 'random' decisecond wait (now derived from minute io second?) between those two.&lt;BR /&gt;&lt;BR /&gt;Proost.&lt;BR /&gt;&lt;BR /&gt;Have one on me.&lt;BR /&gt;&lt;BR /&gt;jpe</description>
      <pubDate>Fri, 17 Jun 2005 08:15:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/more-on-random-number/m-p/3565967#M32387</guid>
      <dc:creator>Jan van den Ende</dc:creator>
      <dc:date>2005-06-17T08:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: More on Random Number</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/more-on-random-number/m-p/3565968#M32388</link>
      <description>Jan,&lt;BR /&gt;your routine works fine if it's not executed repeatly and sequentially. In this case counters of hundredth increase in adjacent numbers.&lt;BR /&gt;You understand with attached example.&lt;BR /&gt; &lt;BR /&gt;Antonio Vigliotti&lt;BR /&gt;</description>
      <pubDate>Fri, 17 Jun 2005 09:10:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/more-on-random-number/m-p/3565968#M32388</guid>
      <dc:creator>Antoniov.</dc:creator>
      <dc:date>2005-06-17T09:10:38Z</dc:date>
    </item>
    <item>
      <title>Re: More on Random Number</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/more-on-random-number/m-p/3565969#M32389</link>
      <description>Jan, Thanks for re-opening this topic.&lt;BR /&gt;Allthough Niall was happy already. It seemed we were not quite done, but as long as. The old 'what problem are you trying to fix' huh?'&lt;BR /&gt;&lt;BR /&gt;I wanted to thanks Karl for pointed out that nice article:&lt;BR /&gt;&lt;A href="http://portal.acm.org/citation.cfm?id=63042" target="_blank"&gt;http://portal.acm.org/citation.cfm?id=63042&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The biggest problem I have with a time sampling based algoritme are that they may be too random :-). You can not repeat the run and get the same 'random' numbers.&lt;BR /&gt;&lt;BR /&gt;The algoritmic generator do repeat, and that may or might not be desirable. If not desirable, then use a proper seed.&lt;BR /&gt;&lt;BR /&gt;The time based samplers then to produce patterns.&lt;BR /&gt;See attached example build on your suggestions.&lt;BR /&gt;The pattern over a (shortened) range appears to be:&lt;BR /&gt; 'hot cold cold, hot cold cold, ...'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Very very minor comments:&lt;BR /&gt;Jan:&lt;BR /&gt;&lt;BR /&gt;$ rand = " ' ' one' ' ' two ' ' ' three ' ' ' four ' "&lt;BR /&gt;&lt;BR /&gt;That's an awful lot of quotes, easy to confuse.&lt;BR /&gt;For such construct why not use:&lt;BR /&gt;$ rand = one + two + three + four&lt;BR /&gt;&lt;BR /&gt;Antiono:&lt;BR /&gt;&lt;BR /&gt;Your loop needs two labels, two gotos.&lt;BR /&gt;I tend to use something like:&lt;BR /&gt;&lt;BR /&gt;$ I=0&lt;BR /&gt;$LOOP1:&lt;BR /&gt;$ C'F$FAO("!2ZL",I)'=0&lt;BR /&gt;$ I=I+1&lt;BR /&gt;$ IF I.LT.100 THEN GOTO LOOP1&lt;BR /&gt;$show sym c*&lt;BR /&gt;&lt;BR /&gt;versus the original:&lt;BR /&gt;&lt;BR /&gt;$ I=0&lt;BR /&gt;$LOOP1:&lt;BR /&gt;$ IF I.GT.99 THEN GOTO XIT1&lt;BR /&gt;$ C'F$FAO("!2ZL",I)'=0&lt;BR /&gt;$ I=I+1&lt;BR /&gt;$ GOTO LOOP1&lt;BR /&gt;$XIT1:&lt;BR /&gt;$show sym c*&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Hein&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 17 Jun 2005 09:59:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/more-on-random-number/m-p/3565969#M32389</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2005-06-17T09:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: More on Random Number</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/more-on-random-number/m-p/3565970#M32390</link>
      <description>Antonio,&lt;BR /&gt;&lt;BR /&gt;Yes, on a FAST system, with not much load, if you run a tight loop (as you do) even the hundredths tend to come in sequence.&lt;BR /&gt;Note that I did&lt;BR /&gt;a. some intermediate processinf&lt;BR /&gt;b. a wait for some deciseonds&lt;BR /&gt;c. this is _supposed_ to not only generate lists of random number, but to USE them for something. (needed in a symbol, remember?).&lt;BR /&gt;This "something" will undoubtably help to enhance the spread over the hundredths.&lt;BR /&gt;&lt;BR /&gt;Hein,&lt;BR /&gt;if you call the generated sequence "too random" then I absolutely wish to disagree on the definition of "random".&lt;BR /&gt;&lt;BR /&gt;ANY repeatable sequence (of ANY inbuild complexity) that is repeatable ABSOLUTELY does NOT qualify as RANDOM!! &lt;BR /&gt;Unless your mathematics stems from another world than mine :-)&lt;BR /&gt;&lt;BR /&gt;A sequence that is generated by a fixed calculation (and thus gives repeat results if starting from the same seed) is deterministic.&lt;BR /&gt;If such sequence forms a valid sample for the purpose, fine.&lt;BR /&gt;If repeatabily is wished for, here is a way to do it.&lt;BR /&gt;BUT IT IS __NOT__ RANDOM! It is deterministic. &lt;BR /&gt;&lt;BR /&gt;On the recognisable pattern:&lt;BR /&gt;I do not know how much you sampled, but even the fact that you noted twice as much "hot" as "cold" is a direct indication that this pattern is NOT for real. Given enough samplings, it is easily demonstrable that for each digit the values 0, 1, .. 9 each rapidly approache 10%, and, even more significant, that the correlation of each value of a digit with each digit on any other position also rapidly approaches 10%.&lt;BR /&gt;&lt;BR /&gt;-- if you are afraid of "clusters" of sub-patterns, then add the concept of the minute as well as the second for determining the wait period. Even combining those to build your sub-second wait is reasonable.&lt;BR /&gt;&lt;BR /&gt;== In a real situation, after each invocation of rand "something: will be done with it. That will surely generate extra randomising of the exact timing. &lt;BR /&gt;&lt;BR /&gt;-- on the syntax of concatenation:&lt;BR /&gt;You are right. Although any DCL programming tends to require this rather often, and I hardly notice anymore.&lt;BR /&gt;I was trying to force string concatenation and prevent numeric addition, but the values are already strings.&lt;BR /&gt;&lt;BR /&gt;You are MUCH MORE right for another reason:&lt;BR /&gt;My syntax will leave out leading zeroes, so any hundredth from 00 to 09 will be shortened, effectively "moving those zeroes to the front position".&lt;BR /&gt;So, in about 3 * 10% of the samples RAND will be low by about a factor 10.  :-(&lt;BR /&gt;Your construct does NOT have this defect.&lt;BR /&gt;&lt;BR /&gt;Proost.&lt;BR /&gt;&lt;BR /&gt;Have one on me.&lt;BR /&gt;&lt;BR /&gt;jpe</description>
      <pubDate>Fri, 17 Jun 2005 12:06:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/more-on-random-number/m-p/3565970#M32390</guid>
      <dc:creator>Jan van den Ende</dc:creator>
      <dc:date>2005-06-17T12:06:39Z</dc:date>
    </item>
    <item>
      <title>Re: More on Random Number</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/more-on-random-number/m-p/3565971#M32391</link>
      <description>Jan,&lt;BR /&gt;&lt;BR /&gt;WADR, random numbers are a subject with a complex history and an extensive literature. For casual use, the low order part of the clock can be used as a starting seed for a pseudorandom number generator (with provisions for rerunning the same sequence should the computation need reexecution in the future in exactly the same way).&lt;BR /&gt;&lt;BR /&gt;Casual use (and I do mean VERY casual use) is totally different from any large computation or system. Serious use of random numbers requires careful thought and consideration. I recommend Knuth's Seminumerical Algorithms (Volume 2) in the Art of Computer Programming series, although it is a bit dated.&lt;BR /&gt;&lt;BR /&gt;I hope that the above is helpful.&lt;BR /&gt;&lt;BR /&gt;- Bob Gezelter, &lt;A href="http://www.rlgsc.com" target="_blank"&gt;http://www.rlgsc.com&lt;/A&gt;</description>
      <pubDate>Fri, 17 Jun 2005 12:10:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/more-on-random-number/m-p/3565971#M32391</guid>
      <dc:creator>Robert Gezelter</dc:creator>
      <dc:date>2005-06-17T12:10:14Z</dc:date>
    </item>
    <item>
      <title>Re: More on Random Number</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/more-on-random-number/m-p/3565972#M32392</link>
      <description>fwiw... the pattern I suggested was an artifact of the range I happened to have used from an example. &lt;BR /&gt;The pattern was very strong:&lt;BR /&gt;The top 10 had 8 values divisible by 9&lt;BR /&gt;All top 20 values where divisible by 3&lt;BR /&gt;No value divisible by 6 under the top 20&lt;BR /&gt;&lt;BR /&gt;This was from 400,000+ samples. The code waited for the first value to get 7500 hits. This was on a modest AS1000 and took 20+ minutes of CPU.&lt;BR /&gt;&lt;BR /&gt;When I changed the value range to 100, they were all hit within a less than 5% range.&lt;BR /&gt;When the first value hit 7500, no value was hit less than 7200 times, most more that 7300.&lt;BR /&gt;&lt;BR /&gt;But then I changed the range to 1000 and then a horendous pattern becomes obvious. Ranges of almost 9 were never hit. It drifts over the number space. In the sample algoritme the 'hundreds' digit will always be close to the 'units' digit. so if the 'randumb' number is xxNxM&lt;BR /&gt;then M is N or N+1 and effictively the algoritme will only select 10% of the available range. And that's just a first order effect. My pattern with range 56 may well have been a derived pattern from this driving pattern. &lt;BR /&gt;I now see that Antonio also spotted this. Good job Antonio!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Try it on your system with the script from my earlier reply and the range stepped up to 1000? (And the FAO param for printout grown a digit also)&lt;BR /&gt;&lt;BR /&gt;Granted, if you actually do something between number generation, like a normal script would then is may well soften.&lt;BR /&gt;&lt;BR /&gt;But I'll warn you already that if all you do is for example to put those numbers in a file (not unreasonable?) then the pattern will still be there.&lt;BR /&gt;&lt;BR /&gt;I shows that if you are worried about true randomness then you can take nothing for granted. Trust but verify and all that!&lt;BR /&gt;&lt;BR /&gt;Have a great weekend you all!&lt;BR /&gt;I'm ready for a beer myself.&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;(ps... Jan... I never 'had one on you' last week when we had the chance did I? :-)</description>
      <pubDate>Fri, 17 Jun 2005 15:31:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/more-on-random-number/m-p/3565972#M32392</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2005-06-17T15:31:15Z</dc:date>
    </item>
    <item>
      <title>Re: More on Random Number</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/more-on-random-number/m-p/3565973#M32393</link>
      <description>Hein,&lt;BR /&gt;&lt;BR /&gt;I will do some checking myself.&lt;BR /&gt;I hope you do not mind my "fakingL some processing duration.&lt;BR /&gt;&lt;BR /&gt;PS.&lt;BR /&gt;&lt;BR /&gt;Entirely your own fault!!&lt;BR /&gt;&lt;BR /&gt;In those two weeks I have not exactly avoided the bar, and I am convinced there are those that can testify I _DID_ offer (and accept as well. Thanks again!).&lt;BR /&gt;Only prerequisite: You HAD to be there when I was.&lt;BR /&gt;(I am not too good in any throwing games, and throwing a beer at you while trying to guess where to aim has too low a cost/effect ratio).&lt;BR /&gt;&lt;BR /&gt;Proost.&lt;BR /&gt;&lt;BR /&gt;Have one on me.&lt;BR /&gt;&lt;BR /&gt;jpe&lt;BR /&gt;</description>
      <pubDate>Fri, 17 Jun 2005 15:53:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/more-on-random-number/m-p/3565973#M32393</guid>
      <dc:creator>Jan van den Ende</dc:creator>
      <dc:date>2005-06-17T15:53:40Z</dc:date>
    </item>
    <item>
      <title>Re: More on Random Number</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/more-on-random-number/m-p/3565974#M32394</link>
      <description>Jan,&lt;BR /&gt;just for precision, look carefully at your routine:&lt;BR /&gt;&lt;QUOTE&gt;&lt;BR /&gt;$ one = f$cvtime( "" ,, " hundredth " )&lt;BR /&gt;$ two = f$cvtime( "" ,, " second " )&lt;BR /&gt;$! need odd number of digits:&lt;BR /&gt;$ two = f$extract(1,1, " ' ' two ' " )&lt;BR /&gt;$ three = f$cvtime( "" ,, " hundredth " )&lt;BR /&gt;$ wait 0:0:0. ' two '&lt;BR /&gt;$ four = f$cvtime( "" ,, " hundredth " )&lt;BR /&gt;$&lt;BR /&gt;$ rand = "''one'''two'''three'''four'"&lt;BR /&gt;&lt;/QUOTE&gt;&lt;BR /&gt;You call f$cvtime( "" ,, " hundredth " ) two time sequentially without time out therefore "one" and "three" have the same value or else the two value are adjacent.&lt;BR /&gt;Your idea is good but implementation is slight poor.&lt;BR /&gt; &lt;BR /&gt;Antonio Vigliotti&lt;BR /&gt;</description>
      <pubDate>Sat, 18 Jun 2005 03:18:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/more-on-random-number/m-p/3565974#M32394</guid>
      <dc:creator>Antoniov.</dc:creator>
      <dc:date>2005-06-18T03:18:43Z</dc:date>
    </item>
    <item>
      <title>Re: More on Random Number</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/more-on-random-number/m-p/3565975#M32395</link>
      <description>Antonio,&lt;BR /&gt;your are right, as I already noted in my answer to Hein:&lt;BR /&gt;Insert a tiny wait between "one" and "three" as well.&lt;BR /&gt;&lt;BR /&gt;Remark: if this is going to be used for a huge amount of numbers (say 1 M + ), then those WAITs add up to a LONG time. In those cases, something else is needed.&lt;BR /&gt;&lt;BR /&gt;It starts to be more complex, but I think the routine given by Kalle in&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=910190" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=910190&lt;/A&gt;&lt;BR /&gt;would do well there. Although, for true randomness, I would still add a 'peek of the clock' as extra term in the calculation.&lt;BR /&gt;&lt;BR /&gt;fwif,&lt;BR /&gt;&lt;BR /&gt;Proost.&lt;BR /&gt;Have one on me.&lt;BR /&gt;&lt;BR /&gt;jpe</description>
      <pubDate>Sat, 18 Jun 2005 06:10:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/more-on-random-number/m-p/3565975#M32395</guid>
      <dc:creator>Jan van den Ende</dc:creator>
      <dc:date>2005-06-18T06:10:16Z</dc:date>
    </item>
    <item>
      <title>Re: More on Random Number</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/more-on-random-number/m-p/3565976#M32396</link>
      <description>If you're V7.3-2 or above, here's a one liner that might have adequate randomness&lt;BR /&gt;&lt;BR /&gt;$ r=%X'F$EX(30,2,F$UN())''F$EX(26,2,F$UN())''F$EX(28,2,F$UN())'&lt;BR /&gt;&lt;BR /&gt;r will be a decimal number in the range 0 through 16777215&lt;BR /&gt;&lt;BR /&gt;If you want to get 7 digits more accurately, use:&lt;BR /&gt;&lt;BR /&gt;$ r=%X'F$EX(30,2,F$UN())''F$EX(28,2,F$UN())''F$EX(26,2,F$UN())'*127/213&lt;BR /&gt;&lt;BR /&gt;that gives range [0..10003315]&lt;BR /&gt;&lt;BR /&gt;This is similar to using the clock.</description>
      <pubDate>Mon, 20 Jun 2005 00:40:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/more-on-random-number/m-p/3565976#M32396</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2005-06-20T00:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: More on Random Number</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/more-on-random-number/m-p/3565977#M32397</link>
      <description>As I understood there is, or will be, a good random number generator within VMS. At least, I know FORTRAN and PASCAL have a function returning a random number, based on a seed. It would be good idea to make it available in (E)DCL. So a sugestion to Guy:&lt;BR /&gt;&lt;BR /&gt;$ seed=(some value)&lt;BR /&gt;$ rand = f$random (seed)&lt;BR /&gt;&lt;BR /&gt;What about that.&lt;BR /&gt;&lt;BR /&gt;Willem&lt;BR /&gt;</description>
      <pubDate>Mon, 20 Jun 2005 05:59:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/more-on-random-number/m-p/3565977#M32397</guid>
      <dc:creator>Willem Grooters</dc:creator>
      <dc:date>2005-06-20T05:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: More on Random Number</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/more-on-random-number/m-p/3565978#M32398</link>
      <description>John,&lt;BR /&gt;it's very intersting for your alternate using of f$unique()!&lt;BR /&gt;Congratulations.&lt;BR /&gt; &lt;BR /&gt;Antonio Vigliotti&lt;BR /&gt;</description>
      <pubDate>Mon, 20 Jun 2005 06:56:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/more-on-random-number/m-p/3565978#M32398</guid>
      <dc:creator>Antoniov.</dc:creator>
      <dc:date>2005-06-20T06:56:06Z</dc:date>
    </item>
    <item>
      <title>Re: More on Random Number</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/more-on-random-number/m-p/3565979#M32399</link>
      <description>Willem,&lt;BR /&gt;&lt;BR /&gt;my only objection to any SEEDed procedure I have seen until now: &lt;BR /&gt;Once the seed is given, the whole sequence is entirely deterministic, and so, absolutely _NOT_ random. Ok, the pattern may be erratic, but it _IS_ deterministic.&lt;BR /&gt;&lt;BR /&gt;One ugly aspect thereoff: there are only so many discreet values of seed, and the next seed is derived from the previous. So, after "some" time, depending on the domain size, it, and therefor the whole sequence, will be completely repeated! &lt;BR /&gt;&lt;BR /&gt;Proost.&lt;BR /&gt;&lt;BR /&gt;Have one on me.&lt;BR /&gt;&lt;BR /&gt;jpe</description>
      <pubDate>Mon, 20 Jun 2005 07:35:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/more-on-random-number/m-p/3565979#M32399</guid>
      <dc:creator>Jan van den Ende</dc:creator>
      <dc:date>2005-06-20T07:35:41Z</dc:date>
    </item>
    <item>
      <title>Re: More on Random Number</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/more-on-random-number/m-p/3565980#M32400</link>
      <description>John,&lt;BR /&gt;&lt;BR /&gt;Could you explain on which basis f$unique works?&lt;BR /&gt;&lt;BR /&gt;Bojan</description>
      <pubDate>Mon, 20 Jun 2005 08:30:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/more-on-random-number/m-p/3565980#M32400</guid>
      <dc:creator>Bojan Nemec</dc:creator>
      <dc:date>2005-06-20T08:30:46Z</dc:date>
    </item>
    <item>
      <title>Re: More on Random Number</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/more-on-random-number/m-p/3565981#M32401</link>
      <description>Jan,&lt;BR /&gt;&lt;BR /&gt;&amp;gt;my only objection to any SEEDed &lt;BR /&gt;&amp;gt;procedure I have seen until now: &lt;BR /&gt;&amp;gt;Once the seed is given, the whole &lt;BR /&gt;&amp;gt;sequence is entirely deterministic, &lt;BR /&gt;&amp;gt;and so, absolutely _NOT_ random. Ok, &lt;BR /&gt;&amp;gt;the pattern may be erratic, but it &lt;BR /&gt;&amp;gt;_IS_ deterministic.&lt;BR /&gt;&lt;BR /&gt;  By definition, anything you generate using a mathematical algorithm will be, at best, "pseudo random". That is, the sequence is deterministic, but it has many of the properties of truly random numbers. The more statistical tests you can perform that FAIL to determine any patterns, the better your generator.&lt;BR /&gt;&lt;BR /&gt;  For most purposes, repeatability of the sequence is a FEATURE, as it allows (say) a simulation run to be repeated exactly.&lt;BR /&gt;&lt;BR /&gt;About the only way you will get REALLY random numbers out of any deterministic machine is to add some kind of truly random component. For example, a small sample of radioactive material and a geiger counter type sensor counting decays per unit time, or if time isn't critical, something like a lotto ball selector you see on TV.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Could you explain on which basis &lt;BR /&gt;&amp;gt;f$unique works?&lt;BR /&gt;&lt;BR /&gt;F$UNIQUE returns a 32 byte HEX string. It has two requirements: &lt;BR /&gt;1) the value must be unique across a cluster for "all time". &lt;BR /&gt;2) the value should be monotonic increasing&lt;BR /&gt;&lt;BR /&gt;It's implemented very simply by calling the system service $CREATE_UID and formatting the result as a HEX string.&lt;BR /&gt;&lt;BR /&gt;"$CREATE_UID&lt;BR /&gt;&lt;BR /&gt;Generates a universally unique identifier (UID). &lt;BR /&gt;Description&lt;BR /&gt;Generates a identifier that is unique across all computer systems."&lt;BR /&gt;&lt;BR /&gt;If you want the exact details, you'll have to hunt through the source code, but it's some kind of combination of node ID, current time and some bits to make sure it's not a duplicate.&lt;BR /&gt;&lt;BR /&gt;In fact the numbers generated by my one liner are decidedly NOT random, they have some very definite patterns, especially if called in a tight loop, or a loop with a constant execution interval. You might be able to do better by concatenating single low order digits. The only advantage over the other suggestions in this thread is it's small and fast.</description>
      <pubDate>Tue, 21 Jun 2005 01:32:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/more-on-random-number/m-p/3565981#M32401</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2005-06-21T01:32:58Z</dc:date>
    </item>
    <item>
      <title>Re: More on Random Number</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/more-on-random-number/m-p/3565982#M32402</link>
      <description>Just for reference, ICALC (&lt;A href="http://vms.process.com/scripts/fileserv/fileserv.com?ICALC)" target="_blank"&gt;http://vms.process.com/scripts/fileserv/fileserv.com?ICALC)&lt;/A&gt; has a random number genertor built in :-&lt;BR /&gt;&lt;BR /&gt;ran2(0)   random in 0.0 to 1.0&lt;BR /&gt;rand(0)   random in 0 to 2^31-1&lt;BR /&gt;&lt;BR /&gt;IC&amp;gt; rand(0)&lt;BR /&gt;        1079132159&lt;BR /&gt;IC&amp;gt; &lt;BR /&gt;rand(0)&lt;BR /&gt;        275634591&lt;BR /&gt;IC&amp;gt; &lt;BR /&gt;rand(0)&lt;BR /&gt;        846631423&lt;BR /&gt;&lt;BR /&gt;Rob.</description>
      <pubDate>Mon, 11 Jul 2005 08:38:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/more-on-random-number/m-p/3565982#M32402</guid>
      <dc:creator>Robert Atkinson</dc:creator>
      <dc:date>2005-07-11T08:38:34Z</dc:date>
    </item>
    <item>
      <title>Re: More on Random Number</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/more-on-random-number/m-p/3565983#M32403</link>
      <description>jpe: &lt;BR /&gt;$ONE=F$CVTIME("",,"hundredth")&lt;BR /&gt;$WRITE SYS$OUTPUT one  ! or writing to a disk gives an unpredictable value 00-99 which would probably be close to random if the numbers are not needed quicker than an IO. &lt;BR /&gt;&lt;BR /&gt; For an application that does not need numbers quickly, this would probably work.&lt;BR /&gt; In a simulation, the numbers used for the simulation should be recorded. I believe most simulations use psuedo-random numbers so that the results can be rerun.&lt;BR /&gt;Lawrence</description>
      <pubDate>Mon, 11 Jul 2005 11:10:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/more-on-random-number/m-p/3565983#M32403</guid>
      <dc:creator>Lawrence Czlapinski</dc:creator>
      <dc:date>2005-07-11T11:10:11Z</dc:date>
    </item>
    <item>
      <title>Re: More on Random Number</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/more-on-random-number/m-p/3565984#M32404</link>
      <description>jpe: As we've often said, the problem you're trying to solve affects the answer. In this case whether a particular method of random number generation is adequate for the intended task.&lt;BR /&gt;Lawrence</description>
      <pubDate>Mon, 11 Jul 2005 17:09:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/more-on-random-number/m-p/3565984#M32404</guid>
      <dc:creator>Lawrence Czlapinski</dc:creator>
      <dc:date>2005-07-11T17:09:12Z</dc:date>
    </item>
  </channel>
</rss>

