x <- c("25", "50", "60", "25")
x2 <- sample(x, 10000, replace = TRUE, prob = NULL)
library(ggplot2)
x2 <- as.data.frame(x2)
ggplot(x2, aes(x=x2)) + geom_bar(fill="blue") + xlab('Values') + ylab('Count')
...
Where is the equal 33% between the three choices? 10,00 samples and it is not there. If it was an equal 1/3 chance the bars should be even, but they are not. — Jeremiah
x <- unique(c("25", "50", "60", "25")) x2 <- sample(x, 10000, replace = TRUE, prob = NULL) library(ggplot2) x2 <- as.data.frame(x2) ggplot(x2, aes(x=x2)) + geom_bar(fill="blue") + xlab('Values') + ylab('Count')
float guess; float answer; float correct; float total; float incorrect; void setup() { correct = 0; total = 0; incorrect=0; } void draw() { guess = floor(random(1, 5)); answer = floor(random(1, 5)); if (answer==guess) { correct +=1; } else if ((answer == 1 && guess == 4)) { correct +=1; } else if ((answer == 4 && guess == 1)) { correct +=1; } else { incorrect +=1; } total +=1; println(correct/total); println(total); println(correct+incorrect); }
Get involved in philosophical discussions about knowledge, truth, language, consciousness, science, politics, religion, logic and mathematics, art, history, and lots more. No ads, no clutter, and very little agreement — just fascinating conversations.