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
Test Suite will round to 6 places
This fails for test case 4 even though it is mathematically correct--it gives 0.27343749999999994 instead of 0.2734375, while the test suite asks for 0.273438; it seems as though a fair test generally has to be of the form abs(y-y_correct)<tol*abs(y_correct); rounding to some number of decimal places always allows for possibilities like this. (Not a complaint, just a point of interest.)
Which values occur exactly three times?
Column norms of a matrix
Whether the input is vector?
Flag largest magnitude swings as they occur
Find: Faster Alternatives for Large Sorted/Unique Vectors
Genome Sequence 002: Introductory DNA Sequencing (Flipped Segments)
GJam 2014 Rd 1c: Reordering Train Cars (Large)
REPMAT Enhancement - Faster for Large Row Replication of Vector
Genome Sequence 003R: Sequence DNA of random positioned and flipped segments
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office