# Understanding Random Behavior

So I was just making a piece for fun, with the idea that I'd build a grid by selecting for each integer pair a random quarter of the circle with radius 1 or edge of a square of width 1. I built an 8 member list, then tried to make a command like

Sequence(Sequence(Translate(RandomElement(l1), (i, j)), i, 1, n), j, 1, n)

It would only select a variety of segments or arcs but never a mix. About half undefined elements. Hmm. So I tried building an nxn matrix of RandomBetween(1,8) and selecting

Sequence(Sequence(Translate(Element(l1, Element(m4, i, j)), (i, j)), i, 1, n), j, 1, n)

with the same result. So I made a list of lists {{arc1, arc2, ...},{seg1,seg2,...}} and

Sequence(Sequence(Translate(RandomElement(RandomElement(l1)), (i, j)), i, 1, n), j, 1, n)

and got the same result.

It doesn't matter because this was just for fun, but can anyone help me understand what's going on?

ps: when I tried translating the whole list to each (i,j) it worked.

It's not a problem of random. It's a problem of addressing the 2 dimensional list.

====================================================

l3 = {{<conic>,....<conic>}, {<segment>, ......<segment>}}

is a 2 dimensional list

.

for circles:

Sequence(Sequence(Translate(RandomElement(Element(l3, 1)), (i, j)), i, 1, n), j, 1, n)

.

for segments

Sequence(Sequence(Translate(RandomElement(Element(l3, 2)), (i, j)), i, 1, n), j, 1, n)

.

Note: circles and segments must be in separated Sequence() because a Sequence() [and also Zip()] can have only 1 object-type as output.

I tried them all in one dimensional list to no avail as a first try. And even as a 2D list, why wouldn't RandomElement(RandomElement(l3)) work to make a mix?

Note my note above.

"RandomElement(RandomElement(l3))" broke the rule in the note.

Not all is documented in GGB; but sure nothing what GGB does when a rule is broken.

I guess that at the time of precompiling (open file?) ggb decides which object type is to apply.

.

Open the attached file (test-version 0) 10 times: after opening one (1) random object type appears, but after each update-construction always the same as before. Also notice the "?" in the generated list l4. I think these are the random elements that broken the rule in my note above.

https://wiki.geogebra.org/e...

So why didn't the random number 1-8 matrix approach work? Do lists have to be all the same type always?

yo creo que lo más simple es crear tres listas: lista de arcos, lista de segmentos, lista de booleanos

entonces se eligen aleatoriamente un arco, un segmento y un booleano para cada punto y se muestra el arco o el segmento segun el valor del booleano

he intentado el truco de Michael y he encontrado un bug en la traslacion de circumcirculararc() definidos a partir de puntos especificados mediante coordenadas dentro de la instruccion

si los puntos dentro del parentesis se especifican mediante coordenadas y no como nombres de puntos la traslacion no es correcta

Fun thread to read - really cool result!

I used parametrics to have your set be all one object type :

https://www.geogebra.org/m/pxu3ddqj

fun is the favorite of mathematicians

Loading...Comments have been locked on this page!