# Tag Info

### What an Odd Function

Jelly, 7 bytes Æf^<¥4P Swaps 2s and 3s in the input's prime factorization. The probability of odds is 2/3. Try it online! How it works ...
Accepted

### Choose The Powerball Numbers!

Dyalog APL, 10 bytes (5?69),?26 Dyadic ? is ⍺ distinct random numbers in [1,⍵], and monadic ...

### 1/N probability

MediaWiki templates with ParserFunctions, 48 bytes {{#ifexpr:1>{{#time:U}} mod {{{n}}}|true|false}}
Accepted

### Pick a random number between 0 and n using a constant source of randomness

x86 machines with rdrand instruction, 10 bytes ...

### Pick a random number between 0 and n using a constant source of randomness

Jelly, 7 6 bytes ⁴!!X%‘ Thanks to @JonathanAllan for golfing off 1 byte! Cannot be run on TIO because (16!)! is a huge number. How it works ...

### Plot the Gaussian Distribution in 3D

C++, 3477 3344 bytes Byte count does not include the unnecessary newlines. MD XF golfed off 133 bytes. There's no way C++ can compete for this, but I thought it would be fun to write a software ...

### 1/N probability

Pyth, 3 bytes !OQ Try it online Simple inversion of random choice from 0 to input Amusingly in Pyth it is not possible to make a function that does this ...

### Sample a random non-decreasing sequence

Python, 89 bytes from random import* lambda n,k:[x-i for i,x in enumerate(sorted(sample(range(1,n+k),k)))] Generating an increasing sequence rather than a non-...

### What an Odd Function

Husk, 11 10 bytes -1 byte thanks to Leo, and a slightly different function This has an odd probability of 1 !uΣz:NCNİ1 Try ...

### Choose The Powerball Numbers!

CJam, 16 bytes 69,mr5<26mr+:)S* ...

### "i" have "i" chance of occuring

CJam, 14 bytes E,_T9t\]ze~es= Test it here. Explanation ...

### 1/N probability

CJam, 5 bytes Gotta be quick with these ones... rimr! Test it here. Explanation ...

### 1/N probability

TI-BASIC, 4 bytes using one byte tokens not(int(Ansrand Determines if the integer part of the input times a random number in [0,1) is zero. ...

### Pick a random number between 0 and n using a constant source of randomness

Mathematica, 29 bytes Based on Dennis's Jelly answer. RandomInteger[2*^9!-1]~Mod~#& I wouldn't recommend actually running this. ...

### 1/N probability

MATL, 5 bytes Three different versions of this one, all length 5. iYr1= which takes an input (i), generates a random integer ...

### Compute the histogram entropy estimation of a string

Python 3.3+, 64 bytes import math lambda s:sum(math.log2(len(s)/s.count(c))for c in s) Got math.log2 from mbomb007's solution.
Accepted

### Estimate the mean minimum Hamming distance

Python 3, score = big(?) ...

### 1/N probability

Julia, 17 16 15 bytes n->2>rand(1:n) This is a function that generates a random integer between 1 and n and tests ...

### 1/N probability

JavaScript ES6, 15 bytes -5 bytes thanks to Downgoat. x=>1>new Date%x Based off (uses) of this answer's technique.

### Plot the Gaussian Distribution in 3D

Mathematica, 47 bytes Plot3D[E^(-(x^2+y^2)/2/#^2),{x,-6,6},{y,-6,6}]& takes as input σ Input  output -2 bytes thanks to LLlAMnYP

### Frequency Distribution of Multiple Dice Rolls

Octave, 38 bytes @(a,b)round(ifft(fft((a:a*b<a+b)).^a)) Try it online! Explanation Adding independent random variables corresponds to convolving their ...

### Calculate the probability of getting to the target first (exactly)

Wolfram Language (Mathematica), 25 bytes $$n! \div \left( \sum ^n _{k=0} k!(n-k)! \right)$$ #!/Sum[k!(#-k)!,{k,0,#}]& Try it online! -4 bytes from @ovs
Accepted

### Weighted coin flip strings

05AB1E, 40 39 18 17 bytes Brute-force approach: 0Lα1Ý²ãʒγOà³@}èPO Byte-count more than halved by porting @JonathanAllan's Jelly answer, which uses a similar ...

### 1/N probability

Microscript II, 3 bytes NR! Reads an integer n, generates a random integer between 0 and <...

### Choose The Powerball Numbers!

MATL, 10 bytes 69 5Zr26Yr Uses current version (9.2.0) of the language/compiler. Example With compiler run on Matlab: ...

### Probability of something happening at least n out of m times

Mathematica, 29 bytes BetaRegularized[#3,#,1+#2-#]& Takes input in the order n,m,p. Mathematica is so good, it even golfs ...

### Pick a random number between 0 and n using a constant source of randomness

Brachylog, 9 bytes ≥.∧13ḟṙ|↰ Try it online! This uses 13! like in Martin Ender's answer (13ḟ...

### Hand patterns in a card game

APL (Dyalog Unicode), 30 chars ×/!⍨,z,1÷((z←!∘≢⊢)⌸⊢),×∘≢!⍨1⊥⊢ Try it online! Using @orlp’s formula.