0

I have read the post about Generating a random link through Javascript/HTML. Generating a random link.

I'm just wondering how to make sure each URL could appear at the same ratio? For example, I have four URLs, and each of them will appear 50 times randomly.

URL 1: 50 times
URL 2: 50 times
URL 3: 50 times
URL 4: 50 times

Thanks in advance.

Louise
  • 1
  • how do you know if it appears 50 times? Sounds like you want a weighted random number. But to know if it hits X number of times would require you to store stuff on the server for its usage. – epascarello Jun 14 '18 at 19:07
  • @LuisfelipeDejesusMunoz Did we read the same question? Has nothing to do with generating a GUID. – epascarello Jun 14 '18 at 19:08
  • [`Generate A Weighted Random Number`](https://stackoverflow.com/questions/8435183/generate-a-weighted-random-number) – Alex Jun 14 '18 at 19:33

0 Answers0