6 randFromArray([4, 6]) randRange(1, GRID_WIDTH) randRange(1, GRID_HEIGHT) randRange(2, GRID_WIDTH + GRID_HEIGHT) (function() { var pairs = [], i, j; for (i = 1; i <= GRID_WIDTH; i++) { for (j = 1; j <= GRID_HEIGHT; j++) { if (PRED(i, j)) { pairs.push([i, j]); } } } return pairs; })() MATCHING_PAIRS.length GRID_WIDTH * GRID_HEIGHT

You are given two dice to roll. One is black with six sides, the other is white with four sides. You are given two six-sided dice to roll.

If it helps, you may select the matching outcomes below. Your selections aren't checked with your answer:

0 of SOLUTION_D selected
Khan.scratchpad.disable(); // Set .e-grid size. $('.e-grid').addClass('e-six-by-' + (GRID_HEIGHT === 6 ? 'six' : 'four')); // Toggle cell selection on click. var selected = $('#e-selected-count'); $('.e-dice').on('click', function() { $(this).toggleClass('e-selected'); selected.text($('.e-selected').length); });
SOLUTION_N / SOLUTION_D

There is cardinalThrough20(SOLUTION_N) matching outcome.

There are cardinalThrough20(SOLUTION_N) matching outcomes.

selectMatching(MATCHING_PAIRS);

The probability is the number of matching outcomes divided by all possible outcomes.

The probability is fraction(SOLUTION_N, SOLUTION_D), which reduces to fractionReduce(SOLUTION_N, SOLUTION_D).

The probability is fractionReduce(SOLUTION_N, SOLUTION_D).

function(x, y) { return (x === X && y === Y || x === Y && y === X); }
For a given roll, what is the probability that the dice are X and Y in any order? For a given roll, what is the probability that the dice are X and Y? For a given roll, what is the probability that the dice are both equal to X?
rand(2) function(x, y) { return x % 2 !== EVEN && y === Y; }
For a given roll, what is the probability that the black die is even and the white die is Y? For a given roll, what is the probability that the black die is odd and the white die is Y?

How many matching outcomes are there with an even number on the black die and Y on the white die?

How many matching outcomes are there with an odd number on the black die and Y on the white die?

function(x, y) { return x + y === Z; }
For a given roll, what is the probability that the dice add to Z?

For each value on the black die, is there a value on the white die that adds to Z?

function(x, y) { return x + y <= Z; }
For a given roll, what is the probability that the dice add to Z or less?

Count all outcomes that are less than or equal to Z.

function(x, y) { return x === y; }
For a given roll, what is the probability you roll the same number on each die?
function(x, y) { return x === X && y === Y; }
For a given roll, what is the probability the black die is X and the white die is Y?
function(x, y) { return x === X || y === X; }
For a given roll, what is the probability at least one die is X?

Remember that both dice can be X ("at least one").