Skip to main content
Commonmark migration
Source Link

#Mathematica 157-10-50 = 97

Mathematica 157-10-50 = 97

A random number from 1-30 is used for starting. All the remaining column numbers from the dot are chosen via RandomChoice[If[c > 15, {2, 1}, {1, 2}] -> {-1, 1}] + c, which translates to: "If the prior column number was greater than 15, select one number from the set {-1,1}, with -1 weighted 2:1 with respect to 1; otherwise, flip the weights and choose from the same set.

ReplacePart replaces the element in a list of 30 blank spaces that corresponds to the column of interest.

f@c_ := Switch[d = RandomChoice[If[c > 15, {2, 1}, {1, 2}] -> {-1, 1}] + c, 1, 2, 30, 29, d, d] Row@ReplacePart[Array["_" &, 29], # -> "."] & /@ NestList[f, RandomInteger@29+1, 30] // TableForm 

dot

#Mathematica 157-10-50 = 97

A random number from 1-30 is used for starting. All the remaining column numbers from the dot are chosen via RandomChoice[If[c > 15, {2, 1}, {1, 2}] -> {-1, 1}] + c, which translates to: "If the prior column number was greater than 15, select one number from the set {-1,1}, with -1 weighted 2:1 with respect to 1; otherwise, flip the weights and choose from the same set.

ReplacePart replaces the element in a list of 30 blank spaces that corresponds to the column of interest.

f@c_ := Switch[d = RandomChoice[If[c > 15, {2, 1}, {1, 2}] -> {-1, 1}] + c, 1, 2, 30, 29, d, d] Row@ReplacePart[Array["_" &, 29], # -> "."] & /@ NestList[f, RandomInteger@29+1, 30] // TableForm 

dot

Mathematica 157-10-50 = 97

A random number from 1-30 is used for starting. All the remaining column numbers from the dot are chosen via RandomChoice[If[c > 15, {2, 1}, {1, 2}] -> {-1, 1}] + c, which translates to: "If the prior column number was greater than 15, select one number from the set {-1,1}, with -1 weighted 2:1 with respect to 1; otherwise, flip the weights and choose from the same set.

ReplacePart replaces the element in a list of 30 blank spaces that corresponds to the column of interest.

f@c_ := Switch[d = RandomChoice[If[c > 15, {2, 1}, {1, 2}] -> {-1, 1}] + c, 1, 2, 30, 29, d, d] Row@ReplacePart[Array["_" &, 29], # -> "."] & /@ NestList[f, RandomInteger@29+1, 30] // TableForm 

dot

Explanation given
Source Link
DavidC
  • 25.5k
  • 2
  • 53
  • 106

#Mathematica 160157-10-50 = 10097

I'll explainA random number from 1-30 is used for starting. All the code laterremaining column numbers from the dot are chosen via RandomChoice[If[c > 15, {2, 1}, {1, 2}] -> {-1, 1}] + c, which translates to: "If the prior column number was greater than 15, select one number from the set {-1,1}, with -1 weighted 2:1 with respect to 1; otherwise, flip the weights and choose from the same set.

ReplacePart replaces the element in a list of 30 blank spaces that corresponds to the column of interest.

f@c_ := Switch[d = RandomChoice[If[c > 15, {2, 1}, {1, 2}] -> {-1, 1}] + c, 1, 2, 30, 29, d, d] Row@ReplacePart[Array["_" &, 29], # -> "."] & /@ NestList[f, RandomInteger[{1, 30}]RandomInteger@29+1, 30] // TableForm 

dot

#Mathematica 160-10-50 = 100

I'll explain the code later.

f@c_ := Switch[d = RandomChoice[If[c > 15, {2, 1}, {1, 2}] -> {-1, 1}] + c, 1, 2, 30, 29, d, d] Row@ReplacePart[Array["_" &, 29], # -> "."] & /@ NestList[f, RandomInteger[{1, 30}], 30] // TableForm 

dot

#Mathematica 157-10-50 = 97

A random number from 1-30 is used for starting. All the remaining column numbers from the dot are chosen via RandomChoice[If[c > 15, {2, 1}, {1, 2}] -> {-1, 1}] + c, which translates to: "If the prior column number was greater than 15, select one number from the set {-1,1}, with -1 weighted 2:1 with respect to 1; otherwise, flip the weights and choose from the same set.

ReplacePart replaces the element in a list of 30 blank spaces that corresponds to the column of interest.

f@c_ := Switch[d = RandomChoice[If[c > 15, {2, 1}, {1, 2}] -> {-1, 1}] + c, 1, 2, 30, 29, d, d] Row@ReplacePart[Array["_" &, 29], # -> "."] & /@ NestList[f, RandomInteger@29+1, 30] // TableForm 

dot

Source Link
DavidC
  • 25.5k
  • 2
  • 53
  • 106

#Mathematica 160-10-50 = 100

I'll explain the code later.

f@c_ := Switch[d = RandomChoice[If[c > 15, {2, 1}, {1, 2}] -> {-1, 1}] + c, 1, 2, 30, 29, d, d] Row@ReplacePart[Array["_" &, 29], # -> "."] & /@ NestList[f, RandomInteger[{1, 30}], 30] // TableForm 

dot