Geração de equações de segundo grau aleatórias com raízes inteiras

DiogoMeurer shared this question 2 years ago
Answered

Estou começando a construir uma atividade, mas quero que as equações geradas tenham soluções inteiras.

Criei uma variável booleana para saber se a raiz é inteira ou não. Utilizei o comando Se(d==false,AtualizarConstrução())

E não obtive êxito.

Alguém sabe como solucionar isso?

Comments (4)

photo
2

polynomial( randombetween(1,8) (x-randombetween(-8,8)) (x-randombetween(-8,8)))

photo
1

Muito obrigado!!Mas esse problema com o Atualizarconstrução() dentro do comando Se() é uma situação que o GeoGebra não reconhece? Até porque tenho outras construções que tinham essa necessidade de atualizar, dada uma condição, e nunca consegui.

photo
2

"d<0" doesn't work for a boolean variable. Use "!d" instead. But that won't solve the real problem, because that check is only done once, but the new construction might again not be "valid". You could possibly force multiple reconstructions via some Update scripts, but better just build the function in a valid way from the start (like mathmagic suggested) instead of relying on numerous reconstructions until you randomly get a valid result.

photo
photo
2

así

Files: foro.ggb
© 2023 International GeoGebra Institute