Questions tagged [random]

This tag is for questions pertaining to random numbers, whether pseudo random or truly random.

Filter by
Sorted by
Tagged with
28
votes
10answers
82k views

Random string generation

I'm using this C# function to generate random coupons for a system. How can I improve it? ...
4
votes
2answers
1k views

Program with random number generation

I am having trouble with the random number generator. For week 0 only, I want to set the starting number of roaches in House A (totalRoachesInHouseA) to 97 and the ...
7
votes
1answer
241 views

Random Q&A system

Basically, I made a simple app for my Android, where it picks a random question for you, and picks specific answers. Only 1 of the answers is correct, while other's aren't. Also, after editing the <...
3
votes
1answer
4k views

JavaScript: Weighted Random Generator

I'm attempting to create a function that will give me a "fish" at random, though a bias random depending on the weight value for the "fish". ...
5
votes
2answers
300 views

Social network evolution

I am writing a piece of code which models the evolution of a social network. The idea is that each person is assigned to a node and relationships between people (edges on the network) are given a ...
5
votes
1answer
707 views

Random Topic Generator

I've written a python module that randomly generates a list of ideas that can be used as the premises for furthur research. For instance, it would be useful in situations where a new thesis topic is ...
4
votes
1answer
692 views

Parsing random phrases from a file

This essentially reads a specially-structured file from the scanner and then parses random phrases and prints them: ...
4
votes
1answer
2k views

Password-generation function using custom seed

After reading an article on Skull Security mentioning the potential weakness of php's mt_rand function because of weak auto-seeding (http://ow.ly/4nrne), I decided to see what -- if any -- entropy I ...
14
votes
1answer
15k views

OAuth Provider token generation

I'm currently creating an OAuth provider in Java using Jersey. To the best of my knowledge Jersey does not provide a method to create oauth tokens so I'm creating my own. For those unfamiliar with ...
12
votes
3answers
3k views

Random Number Generator Class

I've written an abstract class in C# for the purpose of random number generation from an array of bytes. The .NET class RNGCryptoServiceProvider can be used to ...
13
votes
1answer
763 views

Quasi-random sequences: how to improve style and tests?

The requirements for this one were (original SO question): Generate a random-ish sequence of items. Sequence should have each item N times. Sequence shouldn't have serial runs longer than a given ...
8
votes
1answer
2k views

Randomly sampling a population and keeping means: tidy up, generalize, document?

This is part from an answer to a Stack Overflow question. The OP needed a way to perform calculations on samples from a population, but was hitting memory errors due to keeping samples in memory. ...
19
votes
3answers
2k views

Shuffling algorithm for a “guess that tune” game

I'm making a "guess that tune" game in Visual Basic 6 that is supposed to play each song in a random order: ...
13
votes
4answers
392 views

Draw random 1's and 0's

I was wondering if anyone would be so kind as to look at this code I've written for practice. Tell me what am I doing wrong, where can I optimize, anything. What this code does is (in terminal) draw ...

1
11 12 13 14
15