Talk:Probabilistic choice: Difference between revisions

From Rosetta Code
Content added Content deleted
Line 50: Line 50:


== "Random" vs. "Pseudorandom" ==
== "Random" vs. "Pseudorandom" ==
Not one solution on this page (at least among those that I have been able to read; I admit that J, for example, reads like Greek to me) uses actual random numbers. They all use pseudorandom numbers of one stripe or another. This distinction is more important than ever with the advent of '''actual''' random number services online (Random.org, LavaRnd, and HotBits, among others), one might reasonably take the task specification literally and mark every solution as incorrect. What I have done instead is to change the text of the task from "generate a million items ''randomly'' subject to" into "generate a million items ''randomly'' (or, more likely, ''pseudorandomly'') subject to". I think this clarification makes things "right". Thoughts? --[[User:Balrog|Balrog]] 17:25, 16 April 2011 (UTC)
Not one solution on this page (at least among those that I have been able to read; I admit that J, for example, reads like Greek to me) uses actual random <span style="color:blue"><s>numbers</s><u>number generation</u></span>. They all use pseudorandom <span style="color:blue"><s>numbers</s><u>number generation</u></span> of one stripe or another. This distinction is more important than ever with the advent of '''actual''' random <span style="color:blue"><s>number</s><u>number generation</u></span> services online (Random.org, LavaRnd, and HotBits, among others), one might reasonably take the task specification literally and mark every solution as incorrect. What I have done instead is to change the text of the task from "generate a million items ''randomly'' subject to" into "generate a million items ''randomly'' (or, more likely, ''pseudorandomly'') subject to". I think this clarification makes things "right". Thoughts? --[[User:Balrog|Balrog]] 17:25, 16 April 2011 (UTC)


:The distinction you make doesn't seem to me to merit making as random is commonly used to include pseudo-random unless the difference matters.
:The distinction you make doesn't seem to me to merit making as random is commonly used to include pseudo-random unless the difference matters.
:The task shouldn't distinguish between - and still, with your changes, doesn't distinguish between the use of random and pseudo-random numbers. As you have noted by the uniformity of the results, the task description was adequate for those authors of the ~30 existing language solutions. I don't think it would hinder your submission of another languages solution. --[[User:Paddy3118|Paddy3118]] 18:15, 16 April 2011 (UTC)
:The task shouldn't distinguish between - and still, with your changes, doesn't distinguish between the use of random and pseudo-random numbers. As you have noted by the uniformity of the results, the task description was adequate for those authors of the ~30 existing language solutions. I don't think it would hinder your submission of another languages solution. --[[User:Paddy3118|Paddy3118]] 18:15, 16 April 2011 (UTC)

::"Anyone who considers arithmetical methods of producing random digits is, of course, in a state of sin." -John von Neumann :-) In any case, I pointed out above why I thought the difference matters. --[[User:Balrog|Balrog]] 20:06, 16 April 2011 (UTC)


:So, ok, my thought was: is 1 a random number? --[[User:Rdm|Rdm]] 18:00, 16 April 2011 (UTC)
:So, ok, my thought was: is 1 a random number? --[[User:Rdm|Rdm]] 18:00, 16 April 2011 (UTC)

::HA! Good one. No, I was of course not being precise enough in my speech, and you caught me. Randomness or pseudorandomness is a characteristic of number selection or number generation, not of numbers themselves. I have corrected my original comment. --[[User:Balrog|Balrog]] 20:06, 16 April 2011 (UTC)

Revision as of 20:06, 16 April 2011

formatting trouble

I tried to add the SAS code, but it kept messing up the entry for tcl. Here is it is, if anyone who can format it is watching:

data test; do i = 1 to 1000000;

  x=rand("TABLE",(1/5),1/6,1/7,1/8,1/9,1/10,1/11);
  output;
  end;

run;

/* output from above is integer values 1,...,8 */ /* to show results with labels */ proc format; value hebrew

 1 = "Aleph"
 2 = "Beth"
 3 = "Gimel"
 4 = "Daleth"
 5 = "He"
 6 = "Waw"
 7 = "Zayin"
 8 = "Heth";

run;

/* check results */ proc freq data = test; tables x; format x hebrew.; run;



J solution

Well done, TBH.

--DanBron 22:44, 24 December 2008 (UTC)

Thanks, Dan. As I'm sure you recognized, the local definitions are simply for improving readability. In particular, the one for partitions (prtn) exists only to document and emphasize the partition-set that is the left argument to Interval Index. Omitting that name would still keep things simple and readable: da=. (+/\pt) I. ?y # 0
--TBH 18:55, 25 December 2008 (UTC)

TBH I don't know if it's worth it, but another possib. for counting is: pa =. \:~ y%~ #/.~ da

--Gaaijz 18:41, 26 December 2008 (UTC)
The problem I see with this is that it operates on the assumption that the actual proportions will fit the target proportions. This is to be tested, so cannot be assumed. The flaw is most clear when very small runs occur, in which cases the actual proportions are usually not in the same order as the targets. In such cases the code proposed above will pair proportions inaccurately. Nevertheless, I do appreciate being reminded of reflexive keyed-copy. --TBH 19:18, 27 December 2008 (UTC)

Convergence

This task might be more interesting if the measured probabilities were displayed every (log n) runs (i.e. at 10, 100, 1000, etc.), to show the rate of convergence towards the expected hit ratio. --Michael Mol 02:37, 8 November 2009 (UTC)

"Random" vs. "Pseudorandom"

Not one solution on this page (at least among those that I have been able to read; I admit that J, for example, reads like Greek to me) uses actual random numbersnumber generation. They all use pseudorandom numbersnumber generation of one stripe or another. This distinction is more important than ever with the advent of actual random numbernumber generation services online (Random.org, LavaRnd, and HotBits, among others), one might reasonably take the task specification literally and mark every solution as incorrect. What I have done instead is to change the text of the task from "generate a million items randomly subject to" into "generate a million items randomly (or, more likely, pseudorandomly) subject to". I think this clarification makes things "right". Thoughts? --Balrog 17:25, 16 April 2011 (UTC)

The distinction you make doesn't seem to me to merit making as random is commonly used to include pseudo-random unless the difference matters.
The task shouldn't distinguish between - and still, with your changes, doesn't distinguish between the use of random and pseudo-random numbers. As you have noted by the uniformity of the results, the task description was adequate for those authors of the ~30 existing language solutions. I don't think it would hinder your submission of another languages solution. --Paddy3118 18:15, 16 April 2011 (UTC)
"Anyone who considers arithmetical methods of producing random digits is, of course, in a state of sin." -John von Neumann :-) In any case, I pointed out above why I thought the difference matters. --Balrog 20:06, 16 April 2011 (UTC)
So, ok, my thought was: is 1 a random number? --Rdm 18:00, 16 April 2011 (UTC)
HA! Good one. No, I was of course not being precise enough in my speech, and you caught me. Randomness or pseudorandomness is a characteristic of number selection or number generation, not of numbers themselves. I have corrected my original comment. --Balrog 20:06, 16 April 2011 (UTC)