invincible.om
BAN USERNope, dc360. They want to know your approach. Its a test of how simply you can understand a given problem with only that much info.
The approach is - pick up 1 ball from each jars. If you do this, the chances that you have a red ball is 100%. 100% is greater than 50%.
It can't get simpler than this. Every problem should not be just solved with textual mathematical knowledge :)
Take one ball from each Jar. If you do this approach, you will definitely get a Red ball.
Definitely getting something means Probability is one (1). 1 > 1/2. Simple
In JavaScript, this might be the way
function getMetheOutput(n) {
var string = '';
for (var i = 1; i <= n; i++) {
string += i + '';
for (var j = 2; j <= i; j++ ) {
string += '*' + i;
}
string += ' + ';
}
console.log(string); // alert if you wish
}
Nope, dc360. They want to know your approach. Its a test of how simply you can understand a given problem with only that much info.
- invincible.om September 09, 2012The approach is - pick up 1 ball from each jars. If you do this, the chances that you have a red ball is 100%. 100% is greater than 50%.
It can't get simpler than this. Every problem should not be just solved with textual mathematical knowledge.