[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math

Search:


View post   

>> No.5527120 [View]
File: 15 KB, 500x278, monty goat.gif [View same] [iqdb] [saucenao] [google]
5527120

if a and b are positive real numbers

is it always true that |a-b|<|a|

>> No.5465401 [View]
File: 15 KB, 500x278, monty hall.gif [View same] [iqdb] [saucenao] [google]
5465401

What side of the fence do you sit on in regards to the Monty Hall Problem?

>> No.4706282 [View]
File: 15 KB, 500x278, monty.gif [View same] [iqdb] [saucenao] [google]
4706282

The the way the game works is there are 3 doors. 1 has a prize the other 2 goats. You are given your choice of a door and then the host opens one of the remaining two doors to reveal a goat. You are then given the option to keep your door or to switch to the other unopened one. A friend of mine is convinced you should always switch but when he tries to explain why to me he looses me very qucikly. What should you do? Switch ot keep? Or does it matter?

>> No.3712698 [View]
File: 15 KB, 500x278, monty.gif [View same] [iqdb] [saucenao] [google]
[ERROR]

Ha! Joke's on you, I wanted the goat.

>> No.3570967 [View]
File: 15 KB, 500x278, monty[1].gif [View same] [iqdb] [saucenao] [google]
3570967

Hello /sci/.
I'm learning java, and for practice I'm designing a basic program to play the Monty Hall game. Only problem is I'm stuck at selecting the first door to reveal. How would I go about doing this?
Code so far:

import java.util.Scanner;
import java.util.Random;
public class a {
public static void main(String args[]){
int door1[] = new int[2], door2[] = new int[2], door3[] = new int[2], temp1, temp2, finalchoice;
Scanner input = new Scanner(System.in);
Random windoor = new Random();

System.out.println("You have a choice of three doors. Whatever's behind the door you pick will be yours to take home.");
System.out.println("The grand prize tonight is a brand new sports car. Be cautious however, for two of the doors conceal goats.");


temp2 = windoor.nextInt(3);

switch(temp2){

case 0:
door1[0] = temp2;
break;

case 1:
door2[0] = temp2;
break;

case 2:
door3[0] = temp2;
break;
}


System.out.print("Please choose 1, 2 or 3: ");
temp1 = input.nextInt();

switch(temp1){

case 1:
door1[1] = temp1;
break;

case 2:
door2[1] = temp1;
break;

case 3:
door3[1] = temp1;
break;

default:
System.out.println("Stop acting like a dick, and play the game properly.");
break;


}

System.out.print("You have selected door " + temp1);
}
}

>> No.1803262 [View]
File: 15 KB, 500x278, Monty Hall.gif [View same] [iqdb] [saucenao] [google]
1803262

the other child is a goat not a car

Navigation
View posts[+24][+48][+96]