Skip to main content
Commonmark migration
Source Link

#TI-Basic, 39 bytes

TI-Basic, 39 bytes

sub("ABCDEFGHIJKLMNOPQRSTUVWXYZ",int(26^rand),1

rand generates a uniform value in (0,1]. This gives 26^rand a different probability to equal the integers from 1 to 26.

Older version, 45 bytes

sub("ABCDEFGHIJKLMNOPQRSTUVWXYZAAA",1+int(4abs(invNorm(rand))),1

Limited precision of the TI-Basic integers limits normal distributions to generating numbers within µ±7.02σ (see randNorm(). So we get the absolute value of a random number with µ 0 and σ 1, multiplying by four to increase the practical range mentioned before to µ±28.08σ. Then, we floor the value and add 1, since sub( is 1-indexed, giving us a range from 1-29 with different probabilities of each.

#TI-Basic, 39 bytes

sub("ABCDEFGHIJKLMNOPQRSTUVWXYZ",int(26^rand),1

rand generates a uniform value in (0,1]. This gives 26^rand a different probability to equal the integers from 1 to 26.

Older version, 45 bytes

sub("ABCDEFGHIJKLMNOPQRSTUVWXYZAAA",1+int(4abs(invNorm(rand))),1

Limited precision of the TI-Basic integers limits normal distributions to generating numbers within µ±7.02σ (see randNorm(). So we get the absolute value of a random number with µ 0 and σ 1, multiplying by four to increase the practical range mentioned before to µ±28.08σ. Then, we floor the value and add 1, since sub( is 1-indexed, giving us a range from 1-29 with different probabilities of each.

TI-Basic, 39 bytes

sub("ABCDEFGHIJKLMNOPQRSTUVWXYZ",int(26^rand),1

rand generates a uniform value in (0,1]. This gives 26^rand a different probability to equal the integers from 1 to 26.

Older version, 45 bytes

sub("ABCDEFGHIJKLMNOPQRSTUVWXYZAAA",1+int(4abs(invNorm(rand))),1

Limited precision of the TI-Basic integers limits normal distributions to generating numbers within µ±7.02σ (see randNorm(). So we get the absolute value of a random number with µ 0 and σ 1, multiplying by four to increase the practical range mentioned before to µ±28.08σ. Then, we floor the value and add 1, since sub( is 1-indexed, giving us a range from 1-29 with different probabilities of each.

fiexd, thanks trichoplax
Source Link
Timtech
  • 12.6k
  • 2
  • 46
  • 61

#TI-Basic, 39 bytes

sub("ABCDEFGHIJKLMNOPQRSTUVWXYZ",int(30^rand26^rand),1

rand generates a uniform value in (0,1]. This gives 30^rand26^rand a different probability to equal the integers from 1 to 3026.

Older version, 45 bytes

sub("ABCDEFGHIJKLMNOPQRSTUVWXYZAAA",1+int(4abs(invNorm(rand))),1

Limited precision of the TI-Basic integers limits normal distributions to generating numbers within µ±7.02σ (see randNorm(). So we get the absolute value of a random number with µ 0 and σ 1, multiplying by four to increase the practical range mentioned before to µ±28.08σ. Then, we floor the value and add 1, since sub( is 1-indexed, giving us a range from 1-29 with different probabilities of each.

#TI-Basic, 39 bytes

sub("ABCDEFGHIJKLMNOPQRSTUVWXYZ",int(30^rand),1

rand generates a uniform value in (0,1]. This gives 30^rand a different probability to equal the integers from 1 to 30

Older version, 45 bytes

sub("ABCDEFGHIJKLMNOPQRSTUVWXYZAAA",1+int(4abs(invNorm(rand))),1

Limited precision of the TI-Basic integers limits normal distributions to generating numbers within µ±7.02σ (see randNorm(). So we get the absolute value of a random number with µ 0 and σ 1, multiplying by four to increase the practical range mentioned before to µ±28.08σ. Then, we floor the value and add 1, since sub( is 1-indexed, giving us a range from 1-29 with different probabilities of each.

#TI-Basic, 39 bytes

sub("ABCDEFGHIJKLMNOPQRSTUVWXYZ",int(26^rand),1

rand generates a uniform value in (0,1]. This gives 26^rand a different probability to equal the integers from 1 to 26.

Older version, 45 bytes

sub("ABCDEFGHIJKLMNOPQRSTUVWXYZAAA",1+int(4abs(invNorm(rand))),1

Limited precision of the TI-Basic integers limits normal distributions to generating numbers within µ±7.02σ (see randNorm(). So we get the absolute value of a random number with µ 0 and σ 1, multiplying by four to increase the practical range mentioned before to µ±28.08σ. Then, we floor the value and add 1, since sub( is 1-indexed, giving us a range from 1-29 with different probabilities of each.

added 214 characters in body
Source Link
Timtech
  • 12.6k
  • 2
  • 46
  • 61

#TI-Basic, 4539 bytes

sub("ABCDEFGHIJKLMNOPQRSTUVWXYZ",int(30^rand),1

rand generates a uniform value in (0,1]. This gives 30^rand a different probability to equal the integers from 1 to 30

Older version, 45 bytes

sub("ABCDEFGHIJKLMNOPQRSTUVWXYZAAA",1+int(4abs(invNorm(rand))),1

Limited precision of the TI-Basic integers limits normal distributions to generating numbers within µ±7.02σ (see randNorm(randNorm(). So we get the absolute value of a random number with µ 0 and σ 1, multiplying by four to increase the practical range mentioned before to µ±28.08σ. Then, we floor the value and add 1, since sub(sub( is 1-indexed, giving us a range from 1-29 with different probabilities of each.

#TI-Basic, 45 bytes

sub("ABCDEFGHIJKLMNOPQRSTUVWXYZAAA",1+int(4abs(invNorm(rand))),1

Limited precision of the TI-Basic integers limits normal distributions to generating numbers within µ±7.02σ (see randNorm(). So we get the absolute value of a random number with µ 0 and σ 1, multiplying by four to increase the practical range mentioned before to µ±28.08σ. Then, we floor the value and add 1, since sub( is 1-indexed, giving us a range from 1-29 with different probabilities of each.

#TI-Basic, 39 bytes

sub("ABCDEFGHIJKLMNOPQRSTUVWXYZ",int(30^rand),1

rand generates a uniform value in (0,1]. This gives 30^rand a different probability to equal the integers from 1 to 30

Older version, 45 bytes

sub("ABCDEFGHIJKLMNOPQRSTUVWXYZAAA",1+int(4abs(invNorm(rand))),1

Limited precision of the TI-Basic integers limits normal distributions to generating numbers within µ±7.02σ (see randNorm(). So we get the absolute value of a random number with µ 0 and σ 1, multiplying by four to increase the practical range mentioned before to µ±28.08σ. Then, we floor the value and add 1, since sub( is 1-indexed, giving us a range from 1-29 with different probabilities of each.

Source Link
Timtech
  • 12.6k
  • 2
  • 46
  • 61
Loading