Thread Rating:

CopperTop
CopperTop
  • Threads: 5
  • Posts: 7
Joined: Dec 28, 2017
September 12th, 2019 at 1:40:20 AM permalink
Some years back I found Michael's computer-generated simulated-craps dice-results data set with something like 100,000 or maybe even a million numbers in it. Unfortunately, my laptop was stolen, and now I can't find the PDF again. Does anyone know where it is online? I appreciate any help.
Wizard
Administrator
Wizard
  • Threads: 1517
  • Posts: 27023
Joined: Oct 14, 2009
Thanked by
CopperTop
September 12th, 2019 at 6:12:20 AM permalink
I forgot about that. Maybe I'll recreate it. How would you like the file laid out?
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
cowboy
cowboy
  • Threads: 6
  • Posts: 183
Joined: Apr 22, 2013
September 14th, 2019 at 9:59:31 AM permalink
csv format 100 by 1000 or 1000 by 1000 would work for me.

How would it be different than using the RND function? Or different than a file from random.org? (after 1D6 plus 1D6 processing for both, that is)
Wizard
Administrator
Wizard
  • Threads: 1517
  • Posts: 27023
Joined: Oct 14, 2009
September 14th, 2019 at 11:16:58 AM permalink
Quote: cowboy

csv format 100 by 1000 or 1000 by 1000 would work for me.

How would it be different than using the RND function? Or different than a file from random.org? (after 1D6 plus 1D6 processing for both, that is)



Anything from random.org should be fine.
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
MichaelBluejay
MichaelBluejay
  • Threads: 86
  • Posts: 1680
Joined: Sep 17, 2010
Thanked by
LuckyPhow
September 15th, 2019 at 10:07:41 PM permalink
My site, Easy Vegas, has a Craps Rolls Generator. Let me know if you'd like the output in a different format.
I run Easy Vegas ( https://easy.vegas )
7craps
7craps
  • Threads: 18
  • Posts: 1977
Joined: Jan 23, 2010
September 16th, 2019 at 11:56:56 AM permalink
I looked in my old collection of web-pdfs and did not see having a copy of the Wiz craps rolls from the OP
Quote: MichaelBluejay

My site, Easy Vegas, has a Craps Rolls Generator. Let me know if you'd like the output in a different format.

That is nice to use.

Many will not use any computer generated rolls for a craps tester (actual rolls are wanted and prefered)
as both javascript and Excel have had serious issues in the past, especially failing most all statistical 'run' tests. (already well documented)

not that this is important, you use an interesting seed method for Math.random() I have never seen B4 (except from you) as seen in some of your code.

others have a Mersenne Twister implementation in javascript (that still has some issues as JS does not use arbitrary precision, but there seems to be good work-a-rounds) that can take a seed value to be able to always use the same results for testing.
example found here: https://gist.github.com/banksean/300494

It might be worth (or might not) getting the best possible code for this - even IF it is slightly slower than Math.random()

at least you added this to your site. better than nothing at all.
winsome johnny (not Win some johnny)
MichaelBluejay
MichaelBluejay
  • Threads: 86
  • Posts: 1680
Joined: Sep 17, 2010
Thanked by
CrystalMathLuckyPhow
September 16th, 2019 at 12:06:23 PM permalink
Quote: 7craps

at least you added this to your site. better than nothing at all.

It's far better than "better than nothing at all", it's in fact absolutely useful with no downsides.

Javascript used an inferior random method until 2015 when it was upgraded to Xorshift+128, which is way more than adequate for this task. If someone will accept only actual craps rolls from a casino as legitimate, the problem is their delusion, not any actual inadequacy of my generator.
I run Easy Vegas ( https://easy.vegas )
charliepatrick
charliepatrick
  • Threads: 39
  • Posts: 3011
Joined: Jun 17, 2011
September 17th, 2019 at 12:03:16 PM permalink
I've had no problems with javascript and Mersenne for my sims. Although I can't be 100% sure, I tested the RNG against a few tests and most results, such as Blackjack, are close to the expected results. Due to the limitations of the size a computer/compiler can keep numbers, technically the probabilities of each roll isn't exactly 1/6.
MichaelBluejay
MichaelBluejay
  • Threads: 86
  • Posts: 1680
Joined: Sep 17, 2010
Thanked by
7craps
September 17th, 2019 at 12:38:35 PM permalink
A sim of a game could return the expected result even with bad random quality. As an extreme example, if you pick random numbers from 1-100, the average should be 50.5, and a generator that picked 50.5 every time would pass the "average = 50.5" test.

Here's a good table comparing different popular algorithms.
I run Easy Vegas ( https://easy.vegas )
7craps
7craps
  • Threads: 18
  • Posts: 1977
Joined: Jan 23, 2010
September 17th, 2019 at 12:52:06 PM permalink
Quote: MichaelBluejay

Javascript used an inferior random method until 2015 when it was upgraded to Xorshift+128, which is way more than adequate for this task.

After some reading on the subject I agree.
a problem I have come across with Xorshift+128 is the seeding or that lack of it to produce repeatable results. My readings say the browser does the initial seeding unless one writes code for it. I have not yet looked into it as I do not intend to use javascript for simulations. (never say never) But some do just that.

But seeing things like this (Xorshift+128)


makes me want to learn how to avoid duplicating those results and getting results that look more like this
.

the top photo was using a seeding method I have seen used for Math.random()
example
	die1 = Math.floor(Math.random(seed)*6)+1;
die2 = Math.floor(Math.random(seed)*6)+1;

I was under the impression that function does not take a seed. I could be wrong here too.

so much to learn if one wants to learn
winsome johnny (not Win some johnny)
Steen
Steen
  • Threads: 0
  • Posts: 126
Joined: Apr 7, 2014
Thanked by
tringlomane
September 17th, 2019 at 6:05:23 PM permalink
Quote: MichaelBluejay

My site, Easy Vegas, has a Craps Rolls Generator. Let me know if you'd like the output in a different format.

Output showing the numbers of each individual die would be preferable. Without this your data is useless to hardway or hop bet players. For example, when your data generates an "8" did it come from a 6-2, 5-3, or 4-4? Providing the ability to download a file containing multiple rolls would be even better.

Your site displays the following:
Quote:

The only way to do test a system properly is to run a computer simulation (either one long session of millions of rounds, or thousands of short sessions).

I tend to agree but there are many factors to consider and at any rate there are those who insist that real random numbers are the only way to go. For that, numbers obtained from random.org should suffice. However, there are those who claim that only real rolls from real tables are acceptable (as if real random vs craps table random are two different things). I author a simulator called WinCraps which allows you to deal with all these options.

Quote:

Running a computer simulation means either hiring someone to write the program (probably $100 would do it), or learning how to program it yourself (would probably take about a week). To hire someone, try Fiverr or Upwork. To learn programming, try Udemy, Code Academy, or Learn Python.

Programming is not everyone's cup of tea especially if it means learning a full-blown programming language. I've tried to make it a bit easier by providing a language called "Auto-betting" for use in WinCraps It uses craps lingo, integrates easily with the game variables, and handles most of the overhead. For those who are still loath to write a program, there are dozens of free scripts available covering a multitude of systems.

Steen
MichaelBluejay
MichaelBluejay
  • Threads: 86
  • Posts: 1680
Joined: Sep 17, 2010
September 17th, 2019 at 7:00:17 PM permalink
Quote: 7craps

My readings say the browser does the initial seeding unless one writes code for it.

You're right, Math.random() is auto-seeded; I included the seed by mistake since I always just copy/paste my RNG code that I've been using for years. Since Math.random() doesn't take arguments, specifying a seed argument isn't supposed to change the results, but your scatter plot suggests that it does. Can you share the code or the website you used to generate the plots?
I run Easy Vegas ( https://easy.vegas )
7craps
7craps
  • Threads: 18
  • Posts: 1977
Joined: Jan 23, 2010
September 17th, 2019 at 7:43:25 PM permalink
Quote: MichaelBluejay

Since Math.random() doesn't take arguments, specifying a seed argument isn't supposed to change the results, but your scatter plot suggests that it does. Can you share the code or the website you used to generate the plots?

https://github.com/lordpoint/xorshift-sandbox-and-visualizer

the code in the scripts.js file I added and changed
now = new Date();
seed = now.getSeconds();

let y = 0;
let state0 = seed; //123; // SEED - change these to affect the apparent randomness of the outcome
let state1 = seed*seed; //234; // SEED - change these to affect the apparent randomness of the outcome
seed*seed plot looked fine. It was the last I did.

I really did not want to do more as I am not ready to learn about this and use it right now. stuck it all in a folder.

I did notice that when I did NOT use that (seed) in your code (another program of yours - Betting System Tests, I think), it ran just fine (I wondered why that was) and was a bit faster to me. I did not time it.

hope this helps out as many ask questions about Math.random() and setting a seed seems to be the most asked. a seed would be nice to have repeatable results for testing.
winsome johnny (not Win some johnny)
MichaelBluejay
MichaelBluejay
  • Threads: 86
  • Posts: 1680
Joined: Sep 17, 2010
September 17th, 2019 at 9:04:35 PM permalink
Quote: Steen

Output showing the numbers of each individual die would be preferable. Without this your data is useless to hardway or hop bet players.

Good point, I added that option.

Quote: Steen

Providing the ability to download a file containing multiple rolls would be even better.

What format should that be in? A stream of individual dice, space-delimited?
I run Easy Vegas ( https://easy.vegas )
MichaelBluejay
MichaelBluejay
  • Threads: 86
  • Posts: 1680
Joined: Sep 17, 2010
September 17th, 2019 at 9:26:40 PM permalink
Quote: 7craps

But seeing things like this (Xorshift+128)...

Are you sure that's Xorshift+128? The project refers to it as "xorshift" in one place, and "xorshift+" in another (although they're separate algorithms), and never once says "xorshift+128" (which is yet another variation). There are yet others. Xorshift+128 is more robust than earlier incarnations.

I downloaded the GitHub project and forced it to use Math.random() so I knew I'd be getting Xorshift+128:

if (Math.random(seed)<0.50) ...

That gave me a snow-like plot, with both a seed and without a seed. Maybe there's some reason that's not an apples-to-apples comparison vs. pulling bytes directly out of the algorithm for some reason, but I'm certainly satisfied with the snow-like plot, which suggests to me that my betting-system-test generators produce good results.
I run Easy Vegas ( https://easy.vegas )
CopperTop
CopperTop
  • Threads: 5
  • Posts: 7
Joined: Dec 28, 2017
September 22nd, 2019 at 1:21:35 PM permalink
Michael, thanks for responding. Sorry for my delay in return. Whatever's convenient for you, of course. I'll be putting a large chunk of it in an Excel file eventually -- each number on its own row -- so a format that I can convert and/or copy works for me. I appreciate all the work you do, sir!
krly
krly
  • Threads: 1
  • Posts: 2
Joined: Sep 7, 2019
September 22nd, 2019 at 4:11:26 PM permalink
What type of RNG is used in the Wiz's craps game ?
7craps
7craps
  • Threads: 18
  • Posts: 1977
Joined: Jan 23, 2010
September 22nd, 2019 at 4:33:54 PM permalink
Quote: krly

What type of RNG is used in the Wiz's craps game ?

looking in the javascript files of the Craps game
uses Mersenne Twister in Javascript
var RNG =                  // Mersenne Twister
// adapted from http://gist.github.com/banksean/300494

var die1 = RNG.Next(6) + 1;
var die2 = RNG.Next(6) + 1;
var sum = die1 + die2; Game.Sum = sum;
winsome johnny (not Win some johnny)
MichaelBluejay
MichaelBluejay
  • Threads: 86
  • Posts: 1680
Joined: Sep 17, 2010
September 22nd, 2019 at 6:39:12 PM permalink
There are much better choices than Mersenne Twister (see problems here and here). The Wiz games were probably developed over a decade ago before better alternatives became readily available. There was a time when it seemed everyone was using Mersenne Twister.
I run Easy Vegas ( https://easy.vegas )
MichaelBluejay
MichaelBluejay
  • Threads: 86
  • Posts: 1680
Joined: Sep 17, 2010
September 23rd, 2019 at 12:51:54 PM permalink
Okay, CopperTop, I upgraded the Craps Rolls Generator to give the option to generate a downloadable file, either comma, tab, or line-delimited, up to a million rolls, and reporting either the dice total or the individual dice values.
I run Easy Vegas ( https://easy.vegas )
Steen
Steen
  • Threads: 0
  • Posts: 126
Joined: Apr 7, 2014
September 24th, 2019 at 4:54:03 AM permalink
Quote: MichaelBluejay

Good point, I added that option.

Looks good except the come-out naturals are not displaying the individual dice.

Quote: MichaelBluejay

What format should that be in? A stream of individual dice, space-delimited?

The options you've set are good, but I'd add space delimited and no-delimiters as options too.

Incidentally, downloading 500k or 1m files doesn't appear to work.

WinCraps users can open one of your files on the Dice Roll Files screen and enter them into a roll file using the "Paste from text file" option.

Steen
MichaelBluejay
MichaelBluejay
  • Threads: 86
  • Posts: 1680
Joined: Sep 17, 2010
September 24th, 2019 at 2:36:27 PM permalink
Thanks for the suggestions and bug catch.

I fixed the display output to show individual dice on a non-point come-out, and I added "space" and "none" as delimiter options.

I'm able to download 500k and 1M files in Chrome, Safari, and Firefox, although sometimes in Chrome it takes a couple of tries. I doubt there's anything I can do on my end to fix that.
I run Easy Vegas ( https://easy.vegas )
  • Jump to: