Statistics

Problem Statement for "Carbon14"

Problem Statement

A common way to determine the age of ancient organic artifacts is called Carbon-14 Dating. Carbon-14 is a radioactive isotope of carbon which is found in a relatively constant concentration in all living organisms. Once an organism dies, however, the carbon-14 in the remains of that organism begins to decay, and the concentration of carbon-14 in the remains starts to decrease. Thus, by comparing the concentration of carbon-14 in a neolithic wooden tool, for example, to the concentration typically found in living organisms, we can determine what percentage of the carbon-14 has decayed, and based on this, the age of the tool.

Radioactive isotopes generally decay according to the following function, where e is the base of the natural logarithm (about 2.718281828459045), t is the amount of time that has elapsed since the organism died, and k is a constant that is different for each isotope:
final concentration = initial concentration * (e ^ (- t / k))
In the case of carbon-14, k = 8267, when time is measured in years.

In this problem, you will be given a measurement, concentration, from an ancient artifact representing (final concentration / initial concentration) * 10,000 (so 543 would mean that the ratio of the two concentrations was 0.0543). You will also be given an int, err, indicating how far off this measurement could be. Your task is to determine a lower bound and an upper bound on the age of the artifact (in years). You should return a int[] with two elements. The first element should be the lower bound on the age of the artifact, and the second element should be the upper bound on its age. The lower bound should be rounded down (floor) and the upper bound should be rounded up (ceiling).

For example, if concentration were 5000 and err were 100, then the lower bound on the age of the artifact would come from assuming the true ratio of concentrations was 0.51, and the upper bound on the age of the artifact would come from assuming that the ratio of concentrations was 0.49. For these two concentrations, we get ages of 5566.54 and 5897.26, respectively. Thus we would return {5566, 5898}

Definition

Class:
Carbon14
Method:
dateRange
Parameters:
int, int
Returns:
int[]
Method signature:
int[] dateRange(int concentration, int err)
(be sure your method is public)

Notes

  • Recall that ln(e^x) = x, where ln is the natural logarithm function.

Constraints

  • concentration will be between 1 and 9999, inclusive.
  • err will be between 0, inclusive, and min(concentration, 10000-concentration), exclusive.
  • Neither the lower nor the upper bounds on the age will be within 1e-6 of an integer, prior to rounding.

Examples

  1. 5000

    100

    Returns: { 5566, 5898 }

    The example from the problem statement.

  2. 5000

    0

    Returns: { 5730, 5731 }

    With 0 error, we calculate the age of the artifact as 5730.25 years, giving us a lower bound of 5730 and an upper bound of 5731. For this reason, 5730 years is called the half-life of carbon-14 - after 5730 years, there is half as much of it as there was originally.

  3. 1

    0

    Returns: { 76141, 76142 }

  4. 3456

    18

    Returns: { 8740, 8827 }

  5. 9999

    0

    Returns: { 0, 1 }

  6. 5000

    4999

    Returns: { 0, 76142 }

  7. 527

    93

    Returns: { 22987, 25937 }

  8. 581

    365

    Returns: { 19494, 31705 }

  9. 871

    756

    Returns: { 15011, 36916 }

  10. 1045

    1043

    Returns: { 12949, 70412 }

  11. 1592

    785

    Returns: { 11877, 20809 }

  12. 1696

    1060

    Returns: { 10654, 22777 }

  13. 2178

    404

    Returns: { 11193, 14297 }

  14. 2536

    1805

    Returns: { 6898, 21626 }

  15. 2622

    1749

    Returns: { 6841, 20159 }

  16. 2713

    1182

    Returns: { 7794, 15515 }

  17. 3223

    1244

    Returns: { 6662, 13393 }

  18. 3316

    911

    Returns: { 7118, 11781 }

  19. 3365

    487

    Returns: { 7886, 10297 }

  20. 3519

    139

    Returns: { 8313, 8968 }

  21. 3700

    3192

    Returns: { 3077, 24635 }

  22. 3761

    2031

    Returns: { 4514, 14505 }

  23. 4119

    1019

    Returns: { 5505, 9683 }

  24. 4126

    879

    Returns: { 5721, 9300 }

  25. 4312

    1359

    Returns: { 4689, 10084 }

  26. 4394

    2278

    Returns: { 3345, 12840 }

  27. 4480

    1649

    Returns: { 4047, 10433 }

  28. 4598

    1202

    Returns: { 4503, 8929 }

  29. 4708

    4010

    Returns: { 1134, 22008 }

  30. 4839

    4409

    Returns: { 646, 26013 }

  31. 4950

    4854

    Returns: { 163, 38409 }

  32. 5006

    2047

    Returns: { 2886, 10068 }

  33. 5549

    2640

    Returns: { 1651, 10208 }

  34. 5633

    2981

    Returns: { 1233, 10973 }

  35. 5668

    1038

    Returns: { 3303, 6366 }

  36. 5891

    320

    Returns: { 3937, 4837 }

  37. 5941

    1576

    Returns: { 2359, 6854 }

  38. 6003

    1573

    Returns: { 2294, 6731 }

  39. 6081

    2296

    Returns: { 1464, 8032 }

  40. 6100

    3622

    Returns: { 233, 11534 }

  41. 6236

    275

    Returns: { 3547, 4277 }

  42. 6317

    3234

    Returns: { 379, 9728 }

  43. 6433

    201

    Returns: { 3392, 3910 }

  44. 6825

    2486

    Returns: { 590, 6903 }

  45. 7068

    1805

    Returns: { 988, 5307 }

  46. 7297

    1919

    Returns: { 674, 5128 }

  47. 7328

    1935

    Returns: { 632, 5105 }

  48. 7400

    1749

    Returns: { 735, 4719 }

  49. 7604

    2222

    Returns: { 145, 5122 }

  50. 7875

    1358

    Returns: { 659, 3540 }

  51. 8168

    1010

    Returns: { 709, 2765 }

  52. 8194

    989

    Returns: { 704, 2711 }

  53. 8562

    920

    Returns: { 439, 2224 }

  54. 8633

    116

    Returns: { 1104, 1328 }

  55. 1

    0

    Returns: { 76141, 76142 }


This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2024, TopCoder, Inc. All rights reserved.
This problem was used for: