Downloaded 0721 questions

This commit is contained in:
Federico Pizzari 2022-11-15 14:27:16 +01:00
parent eb8ea2909c
commit 935d4532aa
162 changed files with 1435 additions and 2 deletions

18
0721_26/correct.txt Normal file
View file

@ -0,0 +1,18 @@
block MarkovChain
//external function myrandom() returns a random real number in [0, 1]
parameter Integer x0 = 0;
parameter Integer xmax = 100;
OutputInteger x; // Connector
algorithm
when initial() then
x := x0;
elsewhen sample(0, 1) then
if (x < xmax)
then
if (myrandom() <= 0.8)
then
x := x + 1;
end if;
end if;
end when;
end MarkovChain;

4
0721_26/quest.txt Normal file
View file

@ -0,0 +1,4 @@
Un'azienda decide di organizzare il processo di sviluppo di un grosso software in 101 phasi sequenziali, numerate da 0 a 100. La phase 0 è quella iniziale. La phase 100 è quella finale in cui lo sviluppo è completato. Tutte le fasi hanno circa la stessa durata.
Si decide di realizzare un approccio incrementale in cui, alla fine di ogni fase, si passa alla fase successiva solo nel caso in cui tutti i test per la fase vengono superati. In caso contrario bisogna ripetere la phase. Dai dati storici è noto che la probabilità che il team di sviluppo passi da una fase a quella successiva è 0.8.
Allo scopo di stimare attraverso una simulazione MonteCarlo il valore atteso del tempo di completamento del progetto viene realizzato un modello Modelica delo processo di sviluppo descritto sopra.
Quale dei seguenti modelli Modelica modella correttamente il processo di sviluppo descritto sopra?

18
0721_26/wrong1.txt Normal file
View file

@ -0,0 +1,18 @@
block MarkovChain
//external function myrandom() returns a random real number in [0, 1]
parameter Integer x0 = 0;
parameter Integer xmax = 100;
OutputInteger x; // Connector
algorithm
when initial() then
x := x0;
elsewhen sample(0, 1) then
if (x < xmax)
then
if (myrandom() >= 0.8)
then
x := x + 1;
end if;
end if;
end when;
end MarkovChain;

20
0721_26/wrong2.txt Normal file
View file

@ -0,0 +1,20 @@
block MarkovChain
//external function myrandom() returns a random real number in [0, 1]
parameter Integer x0 = 0;
parameter Integer xmax = 100;
OutputInteger x; // Connector
algorithm
when initial() then
x := x0;
elsewhen sample(0, 1) then
if (x < xmax)
then
if (myrandom() <= 0.8)
then
x := x + 1;
else
x := x - 1;
end if;
end if;
end when;
end MarkovChain;