Cody

Problem 1159. Coin Tossing: Probability of Same Heads for N tosses

A pair of physicists toss a coin n times each.

What is the probability that they tossed the same number of heads?

Input: N % number of tosses

Output: P

Examples:

N=1 P=0.5;

N=2 P=0.375

Test Suite will round to 6 places

Solution Stats

71.43% Correct | 28.57% Incorrect
Last solution submitted on Apr 24, 2016

Solution Comments

Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!

Join the 15-year community celebration.

Play games and win prizes!

Learn more