Schema della sezione

  • 9 Ottobre 18


    Sommatorie e prodotti.


    # -------------------------

    porta<-c("sx","centro","destra")
    ESITO<-c()

    R<-250000

    for (i in 1:R){

    premio<-sample(porta)[1]
    scelta<-sample(porta)[1]
    apertaHall<-sample(porta[which(porta!=scelta & porta!=premio)])[1]
    cambioporta<-sample(porta[which(porta!=scelta & porta!=apertaHall)])[1]
    if(scelta==premio)ESITO<-c(ESITO,"VINTO PRIMA SCELTA")
    if(cambioporta==premio)ESITO<-c(ESITO,"CAMBIO VINTO")

    }

    ESITO
    round(table(ESITO)/R*100,1)