Fixing Unordered combinations custom block

True. Times should be expressed in microseconds, I suppose.
That is, if based in 1,000 repetitions.

Looks great - my compliments!

I'm not a statistician, but I think it should be milliseconds. If anything, the computed average is less precise than the individual measurements, not more precise (because the roundoff errors in the reported times can accumulate when you add them).

Obviously :wink:

Am I wrong about this? If so, please explain.

OK. For once prepare to receive a lecture :smile:
(To be fair, I’m not a statistician either, but at least, when while in college, I took Metrology 101)

Suppose the run time for 1,000 repetitions of a procedure under test (for lack of a better general term) is x milliseconds. Since both start and stop times are measured in milliseconds (± 0.5 ms, assuming the Programming tools DEVLAB script pic 2 block’s precision matches its output resolution), the maximum (measurement) error of x is ± 1 milliseconds (though in most cases it’s substantially smaller). Then the average run time of the procedure under test is (x ± 1) / 1,000 = x / 1,000 ± 1 / 1,000 milliseconds, or (x ± 1) microseconds (μs).

If you really really want to be on the safe side you should use microseconds from 2,000 repetitions, where the error is reduced to ± 0.5 μs, or less. If you trust in statistical distribution, this lower limit may be set at 1,000 √2, or roughly 1,400).

Oh, I see, you're just making one measurement of the total runtime of 1000 repetitions. I was thinking 1000 measurements averaged. So okay, yes, you can report the average time in microseconds. Thanks.

(But I'm sure I remember reading why three experiments with 1000 samples each is better than one experiment with 3000 samples...)

Like I wrote earlier: your latest code looks great!

Just two refinements:

  1. In your first block, instead of COMBINE () USING [APPEND () () ], why not use APPEND input list () ?
  2. In your second block, it may be more efficient to calculate INDEX OF () IN () only once, instead of with every time the predicate is evaluated? like:

And again, for large lists, you may want to use memoization.

Can't you say

instead of using KEEP? (But compute LENGTH OF DATA ahead of time instead of for every item.)

Umm,the procedure has an internal PDF for time,but we can only measure to milliseconds.This gives a lot of space for energy It's like shining a light through a half reflector or a polarizer.The statistical effect is you get the correct amount of photons coming through.

Yes, you can, but then you would need to add testing if exception > 1 and exception < length (because of the peculiar way NUMBER FROM () TO () works: it will count down as well as up).


or, for better readability:

Alternatively, you could use NUMBERS FROM () TO () ASCENDING, from the List utilities library, which IMO is a superior variety of NUMBERS FROM () TO (), as it will report an empty list if (to) < (from):

untitled script pic (4)

untitled script pic (2)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.