Download test.jsonl from RegalFire/Scientific-Answer-Ranking: direct link, hf CLI and curl.
- Browser
- Download file 364 kB
-
https://huggingface.co/datasets/RegalFire/Scientific-Answer-Ranking/resolve/main/test.jsonl
- Command line
-
hf download hf://datasets/RegalFire/Scientific-Answer-Ranking/test.jsonl
-
curl -L -o test.jsonl https://huggingface.co/datasets/RegalFire/Scientific-Answer-Ranking/resolve/main/test.jsonl
364 kB
| {"accepted_status": [false, false], "candidate_answers": [{"answer_html": "<p>Depending on how accurate you want the result to be. At least there are two straight approaches. Both the following are per stat incremental over all samples - say, damage as you mentioned.</p>\n<ol>\n<li><strong>Exact sort</strong></li>\n</ol>\n<p>This is the simplest and most straightforward way: store all values, sort them once, and then percentile retrieval is essentially an array-index lookup. For <span class=\"math-container\">$N$</span> values, storage is <span class=\"math-container\">$O(N)$</span>, building time is <span class=\"math-container\">$O(N \\log N)$</span> because of sorting, and percentile retrieval is <span class=\"math-container\">$O(1)$</span> if you use the sorted array directly. The important downside is that when new values are continuously added, you need to re-sort periodically (<span class=\"math-container\">$O(N \\log N)$</span>), or to maintain an ordered data structure (binary search tree), which makes each insertion roughly <span class=\"math-container\">$O(\\log N)$</span>.</p>\n<ol start=\"2\">\n<li><strong>Histogram</strong></li>\n</ol>\n<p>A histogram avoids storing every individual value: divide the possible value range into <span class=\"math-container\">$B$</span> bins and only store the count in each bin. Storage is <span class=\"math-container\">$O(B)$</span>, building/updating time is <span class=\"math-container\">$O(N)$</span> for <span class=\"math-container\">$N$</span> incoming values (actually <span class=\"math-container\">$O(1)$</span> per value), and percentile retrieval is <span class=\"math-container\">$O(B)$</span> with a simple cumulative scan, or <span class=\"math-container\">$O(\\log B)$</span> if you maintain cumulative counts appropriately (e.g., a <em><strong>fixed</strong></em> binary search tree). The tradeoff is that the result is approximate, and accuracy depends on how the bins are chosen. But here you are not assuming a normal distribution; the histogram approach makes no distribution shape assumption. It's a non-parametric approach.</p>\n", "answer_id": 677203, "answer_text": "Depending on how accurate you want the result to be. At least there are two straight approaches. Both the following are per stat incremental over all samples - say, damage as you mentioned.\n\n\n\n\n\nExact sort\n\n\n\n\n\nThis is the simplest and most straightforward way: store all values, sort them once, and then percentile retrieval is essentially an array-index lookup. For $N$ values, storage is $O(N)$, building time is $O(N \\log N)$ because of sorting, and percentile retrieval is $O(1)$ if you use the sorted array directly. The important downside is that when new values are continuously added, you need to re-sort periodically ($O(N \\log N)$), or to maintain an ordered data structure (binary search tree), which makes each insertion roughly $O(\\log N)$.\n\n\n\n\n\nHistogram\n\n\n\n\n\nA histogram avoids storing every individual value: divide the possible value range into $B$ bins and only store the count in each bin. Storage is $O(B)$, building/updating time is $O(N)$ for $N$ incoming values (actually $O(1)$ per value), and percentile retrieval is $O(B)$ with a simple cumulative scan, or $O(\\log B)$ if you maintain cumulative counts appropriately (e.g., a fixed binary search tree). The tradeoff is that the result is approximate, and accuracy depends on how the bins are chosen. But here you are not assuming a normal distribution; the histogram approach makes no distribution shape assumption. It's a non-parametric approach.", "answer_url": "https://stats.stackexchange.com/a/677203", "author": "J. Doe", "author_url": "https://stats.stackexchange.com/users/289647/j-doe", "author_user_type": "registered", "content_license": "CC BY-SA 4.0", "created_at": "2026-09-18T04:59:04+00:00", "is_accepted": false, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:27:08.569053+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/ba8a114171cbec551f0a7f4b9f04e95c559131a62357d51e159434d4acc7183d_1790825228829630100_0.json", "raw_sha256": "a03822ca860dd0b0fb0cc402754ae4cdbaad51d18873dfd19aed56ffe1cf7ec8", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/questions/677298;677295;677280;677279;677278;677275;677269;677266;677262;677256;677245;677243;677242;677226;677225;677217;677211;677201;677194;677193;677186;677183;677179;677177;677171;677169;677168;677151;677149;677147;677137;677135;677131;677129;677115;677110;677109;677101;677099;677098;677096;677095;677094;677085;677083;677079;677078;677075;677071;677066;677065;677062;677058;677045;677041;677035;677033;677023;677021;676999;676997;676991;676982;676981;676979;676977;676975;676971;676966;676961;676958;676956;676952;676947;676945;676937;676935;676933;676924;676922;676899;676898;676893;676889;676888;676879;676874;676873;676870;676867;676865;676858;676855;676850;676842;676832;676830;676824;676823;676821/answers?filter=withbody&order=asc&page=2&pagesize=100&site=stats&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_id": 677201, "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "J. Doe", "profile_url": "https://stats.stackexchange.com/users/289647/j-doe", "user_type": "registered"}, "created_at": "2026-09-18T04:59:04+00:00", "raw_file": "raw/codex_api_v1/13b5f879587b71b34c0837bee317816dcd540d0ad5983f88cf56c19d10104c79_1790825261079646600_0.json", "raw_sha256": "0a63637f2455a28a1e691dd3090d34ef9975e6c8bdc2c5c883414d7215eb5972", "revision_guid": "6D94553A-9020-42A1-B486-1E43A3AE556B", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://stats.stackexchange.com/revisions/6D94553A-9020-42A1-B486-1E43A3AE556B/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "J. Doe", "profile_url": "https://stats.stackexchange.com/users/289647/j-doe", "user_type": "registered"}, "created_at": "2026-09-18T05:04:10+00:00", "raw_file": "raw/codex_api_v1/13b5f879587b71b34c0837bee317816dcd540d0ad5983f88cf56c19d10104c79_1790825261079646600_0.json", "raw_sha256": "0a63637f2455a28a1e691dd3090d34ef9975e6c8bdc2c5c883414d7215eb5972", "revision_guid": "420CE9DF-3FEB-4529-BED4-B15BFCCC362F", "revision_number": 2, "revision_type": "single_user", "revision_url": "https://stats.stackexchange.com/revisions/420CE9DF-3FEB-4529-BED4-B15BFCCC362F/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Nick Cox", "profile_url": "https://stats.stackexchange.com/users/22047/nick-cox", "user_type": "registered"}, "created_at": "2026-09-25T07:21:46+00:00", "raw_file": "raw/codex_api_v1/ab5f4cd7f0a10bde5970354a9b213efcc81e232042487437e8579705d4ca6a20_1790825258916612700_0.json", "raw_sha256": "4cf167c399d03b9ae013b65260fcb4e38139c42cfc70aba4807f070550c1768e", "revision_guid": "DE49DAB7-B2D2-4D9B-B972-BF216D135688", "revision_number": 3, "revision_type": "single_user", "revision_url": "https://stats.stackexchange.com/revisions/DE49DAB7-B2D2-4D9B-B972-BF216D135688/view-source"}], "score": 4, "updated_at": "2026-09-25T07:21:46+00:00"}, {"answer_html": "<p>You can take a sample to get a decent estimate.</p>\n", "answer_id": 677259, "answer_text": "You can take a sample to get a decent estimate.", "answer_url": "https://stats.stackexchange.com/a/677259", "author": "Yossi Levy", "author_url": "https://stats.stackexchange.com/users/183735/yossi-levy", "author_user_type": "registered", "content_license": "CC BY-SA 4.0", "created_at": "2026-09-25T07:06:59+00:00", "is_accepted": false, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:27:08.569053+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/ba8a114171cbec551f0a7f4b9f04e95c559131a62357d51e159434d4acc7183d_1790825228829630100_0.json", "raw_sha256": "a03822ca860dd0b0fb0cc402754ae4cdbaad51d18873dfd19aed56ffe1cf7ec8", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/questions/677298;677295;677280;677279;677278;677275;677269;677266;677262;677256;677245;677243;677242;677226;677225;677217;677211;677201;677194;677193;677186;677183;677179;677177;677171;677169;677168;677151;677149;677147;677137;677135;677131;677129;677115;677110;677109;677101;677099;677098;677096;677095;677094;677085;677083;677079;677078;677075;677071;677066;677065;677062;677058;677045;677041;677035;677033;677023;677021;676999;676997;676991;676982;676981;676979;676977;676975;676971;676966;676961;676958;676956;676952;676947;676945;676937;676935;676933;676924;676922;676899;676898;676893;676889;676888;676879;676874;676873;676870;676867;676865;676858;676855;676850;676842;676832;676830;676824;676823;676821/answers?filter=withbody&order=asc&page=2&pagesize=100&site=stats&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_id": 677201, "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Yossi Levy", "profile_url": "https://stats.stackexchange.com/users/183735/yossi-levy", "user_type": "registered"}, "created_at": "2026-09-25T07:06:59+00:00", "raw_file": "raw/codex_api_v1/ab5f4cd7f0a10bde5970354a9b213efcc81e232042487437e8579705d4ca6a20_1790825258916612700_0.json", "raw_sha256": "4cf167c399d03b9ae013b65260fcb4e38139c42cfc70aba4807f070550c1768e", "revision_guid": "BC514043-68C0-45FC-8E73-43A04AE28F35", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://stats.stackexchange.com/revisions/BC514043-68C0-45FC-8E73-43A04AE28F35/view-source"}, {"content_license": null, "contributor": {"display_name": "whuber", "profile_url": "https://stats.stackexchange.com/users/919/whuber", "user_type": "moderator"}, "created_at": "2026-09-25T13:33:38+00:00", "raw_file": "raw/codex_api_v1/ab5f4cd7f0a10bde5970354a9b213efcc81e232042487437e8579705d4ca6a20_1790825258916612700_0.json", "raw_sha256": "4cf167c399d03b9ae013b65260fcb4e38139c42cfc70aba4807f070550c1768e", "revision_guid": "F88E62B3-141E-44BE-B4C2-8A7F08D22261", "revision_number": null, "revision_type": "vote_based", "revision_url": "https://stats.stackexchange.com/revisions/F88E62B3-141E-44BE-B4C2-8A7F08D22261/view-source"}], "score": 0, "updated_at": "2026-09-25T07:06:59+00:00"}], "ground_truth": "community signals only; no scientific truth label", "product": "ranking", "question": "I've a database that stores multiple values of performance stats for thousands and millions of players in a certain game, over 10s of millions of matches, the game follows a system of episodes/acts, and players have ranks.\n\n\n\n\nI want to be able to answer questions like for a certain stat of the player in a match, how does it compare to others of the same rank (or in general sometimes) in the same episode/act, and sometimes I want to compare the average of said stat over the player's entire matches, to the averages of others over their entire matches, and so on.\n\n\n\n\nfor that one of the best ways to present it is percentile, for example let's say we have a stat called damage per round, saying top 1% percentile would give the player a clear indicator that their damage per round is top notch, and so on.\n\n\n\n\nThe problem is that I don't know of a cheap way to calculate that, since I'm not good at mathematics, but I'd imagine that maybe there's a way while importing players' matches into our database, to some what calculate & update some statistical data that could answer that cheaply? instead of having to go over a lot of player's data to answer that? I imagine if the stats follow a normal distribution it might be easy, but what if it doesn't for one reason or another, and how do I even verify if it does? and is there a way to incrementally calculate/update them incrementally\n\n\n\n\nps: sorry if the phrasing of the question is messed up, Idk how else to phrase it", "record_id": "Scientific-Answer-Ranking:stats:677201", "scores": [4, 0], "split": "test", "thread": {"accepted_answer_id": null, "answers": [{"answer_html": "<p>Depending on how accurate you want the result to be. At least there are two straight approaches. Both the following are per stat incremental over all samples - say, damage as you mentioned.</p>\n<ol>\n<li><strong>Exact sort</strong></li>\n</ol>\n<p>This is the simplest and most straightforward way: store all values, sort them once, and then percentile retrieval is essentially an array-index lookup. For <span class=\"math-container\">$N$</span> values, storage is <span class=\"math-container\">$O(N)$</span>, building time is <span class=\"math-container\">$O(N \\log N)$</span> because of sorting, and percentile retrieval is <span class=\"math-container\">$O(1)$</span> if you use the sorted array directly. The important downside is that when new values are continuously added, you need to re-sort periodically (<span class=\"math-container\">$O(N \\log N)$</span>), or to maintain an ordered data structure (binary search tree), which makes each insertion roughly <span class=\"math-container\">$O(\\log N)$</span>.</p>\n<ol start=\"2\">\n<li><strong>Histogram</strong></li>\n</ol>\n<p>A histogram avoids storing every individual value: divide the possible value range into <span class=\"math-container\">$B$</span> bins and only store the count in each bin. Storage is <span class=\"math-container\">$O(B)$</span>, building/updating time is <span class=\"math-container\">$O(N)$</span> for <span class=\"math-container\">$N$</span> incoming values (actually <span class=\"math-container\">$O(1)$</span> per value), and percentile retrieval is <span class=\"math-container\">$O(B)$</span> with a simple cumulative scan, or <span class=\"math-container\">$O(\\log B)$</span> if you maintain cumulative counts appropriately (e.g., a <em><strong>fixed</strong></em> binary search tree). The tradeoff is that the result is approximate, and accuracy depends on how the bins are chosen. But here you are not assuming a normal distribution; the histogram approach makes no distribution shape assumption. It's a non-parametric approach.</p>\n", "answer_id": 677203, "answer_text": "Depending on how accurate you want the result to be. At least there are two straight approaches. Both the following are per stat incremental over all samples - say, damage as you mentioned.\n\n\n\n\n\nExact sort\n\n\n\n\n\nThis is the simplest and most straightforward way: store all values, sort them once, and then percentile retrieval is essentially an array-index lookup. For $N$ values, storage is $O(N)$, building time is $O(N \\log N)$ because of sorting, and percentile retrieval is $O(1)$ if you use the sorted array directly. The important downside is that when new values are continuously added, you need to re-sort periodically ($O(N \\log N)$), or to maintain an ordered data structure (binary search tree), which makes each insertion roughly $O(\\log N)$.\n\n\n\n\n\nHistogram\n\n\n\n\n\nA histogram avoids storing every individual value: divide the possible value range into $B$ bins and only store the count in each bin. Storage is $O(B)$, building/updating time is $O(N)$ for $N$ incoming values (actually $O(1)$ per value), and percentile retrieval is $O(B)$ with a simple cumulative scan, or $O(\\log B)$ if you maintain cumulative counts appropriately (e.g., a fixed binary search tree). The tradeoff is that the result is approximate, and accuracy depends on how the bins are chosen. But here you are not assuming a normal distribution; the histogram approach makes no distribution shape assumption. It's a non-parametric approach.", "answer_url": "https://stats.stackexchange.com/a/677203", "author": "J. Doe", "author_url": "https://stats.stackexchange.com/users/289647/j-doe", "author_user_type": "registered", "content_license": "CC BY-SA 4.0", "created_at": "2026-09-18T04:59:04+00:00", "is_accepted": false, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:27:08.569053+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/ba8a114171cbec551f0a7f4b9f04e95c559131a62357d51e159434d4acc7183d_1790825228829630100_0.json", "raw_sha256": "a03822ca860dd0b0fb0cc402754ae4cdbaad51d18873dfd19aed56ffe1cf7ec8", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/questions/677298;677295;677280;677279;677278;677275;677269;677266;677262;677256;677245;677243;677242;677226;677225;677217;677211;677201;677194;677193;677186;677183;677179;677177;677171;677169;677168;677151;677149;677147;677137;677135;677131;677129;677115;677110;677109;677101;677099;677098;677096;677095;677094;677085;677083;677079;677078;677075;677071;677066;677065;677062;677058;677045;677041;677035;677033;677023;677021;676999;676997;676991;676982;676981;676979;676977;676975;676971;676966;676961;676958;676956;676952;676947;676945;676937;676935;676933;676924;676922;676899;676898;676893;676889;676888;676879;676874;676873;676870;676867;676865;676858;676855;676850;676842;676832;676830;676824;676823;676821/answers?filter=withbody&order=asc&page=2&pagesize=100&site=stats&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_id": 677201, "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "J. Doe", "profile_url": "https://stats.stackexchange.com/users/289647/j-doe", "user_type": "registered"}, "created_at": "2026-09-18T04:59:04+00:00", "raw_file": "raw/codex_api_v1/13b5f879587b71b34c0837bee317816dcd540d0ad5983f88cf56c19d10104c79_1790825261079646600_0.json", "raw_sha256": "0a63637f2455a28a1e691dd3090d34ef9975e6c8bdc2c5c883414d7215eb5972", "revision_guid": "6D94553A-9020-42A1-B486-1E43A3AE556B", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://stats.stackexchange.com/revisions/6D94553A-9020-42A1-B486-1E43A3AE556B/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "J. Doe", "profile_url": "https://stats.stackexchange.com/users/289647/j-doe", "user_type": "registered"}, "created_at": "2026-09-18T05:04:10+00:00", "raw_file": "raw/codex_api_v1/13b5f879587b71b34c0837bee317816dcd540d0ad5983f88cf56c19d10104c79_1790825261079646600_0.json", "raw_sha256": "0a63637f2455a28a1e691dd3090d34ef9975e6c8bdc2c5c883414d7215eb5972", "revision_guid": "420CE9DF-3FEB-4529-BED4-B15BFCCC362F", "revision_number": 2, "revision_type": "single_user", "revision_url": "https://stats.stackexchange.com/revisions/420CE9DF-3FEB-4529-BED4-B15BFCCC362F/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Nick Cox", "profile_url": "https://stats.stackexchange.com/users/22047/nick-cox", "user_type": "registered"}, "created_at": "2026-09-25T07:21:46+00:00", "raw_file": "raw/codex_api_v1/ab5f4cd7f0a10bde5970354a9b213efcc81e232042487437e8579705d4ca6a20_1790825258916612700_0.json", "raw_sha256": "4cf167c399d03b9ae013b65260fcb4e38139c42cfc70aba4807f070550c1768e", "revision_guid": "DE49DAB7-B2D2-4D9B-B972-BF216D135688", "revision_number": 3, "revision_type": "single_user", "revision_url": "https://stats.stackexchange.com/revisions/DE49DAB7-B2D2-4D9B-B972-BF216D135688/view-source"}], "score": 4, "updated_at": "2026-09-25T07:21:46+00:00"}, {"answer_html": "<p>You can take a sample to get a decent estimate.</p>\n", "answer_id": 677259, "answer_text": "You can take a sample to get a decent estimate.", "answer_url": "https://stats.stackexchange.com/a/677259", "author": "Yossi Levy", "author_url": "https://stats.stackexchange.com/users/183735/yossi-levy", "author_user_type": "registered", "content_license": "CC BY-SA 4.0", "created_at": "2026-09-25T07:06:59+00:00", "is_accepted": false, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:27:08.569053+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/ba8a114171cbec551f0a7f4b9f04e95c559131a62357d51e159434d4acc7183d_1790825228829630100_0.json", "raw_sha256": "a03822ca860dd0b0fb0cc402754ae4cdbaad51d18873dfd19aed56ffe1cf7ec8", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/questions/677298;677295;677280;677279;677278;677275;677269;677266;677262;677256;677245;677243;677242;677226;677225;677217;677211;677201;677194;677193;677186;677183;677179;677177;677171;677169;677168;677151;677149;677147;677137;677135;677131;677129;677115;677110;677109;677101;677099;677098;677096;677095;677094;677085;677083;677079;677078;677075;677071;677066;677065;677062;677058;677045;677041;677035;677033;677023;677021;676999;676997;676991;676982;676981;676979;676977;676975;676971;676966;676961;676958;676956;676952;676947;676945;676937;676935;676933;676924;676922;676899;676898;676893;676889;676888;676879;676874;676873;676870;676867;676865;676858;676855;676850;676842;676832;676830;676824;676823;676821/answers?filter=withbody&order=asc&page=2&pagesize=100&site=stats&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_id": 677201, "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Yossi Levy", "profile_url": "https://stats.stackexchange.com/users/183735/yossi-levy", "user_type": "registered"}, "created_at": "2026-09-25T07:06:59+00:00", "raw_file": "raw/codex_api_v1/ab5f4cd7f0a10bde5970354a9b213efcc81e232042487437e8579705d4ca6a20_1790825258916612700_0.json", "raw_sha256": "4cf167c399d03b9ae013b65260fcb4e38139c42cfc70aba4807f070550c1768e", "revision_guid": "BC514043-68C0-45FC-8E73-43A04AE28F35", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://stats.stackexchange.com/revisions/BC514043-68C0-45FC-8E73-43A04AE28F35/view-source"}, {"content_license": null, "contributor": {"display_name": "whuber", "profile_url": "https://stats.stackexchange.com/users/919/whuber", "user_type": "moderator"}, "created_at": "2026-09-25T13:33:38+00:00", "raw_file": "raw/codex_api_v1/ab5f4cd7f0a10bde5970354a9b213efcc81e232042487437e8579705d4ca6a20_1790825258916612700_0.json", "raw_sha256": "4cf167c399d03b9ae013b65260fcb4e38139c42cfc70aba4807f070550c1768e", "revision_guid": "F88E62B3-141E-44BE-B4C2-8A7F08D22261", "revision_number": null, "revision_type": "vote_based", "revision_url": "https://stats.stackexchange.com/revisions/F88E62B3-141E-44BE-B4C2-8A7F08D22261/view-source"}], "score": 0, "updated_at": "2026-09-25T07:06:59+00:00"}], "domain": "statistics", "external_links": [], "medical_sensitive": false, "patient_specific": false, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:27:03.428408+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/774052c18cd9e8fa951e893347bfa3c1a85e743fc46ec4667572002cadb10cbf_1790825224163423600_0.json", "raw_sha256": "fe4dd06d3de6c0b1bb33ba88aee0ed4284118e01f76a58dcdce220a4946329b2", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/search/advanced?answers=1&filter=withbody&order=desc&page=1&pagesize=100&site=stats&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_author": "HauntedMansion", "question_author_url": "https://stats.stackexchange.com/users/516799/hauntedmansion", "question_author_user_type": "unregistered", "question_created_at": "2026-09-18T02:53:20+00:00", "question_html": "<p>I've a database that stores multiple values of performance stats for thousands and millions of players in a certain game, over 10s of millions of matches, the game follows a system of episodes/acts, and players have ranks.</p>\n<p>I want to be able to answer questions like for a certain stat of the player in a match, how does it compare to others of the same rank (or in general sometimes) in the same episode/act, and sometimes I want to compare the average of said stat over the player's entire matches, to the averages of others over their entire matches, and so on.</p>\n<p>for that one of the best ways to present it is percentile, for example let's say we have a stat called damage per round, saying top 1% percentile would give the player a clear indicator that their damage per round is top notch, and so on.</p>\n<p>The problem is that I don't know of a cheap way to calculate that, since I'm not good at mathematics, but I'd imagine that maybe there's a way while importing players' matches into our database, to some what calculate & update some statistical data that could answer that cheaply? instead of having to go over a lot of player's data to answer that? I imagine if the stats follow a normal distribution it might be easy, but what if it doesn't for one reason or another, and how do I even verify if it does? and is there a way to incrementally calculate/update them incrementally</p>\n<p>ps: sorry if the phrasing of the question is messed up, Idk how else to phrase it</p>\n", "question_id": 677201, "question_license": "CC BY-SA 4.0", "question_score": 3, "question_text": "I've a database that stores multiple values of performance stats for thousands and millions of players in a certain game, over 10s of millions of matches, the game follows a system of episodes/acts, and players have ranks.\n\n\n\n\nI want to be able to answer questions like for a certain stat of the player in a match, how does it compare to others of the same rank (or in general sometimes) in the same episode/act, and sometimes I want to compare the average of said stat over the player's entire matches, to the averages of others over their entire matches, and so on.\n\n\n\n\nfor that one of the best ways to present it is percentile, for example let's say we have a stat called damage per round, saying top 1% percentile would give the player a clear indicator that their damage per round is top notch, and so on.\n\n\n\n\nThe problem is that I don't know of a cheap way to calculate that, since I'm not good at mathematics, but I'd imagine that maybe there's a way while importing players' matches into our database, to some what calculate & update some statistical data that could answer that cheaply? instead of having to go over a lot of player's data to answer that? I imagine if the stats follow a normal distribution it might be easy, but what if it doesn't for one reason or another, and how do I even verify if it does? and is there a way to incrementally calculate/update them incrementally\n\n\n\n\nps: sorry if the phrasing of the question is messed up, Idk how else to phrase it", "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "HauntedMansion", "profile_url": "https://stats.stackexchange.com/users/516799/hauntedmansion", "user_type": "unregistered"}, "created_at": "2026-09-18T02:53:20+00:00", "raw_file": "raw/codex_api_v1/13b5f879587b71b34c0837bee317816dcd540d0ad5983f88cf56c19d10104c79_1790825261079646600_0.json", "raw_sha256": "0a63637f2455a28a1e691dd3090d34ef9975e6c8bdc2c5c883414d7215eb5972", "revision_guid": "0BFF647A-80FA-4820-B7A7-E1A9456A7D2B", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://stats.stackexchange.com/revisions/0BFF647A-80FA-4820-B7A7-E1A9456A7D2B/view-source"}, {"content_license": null, "contributor": {"display_name": "[deleted/unavailable user]", "profile_url": null, "user_type": "does_not_exist"}, "created_at": "2026-09-18T10:54:55+00:00", "raw_file": "raw/codex_api_v1/13b5f879587b71b34c0837bee317816dcd540d0ad5983f88cf56c19d10104c79_1790825261079646600_0.json", "raw_sha256": "0a63637f2455a28a1e691dd3090d34ef9975e6c8bdc2c5c883414d7215eb5972", "revision_guid": "87F84BB2-7808-4DE2-B278-EADB7B565808", "revision_number": null, "revision_type": "vote_based", "revision_url": "https://stats.stackexchange.com/revisions/87F84BB2-7808-4DE2-B278-EADB7B565808/view-source"}], "source_site": "stats", "source_url": "https://stats.stackexchange.com/questions/677201/is-there-a-way-to-calculate-the-percentiles-cheaply-without-enumeratine-values-o", "split": "test", "split_group": "8c3c53e9665c565323785a03f1fb4ba9ffaf6c9ecb63d8cea543d3897fd51d0a", "tags": ["distributions", "normal-distribution", "standard-deviation", "percentage"], "thread_id": "stats:677201", "title": "is there a way to calculate the percentiles cheaply without enumeratine values of the entire population (check body for details)"}} | |
| {"accepted_status": [false, true], "candidate_answers": [{"answer_html": "<p>The fourier transform assumes that the domain is infinite. In a finite domain the periodicity is only given for the symmetric cosine part of the base. The cosine function is symmetric around 0. The sine function is only for certain frequencies!</p>\n<p>If you want to create a usefull base in a finite cell, then maybe the cosine transform is the way to go and not the fourier base. <a href=\"https://en.wikipedia.org/wiki/Discrete_cosine_transform\" rel=\"nofollow noreferrer\">cosine transform</a></p>\n<p>edit:\n<strong>I think I was wrong on this</strong>. It might be possible although i am not sure about the continuities at the borders of the cell.</p>\n", "answer_id": 45286, "answer_text": "The fourier transform assumes that the domain is infinite. In a finite domain the periodicity is only given for the symmetric cosine part of the base. The cosine function is symmetric around 0. The sine function is only for certain frequencies!\n\n\n\n\nIf you want to create a usefull base in a finite cell, then maybe the cosine transform is the way to go and not the fourier base. cosine transform (https://en.wikipedia.org/wiki/Discrete_cosine_transform)\n\n\n\n\nedit:\nI think I was wrong on this. It might be possible although i am not sure about the continuities at the borders of the cell.", "answer_url": "https://scicomp.stackexchange.com/a/45286", "author": "MPIchael", "author_url": "https://scicomp.stackexchange.com/users/28636/mpichael", "author_user_type": "registered", "content_license": "CC BY-SA 4.0", "created_at": "2025-11-21T06:31:22+00:00", "is_accepted": false, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:28:47.033952+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/cb6e5f564c84a92c4e121c0637c99292018f8935652e423630f2001099a2410f_1790825327386675300_0.json", "raw_sha256": "1a957289f56621bebd21cb45dd99baaedb2c3bc11cb28d700558e4bbcaa19695", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/questions/45545;45541;45538;45533;45532;45530;45523;45513;45510;45507;45499;45493;45488;45487;45479;45474;45472;45463;45461;45447;45444;45436;45428;45425;45424;45423;45422;45416;45414;45410;45404;45401;45396;45391;45389;45387;45380;45377;45376;45375;45369;45366;45365;45363;45362;45359;45350;45347;45344;45336;45334;45331;45326;45322;45316;45313;45311;45309;45305;45302;45300;45291;45289;45285;45276;45269;45263;45262;45261;45253;45247;45246;45238;45236;45230;45229;45208;45201;45200;45185;45183;45171;45167;45165;45158;45154;45146;45141;45139;45134;45129;45127;45122;45114;45112;45108;45105;45100;45098;45096/answers?filter=withbody&order=asc&page=1&pagesize=100&site=scicomp&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_id": 45285, "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "MPIchael", "profile_url": "https://scicomp.stackexchange.com/users/28636/mpichael", "user_type": "registered"}, "created_at": "2025-11-21T06:31:22+00:00", "raw_file": "raw/codex_api_v1/932c57dde4e92dfe2af05c19643e98b6494a44cb31534e6703e92349c4e07eb4_1790825333093747000_0.json", "raw_sha256": "646e25c86dbb0c4df1ebe365442e733a253ac993340d2ed18168bbf783f75cac", "revision_guid": "CBEFF318-897B-4078-914B-16A6943BCDC5", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/CBEFF318-897B-4078-914B-16A6943BCDC5/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "MPIchael", "profile_url": "https://scicomp.stackexchange.com/users/28636/mpichael", "user_type": "registered"}, "created_at": "2025-11-21T10:25:12+00:00", "raw_file": "raw/codex_api_v1/932c57dde4e92dfe2af05c19643e98b6494a44cb31534e6703e92349c4e07eb4_1790825333093747000_0.json", "raw_sha256": "646e25c86dbb0c4df1ebe365442e733a253ac993340d2ed18168bbf783f75cac", "revision_guid": "64E18437-B71C-4033-8D9E-EBECF3C94E96", "revision_number": 2, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/64E18437-B71C-4033-8D9E-EBECF3C94E96/view-source"}], "score": 1, "updated_at": "2025-11-21T10:25:12+00:00"}, {"answer_html": "<p>The integral is incorrect. It should be:</p>\n<p><span class=\"math-container\">$$\\int^1_{-1}\\int^1_{-1}\\int^1_{-1} \\frac{\\cos^2(\\pi x)}{2} dx dy dz = 2$$</span></p>\n<p>The reason is that <span class=\"math-container\">$[2, 0, 0]$</span> maps to <em>two</em> level 0 cosines each with norm <span class=\"math-container\">$\\sqrt{2}$</span></p>\n", "answer_id": 45287, "answer_text": "The integral is incorrect. It should be:\n\n\n\n\n$$\\int^1_{-1}\\int^1_{-1}\\int^1_{-1} \\frac{\\cos^2(\\pi x)}{2} dx dy dz = 2$$\n\n\n\n\nThe reason is that $[2, 0, 0]$ maps to two level 0 cosines each with norm $\\sqrt{2}$", "answer_url": "https://scicomp.stackexchange.com/a/45287", "author": "Makogan", "author_url": "https://scicomp.stackexchange.com/users/38908/makogan", "author_user_type": "registered", "content_license": "CC BY-SA 4.0", "created_at": "2025-11-21T06:39:36+00:00", "is_accepted": true, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:28:47.033952+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/cb6e5f564c84a92c4e121c0637c99292018f8935652e423630f2001099a2410f_1790825327386675300_0.json", "raw_sha256": "1a957289f56621bebd21cb45dd99baaedb2c3bc11cb28d700558e4bbcaa19695", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/questions/45545;45541;45538;45533;45532;45530;45523;45513;45510;45507;45499;45493;45488;45487;45479;45474;45472;45463;45461;45447;45444;45436;45428;45425;45424;45423;45422;45416;45414;45410;45404;45401;45396;45391;45389;45387;45380;45377;45376;45375;45369;45366;45365;45363;45362;45359;45350;45347;45344;45336;45334;45331;45326;45322;45316;45313;45311;45309;45305;45302;45300;45291;45289;45285;45276;45269;45263;45262;45261;45253;45247;45246;45238;45236;45230;45229;45208;45201;45200;45185;45183;45171;45167;45165;45158;45154;45146;45141;45139;45134;45129;45127;45122;45114;45112;45108;45105;45100;45098;45096/answers?filter=withbody&order=asc&page=1&pagesize=100&site=scicomp&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_id": 45285, "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Makogan", "profile_url": "https://scicomp.stackexchange.com/users/38908/makogan", "user_type": "registered"}, "created_at": "2025-11-21T06:39:36+00:00", "raw_file": "raw/codex_api_v1/932c57dde4e92dfe2af05c19643e98b6494a44cb31534e6703e92349c4e07eb4_1790825333093747000_0.json", "raw_sha256": "646e25c86dbb0c4df1ebe365442e733a253ac993340d2ed18168bbf783f75cac", "revision_guid": "BFA52975-239F-441C-8A99-5359D4A5D377", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/BFA52975-239F-441C-8A99-5359D4A5D377/view-source"}], "score": 2, "updated_at": "2025-11-21T06:39:36+00:00"}], "ground_truth": "community signals only; no scientific truth label", "product": "ranking", "question": "Math preamble\n\n\n\n\nI am trying to create a functional basis for $[-1, 1]^3$ in $\\mathbb{R}^3$. To this effect I take the real expression of the fourier basis and index it with an integer such that\n\n\n\n\n$$\\phi_i(x) = \\cos(\\pi n/2 x)$$\n\n\n\n\nif $i$ is even and\n\n\n\n\n$$\\phi_i(x) = \\sin(\\pi [(n/2) + 1] x)$$\n\n\n\n\nif $i$ is odd.\n\n\n\n\nThen I normalize them, so for simplicity of writing, assume $\\phi_i$ is the normalized version of the function.\n\n\n\n\nWith that definition I create the basis through the tensor product.\n\n\n\n\n$$\\Phi_{i,j,k}(x, y, z) = \\phi_i(x) \\phi_j(y) \\phi_k(z)$$\n\n\n\n\nAlgorithm\n\n\n\n\nNow to render the above basis computable I am only dealing with triplets such that $i + j + k \\leq N$ for some integer $N$.\n\n\n\n\nI am using the trapezoidal rule (also extended through the tensor product) in order to compute integrals, so\n\n\n\n\n$$\\int_\\Omega f(X) \\Phi_{i, j, k}(X) dV \\approx \\sum w_l w_m w_n f(X_{l, m, n})) \\Phi_{i, j, k}(X_{l, m, n}) \\Delta x \\Delta y \\Delta z$$\n\n\n\n\nwhere $w_i$ refer to the weights from the trapezoidal rule. 0.5 at the margins and 1 in the interior.\n\n\n\n\nUsing the above I am projecting different functions onto the discretized basis and then reconstructing them to see the accuracy.\n\n\n\n\nExperiments\n\n\n\n\nI am testing my code and I am noticing discrepancies, for example. I am trying to project $f(x, y, z) = \\cos(\\pi x)$ onto $\\Phi_{2, 0, 0}$\n\n\n\n\nFrom the original definition you will notice that $\\Phi_{2, 0, 0}$ should be $\\cos(\\pi x) / \\sqrt{2}$\n\n\n\n\nSo my expectation is that I am computing:\n\n\n\n\n$$\\int^1_{-1}\\int^1_{-1}\\int^1_{-1} \\frac{\\cos^2(\\pi x)}{\\sqrt{2}} dx dy dz \\approx 2.83$$\n\n\n\n\nHowever, what I am getting is\n\n\n\n\n1.9999999999967393\n\n\n\n\n\nThis is my code (written in rust):\n\n\n\n\nfn fourier_projection<F, S: RealField, const DIM: usize>(\n mut function: F,\n interval: [[S; 2]; DIM],\n basis_index: [usize; DIM],\n resolution: usize,\n) -> S\nwhere\n F: FnMut([S; DIM]) -> S,\n{\n let trapezoidal_weight = |i: usize| {\n if i == 0 || i == resolution - 1\n {\n S::from(0.5).unwrap()\n }\n else\n {\n S::from(1).unwrap()\n }\n };\n\n let mut res = S::default();\n\n for xi in IterDimensions::new([resolution; DIM])\n {\n let mut point = [S::default(); DIM];\n for d in 0..DIM\n {\n let range = interval[d][1] - interval[d][0];\n let t = S::from(xi[d]).unwrap() / S::from(resolution - 1).unwrap();\n let x = t * range + interval[d][0];\n\n point[d] = x;\n }\n\n let mut val = function(point);\n for d in 0..DIM\n {\n let range = interval[d][1] - interval[d][0];\n let dx = range / S::from(resolution - 1).unwrap();\n let t = S::from(xi[d]).unwrap() / S::from(resolution - 1).unwrap();\n let xp = t * S::from(2).unwrap() - S::from(1).unwrap();\n\n val *= fourier_basis(xp, basis_index[d]) * trapezoidal_weight(xi[d]) * dx\n / fourier_norm_on_standard_interval(basis_index[d]);\n }\n\n res += val\n }\n\n res\n}\n\npub fn fourier_norm_on_standard_interval<S: RealField>(basis_index: usize) -> S\n{\n // Only for the very first function (constant) is the norm different.\n if basis_index == 0\n {\n S::from(f64::sqrt(2.)).unwrap()\n }\n else\n {\n S::from(1).unwrap()\n }\n}\n\npub fn fourier_basis<S: RealField>(t: S, basis_index: usize) -> S\n{\n let pi = S::from(PI).unwrap();\n\n let n = basis_index / 2;\n if basis_index % 2 == 0\n {\n ((t * pi) * S::from(n).unwrap()).cos()\n }\n else\n {\n ((t * pi) * S::from(n + 1).unwrap()).sin()\n }\n}\n\n// test\n let test = fourier_projection(\n |[x, y, z]| (PI * x).cos(),\n [[-1., 1.]; 3],\n [2, 0, 0],\n 100,\n );\n\n\n\n\n\nI was hoping someone could point out where I made a mistake.", "record_id": "Scientific-Answer-Ranking:scicomp:45285", "scores": [1, 2], "split": "test", "thread": {"accepted_answer_id": 45287, "answers": [{"answer_html": "<p>The fourier transform assumes that the domain is infinite. In a finite domain the periodicity is only given for the symmetric cosine part of the base. The cosine function is symmetric around 0. The sine function is only for certain frequencies!</p>\n<p>If you want to create a usefull base in a finite cell, then maybe the cosine transform is the way to go and not the fourier base. <a href=\"https://en.wikipedia.org/wiki/Discrete_cosine_transform\" rel=\"nofollow noreferrer\">cosine transform</a></p>\n<p>edit:\n<strong>I think I was wrong on this</strong>. It might be possible although i am not sure about the continuities at the borders of the cell.</p>\n", "answer_id": 45286, "answer_text": "The fourier transform assumes that the domain is infinite. In a finite domain the periodicity is only given for the symmetric cosine part of the base. The cosine function is symmetric around 0. The sine function is only for certain frequencies!\n\n\n\n\nIf you want to create a usefull base in a finite cell, then maybe the cosine transform is the way to go and not the fourier base. cosine transform (https://en.wikipedia.org/wiki/Discrete_cosine_transform)\n\n\n\n\nedit:\nI think I was wrong on this. It might be possible although i am not sure about the continuities at the borders of the cell.", "answer_url": "https://scicomp.stackexchange.com/a/45286", "author": "MPIchael", "author_url": "https://scicomp.stackexchange.com/users/28636/mpichael", "author_user_type": "registered", "content_license": "CC BY-SA 4.0", "created_at": "2025-11-21T06:31:22+00:00", "is_accepted": false, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:28:47.033952+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/cb6e5f564c84a92c4e121c0637c99292018f8935652e423630f2001099a2410f_1790825327386675300_0.json", "raw_sha256": "1a957289f56621bebd21cb45dd99baaedb2c3bc11cb28d700558e4bbcaa19695", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/questions/45545;45541;45538;45533;45532;45530;45523;45513;45510;45507;45499;45493;45488;45487;45479;45474;45472;45463;45461;45447;45444;45436;45428;45425;45424;45423;45422;45416;45414;45410;45404;45401;45396;45391;45389;45387;45380;45377;45376;45375;45369;45366;45365;45363;45362;45359;45350;45347;45344;45336;45334;45331;45326;45322;45316;45313;45311;45309;45305;45302;45300;45291;45289;45285;45276;45269;45263;45262;45261;45253;45247;45246;45238;45236;45230;45229;45208;45201;45200;45185;45183;45171;45167;45165;45158;45154;45146;45141;45139;45134;45129;45127;45122;45114;45112;45108;45105;45100;45098;45096/answers?filter=withbody&order=asc&page=1&pagesize=100&site=scicomp&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_id": 45285, "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "MPIchael", "profile_url": "https://scicomp.stackexchange.com/users/28636/mpichael", "user_type": "registered"}, "created_at": "2025-11-21T06:31:22+00:00", "raw_file": "raw/codex_api_v1/932c57dde4e92dfe2af05c19643e98b6494a44cb31534e6703e92349c4e07eb4_1790825333093747000_0.json", "raw_sha256": "646e25c86dbb0c4df1ebe365442e733a253ac993340d2ed18168bbf783f75cac", "revision_guid": "CBEFF318-897B-4078-914B-16A6943BCDC5", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/CBEFF318-897B-4078-914B-16A6943BCDC5/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "MPIchael", "profile_url": "https://scicomp.stackexchange.com/users/28636/mpichael", "user_type": "registered"}, "created_at": "2025-11-21T10:25:12+00:00", "raw_file": "raw/codex_api_v1/932c57dde4e92dfe2af05c19643e98b6494a44cb31534e6703e92349c4e07eb4_1790825333093747000_0.json", "raw_sha256": "646e25c86dbb0c4df1ebe365442e733a253ac993340d2ed18168bbf783f75cac", "revision_guid": "64E18437-B71C-4033-8D9E-EBECF3C94E96", "revision_number": 2, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/64E18437-B71C-4033-8D9E-EBECF3C94E96/view-source"}], "score": 1, "updated_at": "2025-11-21T10:25:12+00:00"}, {"answer_html": "<p>The integral is incorrect. It should be:</p>\n<p><span class=\"math-container\">$$\\int^1_{-1}\\int^1_{-1}\\int^1_{-1} \\frac{\\cos^2(\\pi x)}{2} dx dy dz = 2$$</span></p>\n<p>The reason is that <span class=\"math-container\">$[2, 0, 0]$</span> maps to <em>two</em> level 0 cosines each with norm <span class=\"math-container\">$\\sqrt{2}$</span></p>\n", "answer_id": 45287, "answer_text": "The integral is incorrect. It should be:\n\n\n\n\n$$\\int^1_{-1}\\int^1_{-1}\\int^1_{-1} \\frac{\\cos^2(\\pi x)}{2} dx dy dz = 2$$\n\n\n\n\nThe reason is that $[2, 0, 0]$ maps to two level 0 cosines each with norm $\\sqrt{2}$", "answer_url": "https://scicomp.stackexchange.com/a/45287", "author": "Makogan", "author_url": "https://scicomp.stackexchange.com/users/38908/makogan", "author_user_type": "registered", "content_license": "CC BY-SA 4.0", "created_at": "2025-11-21T06:39:36+00:00", "is_accepted": true, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:28:47.033952+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/cb6e5f564c84a92c4e121c0637c99292018f8935652e423630f2001099a2410f_1790825327386675300_0.json", "raw_sha256": "1a957289f56621bebd21cb45dd99baaedb2c3bc11cb28d700558e4bbcaa19695", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/questions/45545;45541;45538;45533;45532;45530;45523;45513;45510;45507;45499;45493;45488;45487;45479;45474;45472;45463;45461;45447;45444;45436;45428;45425;45424;45423;45422;45416;45414;45410;45404;45401;45396;45391;45389;45387;45380;45377;45376;45375;45369;45366;45365;45363;45362;45359;45350;45347;45344;45336;45334;45331;45326;45322;45316;45313;45311;45309;45305;45302;45300;45291;45289;45285;45276;45269;45263;45262;45261;45253;45247;45246;45238;45236;45230;45229;45208;45201;45200;45185;45183;45171;45167;45165;45158;45154;45146;45141;45139;45134;45129;45127;45122;45114;45112;45108;45105;45100;45098;45096/answers?filter=withbody&order=asc&page=1&pagesize=100&site=scicomp&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_id": 45285, "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Makogan", "profile_url": "https://scicomp.stackexchange.com/users/38908/makogan", "user_type": "registered"}, "created_at": "2025-11-21T06:39:36+00:00", "raw_file": "raw/codex_api_v1/932c57dde4e92dfe2af05c19643e98b6494a44cb31534e6703e92349c4e07eb4_1790825333093747000_0.json", "raw_sha256": "646e25c86dbb0c4df1ebe365442e733a253ac993340d2ed18168bbf783f75cac", "revision_guid": "BFA52975-239F-441C-8A99-5359D4A5D377", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/BFA52975-239F-441C-8A99-5359D4A5D377/view-source"}], "score": 2, "updated_at": "2025-11-21T06:39:36+00:00"}], "domain": "computational_science", "external_links": ["https://en.wikipedia.org/wiki/Discrete_cosine_transform"], "medical_sensitive": false, "patient_specific": false, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:28:44.584971+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/272744bcc95b58699f7df6e6979b288bb8b00a80ab9c7982dbe170a6d0b63584_1790825325025901700_0.json", "raw_sha256": "27a81850a40920682c29ada76a2b55e80340a5c82764a3e9dde8a9c2ba23db4e", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/search/advanced?answers=1&filter=withbody&order=desc&page=1&pagesize=100&site=scicomp&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_author": "Makogan", "question_author_url": "https://scicomp.stackexchange.com/users/38908/makogan", "question_author_user_type": "registered", "question_created_at": "2025-11-21T02:24:58+00:00", "question_html": "<h1>Math preamble</h1>\n<p>I am trying to create a functional basis for <span class=\"math-container\">$[-1, 1]^3$</span> in <span class=\"math-container\">$\\mathbb{R}^3$</span>. To this effect I take the real expression of the fourier basis and index it with an integer such that</p>\n<p><span class=\"math-container\">$$\\phi_i(x) = \\cos(\\pi n/2 x)$$</span></p>\n<p>if <span class=\"math-container\">$i$</span> is even and</p>\n<p><span class=\"math-container\">$$\\phi_i(x) = \\sin(\\pi [(n/2) + 1] x)$$</span></p>\n<p>if <span class=\"math-container\">$i$</span> is odd.</p>\n<p>Then I normalize them, so for simplicity of writing, assume <span class=\"math-container\">$\\phi_i$</span> is the normalized version of the function.</p>\n<p>With that definition I create the basis through the tensor product.</p>\n<p><span class=\"math-container\">$$\\Phi_{i,j,k}(x, y, z) = \\phi_i(x) \\phi_j(y) \\phi_k(z)$$</span></p>\n<h1>Algorithm</h1>\n<p>Now to render the above basis computable I am only dealing with triplets such that <span class=\"math-container\">$i + j + k \\leq N$</span> for some integer <span class=\"math-container\">$N$</span>.</p>\n<p>I am using the trapezoidal rule (also extended through the tensor product) in order to compute integrals, so</p>\n<p><span class=\"math-container\">$$\\int_\\Omega f(X) \\Phi_{i, j, k}(X) dV \\approx \\sum w_l w_m w_n f(X_{l, m, n})) \\Phi_{i, j, k}(X_{l, m, n}) \\Delta x \\Delta y \\Delta z$$</span></p>\n<p>where <span class=\"math-container\">$w_i$</span> refer to the weights from the trapezoidal rule. 0.5 at the margins and 1 in the interior.</p>\n<p>Using the above I am projecting different functions onto the discretized basis and then reconstructing them to see the accuracy.</p>\n<h1>Experiments</h1>\n<p>I am testing my code and I am noticing discrepancies, for example. I am trying to project <span class=\"math-container\">$f(x, y, z) = \\cos(\\pi x)$</span> onto <span class=\"math-container\">$\\Phi_{2, 0, 0}$</span></p>\n<p>From the original definition you will notice that <span class=\"math-container\">$\\Phi_{2, 0, 0}$</span> should be <span class=\"math-container\">$\\cos(\\pi x) / \\sqrt{2}$</span></p>\n<p>So my expectation is that I am computing:</p>\n<p><span class=\"math-container\">$$\\int^1_{-1}\\int^1_{-1}\\int^1_{-1} \\frac{\\cos^2(\\pi x)}{\\sqrt{2}} dx dy dz \\approx 2.83$$</span></p>\n<p>However, what I am getting is</p>\n<pre><code>1.9999999999967393\n</code></pre>\n<p>This is my code (written in rust):</p>\n<pre class=\"lang-rs prettyprint-override\"><code>fn fourier_projection<F, S: RealField, const DIM: usize>(\n mut function: F,\n interval: [[S; 2]; DIM],\n basis_index: [usize; DIM],\n resolution: usize,\n) -> S\nwhere\n F: FnMut([S; DIM]) -> S,\n{\n let trapezoidal_weight = |i: usize| {\n if i == 0 || i == resolution - 1\n {\n S::from(0.5).unwrap()\n }\n else\n {\n S::from(1).unwrap()\n }\n };\n\n let mut res = S::default();\n\n for xi in IterDimensions::new([resolution; DIM])\n {\n let mut point = [S::default(); DIM];\n for d in 0..DIM\n {\n let range = interval[d][1] - interval[d][0];\n let t = S::from(xi[d]).unwrap() / S::from(resolution - 1).unwrap();\n let x = t * range + interval[d][0];\n\n point[d] = x;\n }\n\n let mut val = function(point);\n for d in 0..DIM\n {\n let range = interval[d][1] - interval[d][0];\n let dx = range / S::from(resolution - 1).unwrap();\n let t = S::from(xi[d]).unwrap() / S::from(resolution - 1).unwrap();\n let xp = t * S::from(2).unwrap() - S::from(1).unwrap();\n\n val *= fourier_basis(xp, basis_index[d]) * trapezoidal_weight(xi[d]) * dx\n / fourier_norm_on_standard_interval(basis_index[d]);\n }\n\n res += val\n }\n\n res\n}\n\npub fn fourier_norm_on_standard_interval<S: RealField>(basis_index: usize) -> S\n{\n // Only for the very first function (constant) is the norm different.\n if basis_index == 0\n {\n S::from(f64::sqrt(2.)).unwrap()\n }\n else\n {\n S::from(1).unwrap()\n }\n}\n\npub fn fourier_basis<S: RealField>(t: S, basis_index: usize) -> S\n{\n let pi = S::from(PI).unwrap();\n\n let n = basis_index / 2;\n if basis_index % 2 == 0\n {\n ((t * pi) * S::from(n).unwrap()).cos()\n }\n else\n {\n ((t * pi) * S::from(n + 1).unwrap()).sin()\n }\n}\n\n// test\n let test = fourier_projection(\n |[x, y, z]| (PI * x).cos(),\n [[-1., 1.]; 3],\n [2, 0, 0],\n 100,\n );\n</code></pre>\n<p>I was hoping someone could point out where I made a mistake.</p>\n", "question_id": 45285, "question_license": "CC BY-SA 4.0", "question_score": 0, "question_text": "Math preamble\n\n\n\n\nI am trying to create a functional basis for $[-1, 1]^3$ in $\\mathbb{R}^3$. To this effect I take the real expression of the fourier basis and index it with an integer such that\n\n\n\n\n$$\\phi_i(x) = \\cos(\\pi n/2 x)$$\n\n\n\n\nif $i$ is even and\n\n\n\n\n$$\\phi_i(x) = \\sin(\\pi [(n/2) + 1] x)$$\n\n\n\n\nif $i$ is odd.\n\n\n\n\nThen I normalize them, so for simplicity of writing, assume $\\phi_i$ is the normalized version of the function.\n\n\n\n\nWith that definition I create the basis through the tensor product.\n\n\n\n\n$$\\Phi_{i,j,k}(x, y, z) = \\phi_i(x) \\phi_j(y) \\phi_k(z)$$\n\n\n\n\nAlgorithm\n\n\n\n\nNow to render the above basis computable I am only dealing with triplets such that $i + j + k \\leq N$ for some integer $N$.\n\n\n\n\nI am using the trapezoidal rule (also extended through the tensor product) in order to compute integrals, so\n\n\n\n\n$$\\int_\\Omega f(X) \\Phi_{i, j, k}(X) dV \\approx \\sum w_l w_m w_n f(X_{l, m, n})) \\Phi_{i, j, k}(X_{l, m, n}) \\Delta x \\Delta y \\Delta z$$\n\n\n\n\nwhere $w_i$ refer to the weights from the trapezoidal rule. 0.5 at the margins and 1 in the interior.\n\n\n\n\nUsing the above I am projecting different functions onto the discretized basis and then reconstructing them to see the accuracy.\n\n\n\n\nExperiments\n\n\n\n\nI am testing my code and I am noticing discrepancies, for example. I am trying to project $f(x, y, z) = \\cos(\\pi x)$ onto $\\Phi_{2, 0, 0}$\n\n\n\n\nFrom the original definition you will notice that $\\Phi_{2, 0, 0}$ should be $\\cos(\\pi x) / \\sqrt{2}$\n\n\n\n\nSo my expectation is that I am computing:\n\n\n\n\n$$\\int^1_{-1}\\int^1_{-1}\\int^1_{-1} \\frac{\\cos^2(\\pi x)}{\\sqrt{2}} dx dy dz \\approx 2.83$$\n\n\n\n\nHowever, what I am getting is\n\n\n\n\n1.9999999999967393\n\n\n\n\n\nThis is my code (written in rust):\n\n\n\n\nfn fourier_projection<F, S: RealField, const DIM: usize>(\n mut function: F,\n interval: [[S; 2]; DIM],\n basis_index: [usize; DIM],\n resolution: usize,\n) -> S\nwhere\n F: FnMut([S; DIM]) -> S,\n{\n let trapezoidal_weight = |i: usize| {\n if i == 0 || i == resolution - 1\n {\n S::from(0.5).unwrap()\n }\n else\n {\n S::from(1).unwrap()\n }\n };\n\n let mut res = S::default();\n\n for xi in IterDimensions::new([resolution; DIM])\n {\n let mut point = [S::default(); DIM];\n for d in 0..DIM\n {\n let range = interval[d][1] - interval[d][0];\n let t = S::from(xi[d]).unwrap() / S::from(resolution - 1).unwrap();\n let x = t * range + interval[d][0];\n\n point[d] = x;\n }\n\n let mut val = function(point);\n for d in 0..DIM\n {\n let range = interval[d][1] - interval[d][0];\n let dx = range / S::from(resolution - 1).unwrap();\n let t = S::from(xi[d]).unwrap() / S::from(resolution - 1).unwrap();\n let xp = t * S::from(2).unwrap() - S::from(1).unwrap();\n\n val *= fourier_basis(xp, basis_index[d]) * trapezoidal_weight(xi[d]) * dx\n / fourier_norm_on_standard_interval(basis_index[d]);\n }\n\n res += val\n }\n\n res\n}\n\npub fn fourier_norm_on_standard_interval<S: RealField>(basis_index: usize) -> S\n{\n // Only for the very first function (constant) is the norm different.\n if basis_index == 0\n {\n S::from(f64::sqrt(2.)).unwrap()\n }\n else\n {\n S::from(1).unwrap()\n }\n}\n\npub fn fourier_basis<S: RealField>(t: S, basis_index: usize) -> S\n{\n let pi = S::from(PI).unwrap();\n\n let n = basis_index / 2;\n if basis_index % 2 == 0\n {\n ((t * pi) * S::from(n).unwrap()).cos()\n }\n else\n {\n ((t * pi) * S::from(n + 1).unwrap()).sin()\n }\n}\n\n// test\n let test = fourier_projection(\n |[x, y, z]| (PI * x).cos(),\n [[-1., 1.]; 3],\n [2, 0, 0],\n 100,\n );\n\n\n\n\n\nI was hoping someone could point out where I made a mistake.", "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Makogan", "profile_url": "https://scicomp.stackexchange.com/users/38908/makogan", "user_type": "registered"}, "created_at": "2025-11-21T02:24:58+00:00", "raw_file": "raw/codex_api_v1/932c57dde4e92dfe2af05c19643e98b6494a44cb31534e6703e92349c4e07eb4_1790825333093747000_0.json", "raw_sha256": "646e25c86dbb0c4df1ebe365442e733a253ac993340d2ed18168bbf783f75cac", "revision_guid": "B9CFB5A4-3B47-4382-BEF6-D74DBB33E85A", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/B9CFB5A4-3B47-4382-BEF6-D74DBB33E85A/view-source"}], "source_site": "scicomp", "source_url": "https://scicomp.stackexchange.com/questions/45285/issues-deriving-a-periodic-basis-in-r3", "split": "test", "split_group": "96bd03d5e1726730a642e946c45093801632d13b9c66e58b80e7027e3583e631", "tags": ["numerics", "algorithms", "fourier-analysis"], "thread_id": "scicomp:45285", "title": "Issues deriving a periodic basis in r^3"}} | |
| {"accepted_status": [false, false, false], "candidate_answers": [{"answer_html": "<p>An efficient way to compute <span class=\"math-container\">$\\sin(kx)$</span> in the context of iteration over <span class=\"math-container\">$k$</span> is to make use of the recursive formula <span class=\"math-container\">$\\sin(kx) = 2 \\cos x \\sin((k-1)x) - \\sin((k-2)x)$</span>.</p>\n<p>However, when performing this computation in fixed-precision floating-point arithmetic there is a caveat, in that accuracy can be lost due to subtractive cancellation. Some <em>quick</em> experiments indicate that this would be the case here.</p>\n<p>The issue of subtractive cancellation can be largely mitigated by the use of a <em>fused</em> multiply-add operation, or FMA. This operation first computes the <em>full</em>, unrounded, product <span class=\"math-container\">$ab$</span> before applying the addition of <span class=\"math-container\">$c$</span>, finally returning the final result <span class=\"math-container\">$ab+c$</span> with a <em>single</em> rounding. This operation is supported in many programming environments as a function <code>fma()</code> for precisions defined by IEEE-754, and as such is supported in hardware for most modern processor architectures such as x86-64 and ARM64.</p>\n<p>However, I am not personally aware of an arbitrary-precision library with support for FMA. One could try to <em>approximately</em> emulate it by computing <span class=\"math-container\">$ab+c$</span> at twice the current working precision and then rounding to working precision. This would still leave an issue of double rounding, which could likely be tolerated in the given context.</p>\n<p>With FMA support, one computes <span class=\"math-container\">$\\sin(kx)=\\mathrm{fma}(2\\cos x,\\sin((k-1)x),-\\sin((k-2)x))$</span>.</p>\n", "answer_id": 45293, "answer_text": "An efficient way to compute $\\sin(kx)$ in the context of iteration over $k$ is to make use of the recursive formula $\\sin(kx) = 2 \\cos x \\sin((k-1)x) - \\sin((k-2)x)$.\n\n\n\n\nHowever, when performing this computation in fixed-precision floating-point arithmetic there is a caveat, in that accuracy can be lost due to subtractive cancellation. Some quick experiments indicate that this would be the case here.\n\n\n\n\nThe issue of subtractive cancellation can be largely mitigated by the use of a fused multiply-add operation, or FMA. This operation first computes the full, unrounded, product $ab$ before applying the addition of $c$, finally returning the final result $ab+c$ with a single rounding. This operation is supported in many programming environments as a function fma() for precisions defined by IEEE-754, and as such is supported in hardware for most modern processor architectures such as x86-64 and ARM64.\n\n\n\n\nHowever, I am not personally aware of an arbitrary-precision library with support for FMA. One could try to approximately emulate it by computing $ab+c$ at twice the current working precision and then rounding to working precision. This would still leave an issue of double rounding, which could likely be tolerated in the given context.\n\n\n\n\nWith FMA support, one computes $\\sin(kx)=\\mathrm{fma}(2\\cos x,\\sin((k-1)x),-\\sin((k-2)x))$.", "answer_url": "https://scicomp.stackexchange.com/a/45293", "author": "njuffa", "author_url": "https://scicomp.stackexchange.com/users/20458/njuffa", "author_user_type": "registered", "content_license": "CC BY-SA 4.0", "created_at": "2025-11-26T23:33:21+00:00", "is_accepted": false, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:28:47.033952+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/cb6e5f564c84a92c4e121c0637c99292018f8935652e423630f2001099a2410f_1790825327386675300_0.json", "raw_sha256": "1a957289f56621bebd21cb45dd99baaedb2c3bc11cb28d700558e4bbcaa19695", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/questions/45545;45541;45538;45533;45532;45530;45523;45513;45510;45507;45499;45493;45488;45487;45479;45474;45472;45463;45461;45447;45444;45436;45428;45425;45424;45423;45422;45416;45414;45410;45404;45401;45396;45391;45389;45387;45380;45377;45376;45375;45369;45366;45365;45363;45362;45359;45350;45347;45344;45336;45334;45331;45326;45322;45316;45313;45311;45309;45305;45302;45300;45291;45289;45285;45276;45269;45263;45262;45261;45253;45247;45246;45238;45236;45230;45229;45208;45201;45200;45185;45183;45171;45167;45165;45158;45154;45146;45141;45139;45134;45129;45127;45122;45114;45112;45108;45105;45100;45098;45096/answers?filter=withbody&order=asc&page=1&pagesize=100&site=scicomp&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_id": 45291, "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "njuffa", "profile_url": "https://scicomp.stackexchange.com/users/20458/njuffa", "user_type": "registered"}, "created_at": "2025-11-26T23:33:21+00:00", "raw_file": "raw/codex_api_v1/932c57dde4e92dfe2af05c19643e98b6494a44cb31534e6703e92349c4e07eb4_1790825333093747000_0.json", "raw_sha256": "646e25c86dbb0c4df1ebe365442e733a253ac993340d2ed18168bbf783f75cac", "revision_guid": "B6ACA9A9-61E5-4827-8876-77505A1EE621", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/B6ACA9A9-61E5-4827-8876-77505A1EE621/view-source"}], "score": 4, "updated_at": "2025-11-26T23:33:21+00:00"}, {"answer_html": "<p>One idea would be to use part of the series expansion of <span class=\"math-container\">$sin(x)$</span> for the first couple of iterations. That is what the computer does internally anyway, but there you can control the order of approximation (how many terms of the expansion you consider and therefore how much compute you use). In iterative methods the first iterations often only have to put your solution in the general vicinity of the solution, being refined in the later stages.</p>\n<p>That way you spent less compute on the rough parts, and only when you are close to convergence you use the costly full-precision approximation of <span class=\"math-container\">$sin(x)$</span> as before.</p>\n<p><span class=\"math-container\">\\begin{align}\n\\sin(x) &= x - \\frac{x^3}{3!} + \\frac{x^5}{5!} - \\frac{x^7}{7!} + \\cdots \\\\\n &= \\sum_{n=0}^\\infty \\frac{(-1)^n}{(2n+1)!}x^{2n+1}\n\\end{align}</span></p>\n<p>Note that the expansion looses precision the further away you are from 0.</p>\n", "answer_id": 45294, "answer_text": "One idea would be to use part of the series expansion of $sin(x)$ for the first couple of iterations. That is what the computer does internally anyway, but there you can control the order of approximation (how many terms of the expansion you consider and therefore how much compute you use). In iterative methods the first iterations often only have to put your solution in the general vicinity of the solution, being refined in the later stages.\n\n\n\n\nThat way you spent less compute on the rough parts, and only when you are close to convergence you use the costly full-precision approximation of $sin(x)$ as before.\n\n\n\n\n\\begin{align}\n\\sin(x) &= x - \\frac{x^3}{3!} + \\frac{x^5}{5!} - \\frac{x^7}{7!} + \\cdots \\\\\n &= \\sum_{n=0}^\\infty \\frac{(-1)^n}{(2n+1)!}x^{2n+1}\n\\end{align}\n\n\n\n\nNote that the expansion looses precision the further away you are from 0.", "answer_url": "https://scicomp.stackexchange.com/a/45294", "author": "MPIchael", "author_url": "https://scicomp.stackexchange.com/users/28636/mpichael", "author_user_type": "registered", "content_license": "CC BY-SA 4.0", "created_at": "2025-11-27T07:31:18+00:00", "is_accepted": false, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:28:47.033952+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/cb6e5f564c84a92c4e121c0637c99292018f8935652e423630f2001099a2410f_1790825327386675300_0.json", "raw_sha256": "1a957289f56621bebd21cb45dd99baaedb2c3bc11cb28d700558e4bbcaa19695", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/questions/45545;45541;45538;45533;45532;45530;45523;45513;45510;45507;45499;45493;45488;45487;45479;45474;45472;45463;45461;45447;45444;45436;45428;45425;45424;45423;45422;45416;45414;45410;45404;45401;45396;45391;45389;45387;45380;45377;45376;45375;45369;45366;45365;45363;45362;45359;45350;45347;45344;45336;45334;45331;45326;45322;45316;45313;45311;45309;45305;45302;45300;45291;45289;45285;45276;45269;45263;45262;45261;45253;45247;45246;45238;45236;45230;45229;45208;45201;45200;45185;45183;45171;45167;45165;45158;45154;45146;45141;45139;45134;45129;45127;45122;45114;45112;45108;45105;45100;45098;45096/answers?filter=withbody&order=asc&page=1&pagesize=100&site=scicomp&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_id": 45291, "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "MPIchael", "profile_url": "https://scicomp.stackexchange.com/users/28636/mpichael", "user_type": "registered"}, "created_at": "2025-11-27T07:31:18+00:00", "raw_file": "raw/codex_api_v1/932c57dde4e92dfe2af05c19643e98b6494a44cb31534e6703e92349c4e07eb4_1790825333093747000_0.json", "raw_sha256": "646e25c86dbb0c4df1ebe365442e733a253ac993340d2ed18168bbf783f75cac", "revision_guid": "968C67F8-16E6-40D8-80A4-8E5335D3FC2C", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/968C67F8-16E6-40D8-80A4-8E5335D3FC2C/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "MPIchael", "profile_url": "https://scicomp.stackexchange.com/users/28636/mpichael", "user_type": "registered"}, "created_at": "2025-11-27T07:36:23+00:00", "raw_file": "raw/codex_api_v1/932c57dde4e92dfe2af05c19643e98b6494a44cb31534e6703e92349c4e07eb4_1790825333093747000_0.json", "raw_sha256": "646e25c86dbb0c4df1ebe365442e733a253ac993340d2ed18168bbf783f75cac", "revision_guid": "1885B799-B6E4-4653-BEFB-37E50B86F7E6", "revision_number": 2, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/1885B799-B6E4-4653-BEFB-37E50B86F7E6/view-source"}], "score": 2, "updated_at": "2025-11-27T07:36:23+00:00"}, {"answer_html": "<p>Given the recurrence\n<span class=\"math-container\">$$\nx_{n+1}\n= x_n + \\sum_{k=1}^{m} a_k \\,\\sin(k x_n),\n\\qquad\na_k := (-1)^{m+k}\\,\\frac{1}{k}\\prod_{\\substack{j=1 \\\\ j \\ne k}}^{m}\n\\frac{j^{2}}{k^{2} - j^{2}}.\n$$</span></p>\n<p>We can use the <a href=\"https://en.wikipedia.org/wiki/Chebyshev_polynomials\" rel=\"noreferrer\">Chebyshev polynomial</a> of the second kind:\n<span class=\"math-container\">$$\nU_n(\\cos x) = \\frac{\\sin\\bigl((n+1)x\\bigr)}{\\sin x}.\n$$</span></p>\n<p>Plugging <span class=\"math-container\">$n = k-1$</span> into this definition gives\n<span class=\"math-container\">$$\nU_{k-1}(\\cos x)= \\frac{\\sin(kx)}{\\sin x}\\;\\Longrightarrow\\;\n\\sin(kx) = \\sin x \\, U_{k-1}(\\cos x).\n$$</span></p>\n<p>Therefore, the iteration can be written equivalently as\n<span class=\"math-container\">$$\n\\sum_{k=1}^{m} a_k \\sin(kx)\n= \\sin x \\sum_{k=1}^{m} a_k U_{k-1}(\\cos x)\n= \\sin x \\, P_m(\\cos x),\n$$</span>\nwith\n<span class=\"math-container\">$$\nP_m(c) := \\sum_{k=1}^{m} a_k \\, U_{k-1}(c),\n$$</span></p>\n<p>and</p>\n<p><span class=\"math-container\">$$\nU_{k-1}(c)\n= \\sum_{r=0}^{\\left\\lfloor (k-1)/2 \\right\\rfloor}\n (-1)^r\n \\binom{k-1-r}{r}\\,\n (2c)^{\\,k-1-2r}.\n$$</span></p>\n<p>Therefore, the new iteration can be written as\n<span class=\"math-container\">$$\nx_{n+1}\n= x_n + \\sin(x_n)\\,P_m\\big(\\cos(x_n)\\big),\n$$</span></p>\n<p>where <span class=\"math-container\">$P_m$</span> is the polynomial\n<span class=\"math-container\">$$\nP_m(c)\n := \\sum_{k=1}^{m} a_k\n \\sum_{r=0}^{\\left\\lfloor (k-1)/2 \\right\\rfloor}\n (-1)^r\n \\binom{k-1-r}{r}\\,\n (2c)^{\\,k-1-2r}.\n$$</span></p>\n<p>So instead of computing <span class=\"math-container\">$\\sin(k x_n)$</span> for every <span class=\"math-container\">$k$</span>, we can:</p>\n<ul>\n<li>Compute <span class=\"math-container\">$s = \\sin(x_n)$</span> once,</li>\n<li>Compute <span class=\"math-container\">$c = \\cos(x_n)$</span> once,</li>\n<li>Evaluate the polynomial <span class=\"math-container\">$P_m(c)$</span>.</li>\n</ul>\n<h2>Example</h2>\n<p>We start from the Chebyshev representation for <span class=\"math-container\">$m=5$</span>:\n<span class=\"math-container\">$$\nP_5(t) = \\sum_{k=1}^5 a_k\\,U_{k-1}(t),\n$$</span>\nwith\n<span class=\"math-container\">$$\na_1 = \\frac{5}{3},\\quad\na_2 = \\frac{10}{21},\\quad\na_3 = \\frac{5}{42},\\quad\na_4 = \\frac{5}{252},\\quad\na_5 = \\frac{1}{630},\n$$</span>\nand\n<span class=\"math-container\">$$\n\\begin{aligned}\nU_0(t) &= 1,\\\\\nU_1(t) &= 2t,\\\\\nU_2(t) &= 4t^2 - 1,\\\\\nU_3(t) &= 8t^3 - 4t,\\\\\nU_4(t) &= 16t^4 - 12t^2 + 1.\n\\end{aligned}\n$$</span></p>\n<p>Thus\n<span class=\"math-container\">$$\n\\begin{aligned}\nP_5(t)\n&= a_1 U_0(t) + a_2 U_1(t) + a_3 U_2(t) + a_4 U_3(t) + a_5 U_4(t)\\\\[4pt]\n&= \\frac{5}{3}\\cdot 1\n + \\frac{10}{21}\\cdot (2t)\n + \\frac{5}{42}\\cdot (4t^2 - 1)\n + \\frac{5}{252}\\cdot (8t^3 - 4t)\n + \\frac{1}{630}\\cdot (16t^4 - 12t^2 + 1).\n\\end{aligned}\n$$</span></p>\n<p>Simplifying each term:\n<span class=\"math-container\">$$\n\\begin{aligned}\nP_5(t)\n&= \\frac{5}{3}\n + \\frac{20}{21}t\n + \\left(\\frac{20}{42}t^2 - \\frac{5}{42}\\right)\n + \\left(\\frac{40}{252}t^3 - \\frac{20}{252}t\\right)\n + \\left(\\frac{16}{630}t^4 - \\frac{12}{630}t^2 + \\frac{1}{630}\\right)\\\\[4pt]\n&= \\frac{5}{3}\n + \\frac{20}{21}t\n + \\left(\\frac{10}{21}t^2 - \\frac{5}{42}\\right)\n + \\left(\\frac{10}{63}t^3 - \\frac{5}{63}t\\right)\n + \\left(\\frac{8}{315}t^4 - \\frac{2}{105}t^2 + \\frac{1}{630}\\right).\n\\end{aligned}\n$$</span></p>\n<p>Now collect like powers of <span class=\"math-container\">$t$</span>.</p>\n<p><span class=\"math-container\">$t^4$</span> term:\n<span class=\"math-container\">$$\n\\frac{8}{315}t^4.\n$$</span></p>\n<p><span class=\"math-container\">$t^3$</span> term:\n<span class=\"math-container\">$$\n\\frac{10}{63}t^3.\n$$</span></p>\n<p><span class=\"math-container\">$t^2$</span> term:\n<span class=\"math-container\">$$\n\\frac{10}{21}t^2 - \\frac{2}{105}t^2\n= \\left(\\frac{10}{21} - \\frac{2}{105}\\right)t^2\n= \\left(\\frac{50}{105} - \\frac{2}{105}\\right)t^2\n= \\frac{48}{105}t^2\n= \\frac{16}{35}t^2.\n$$</span></p>\n<p><span class=\"math-container\">$t^1$</span> term:\n<span class=\"math-container\">$$\n\\frac{20}{21}t - \\frac{5}{63}t\n= \\left(\\frac{20}{21} - \\frac{5}{63}\\right)t\n= \\left(\\frac{60}{63} - \\frac{5}{63}\\right)t\n= \\frac{55}{63}t.\n$$</span></p>\n<p>Constant term:\n<span class=\"math-container\">$$\n\\frac{5}{3} - \\frac{5}{42} + \\frac{1}{630}\n= \\frac{1050}{630} - \\frac{75}{630} + \\frac{1}{630}\n= \\frac{976}{630}\n= \\frac{488}{315}.\n$$</span></p>\n<p>So we obtain\n<span class=\"math-container\">$$\nP_5(t)\n= \\frac{8}{315}t^4\n+ \\frac{10}{63}t^3\n+ \\frac{16}{35}t^2\n+ \\frac{55}{63}t\n+ \\frac{488}{315}.\n$$</span></p>\n<p>Factoring out <span class=\"math-container\">$\\frac{1}{315}$</span> gives the compact form\n<span class=\"math-container\">$$\nP_5(t)\n= \\frac{1}{315}\\bigl(8t^4 + 50t^3 + 144t^2 + 275t + 488\\bigr).\n$$</span></p>\n<h2>Test Case</h2>\n<p>For <span class=\"math-container\">$m = 5$</span> we have\n<span class=\"math-container\">$$\nP_5(t) = \\frac{1}{315}\\bigl(8t^4 + 50t^3 + 144t^2 + 275t + 488\\bigr),\n$$</span>\nand the iteration\n<span class=\"math-container\">$$\nx_{n+1} = x_n + \\sin(x_n)\\,P_5(\\cos x_n).\n$$</span></p>\n<pre><code>from mpmath import mp\nimport time\n\nmp.dps = 1000 # 1000 digits of precision\n\n# m = 5 polynomial:\n# P5(t) = (1/315) * (8 t^4 + 50 t^3 + 144 t^2 + 275 t + 488)\n\ndef step_m5(x):\n """\n m = 5 iteration:\n x_{n+1} = x_n + sin(x_n) * P5(cos(x_n))\n\n where\n P5(t) = (1/315) * (8 t^4 + 50 t^3 + 144 t^2 + 275 t + 488).\n """\n s = mp.sin(x)\n c = mp.cos(x)\n P5 = (mp.mpf(1) / 315) * (8*c**4 + 50*c**3 + 144*c**2 + 275*c + 488)\n return x + s * P5\n\n# initial value x0 = 3\nx = mp.mpf(3)\n\nstart = time.perf_counter()\nfor n in range(1, 4): # a few iterations are enough because order = 11\n x = step_m5(x)\nend = time.perf_counter()\n\nprint("Approximate pi (m=5):")\nprint(mp.nstr(x, 1000))\nprint(f"\\nTime Taken: {end - start:.6f} seconds")\n\n# Show how close we are to the true mp.pi\nerr = x - mp.pi\nprint("\\nError x - pi:")\nprint(mp.nstr(err, 5))\n</code></pre>\n<hr />\n<p>Approximate pi (m=5):\n3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930381964428810975665933446128475648233786783165271201909145648566923460348610454326648213393607260249141273724587006606315588174881520920962829254091715364367892590360011330530548820466521384146951941511609433057270365759591953092186117381932611793105118548074462379962749567351885752724891227938183011949129833673362440656643086021394946395224737190702179860943702770539217176293176752384674818467669405132000568127145263560827785771342757789609173637178721468440901224953430146549585371050792279689258923542019956112129021960864034418159813629774771309960518707211349999998372978049951059731732816096318595024459455346908302642522308253344685035261931188171010003137838752886587533208381420617177669147303598253490428755468731159562863882353787593751957781857780532171226806613001927876611195909216420199</p>\n<p>Time Taken: 0.001180 seconds</p>\n<p>Error x - pi:\n0.0</p>\n", "answer_id": 45295, "answer_text": "Given the recurrence\n$$\nx_{n+1}\n= x_n + \\sum_{k=1}^{m} a_k \\,\\sin(k x_n),\n\\qquad\na_k := (-1)^{m+k}\\,\\frac{1}{k}\\prod_{\\substack{j=1 \\\\ j \\ne k}}^{m}\n\\frac{j^{2}}{k^{2} - j^{2}}.\n$$\n\n\n\n\nWe can use the Chebyshev polynomial (https://en.wikipedia.org/wiki/Chebyshev_polynomials) of the second kind:\n$$\nU_n(\\cos x) = \\frac{\\sin\\bigl((n+1)x\\bigr)}{\\sin x}.\n$$\n\n\n\n\nPlugging $n = k-1$ into this definition gives\n$$\nU_{k-1}(\\cos x)= \\frac{\\sin(kx)}{\\sin x}\\;\\Longrightarrow\\;\n\\sin(kx) = \\sin x \\, U_{k-1}(\\cos x).\n$$\n\n\n\n\nTherefore, the iteration can be written equivalently as\n$$\n\\sum_{k=1}^{m} a_k \\sin(kx)\n= \\sin x \\sum_{k=1}^{m} a_k U_{k-1}(\\cos x)\n= \\sin x \\, P_m(\\cos x),\n$$\nwith\n$$\nP_m(c) := \\sum_{k=1}^{m} a_k \\, U_{k-1}(c),\n$$\n\n\n\n\nand\n\n\n\n\n$$\nU_{k-1}(c)\n= \\sum_{r=0}^{\\left\\lfloor (k-1)/2 \\right\\rfloor}\n (-1)^r\n \\binom{k-1-r}{r}\\,\n (2c)^{\\,k-1-2r}.\n$$\n\n\n\n\nTherefore, the new iteration can be written as\n$$\nx_{n+1}\n= x_n + \\sin(x_n)\\,P_m\\big(\\cos(x_n)\\big),\n$$\n\n\n\n\nwhere $P_m$ is the polynomial\n$$\nP_m(c)\n := \\sum_{k=1}^{m} a_k\n \\sum_{r=0}^{\\left\\lfloor (k-1)/2 \\right\\rfloor}\n (-1)^r\n \\binom{k-1-r}{r}\\,\n (2c)^{\\,k-1-2r}.\n$$\n\n\n\n\nSo instead of computing $\\sin(k x_n)$ for every $k$, we can:\n\n\n\n\n\nCompute $s = \\sin(x_n)$ once,\n\n\n\n\nCompute $c = \\cos(x_n)$ once,\n\n\n\n\nEvaluate the polynomial $P_m(c)$.\n\n\n\n\n\nExample\n\n\n\n\nWe start from the Chebyshev representation for $m=5$:\n$$\nP_5(t) = \\sum_{k=1}^5 a_k\\,U_{k-1}(t),\n$$\nwith\n$$\na_1 = \\frac{5}{3},\\quad\na_2 = \\frac{10}{21},\\quad\na_3 = \\frac{5}{42},\\quad\na_4 = \\frac{5}{252},\\quad\na_5 = \\frac{1}{630},\n$$\nand\n$$\n\\begin{aligned}\nU_0(t) &= 1,\\\\\nU_1(t) &= 2t,\\\\\nU_2(t) &= 4t^2 - 1,\\\\\nU_3(t) &= 8t^3 - 4t,\\\\\nU_4(t) &= 16t^4 - 12t^2 + 1.\n\\end{aligned}\n$$\n\n\n\n\nThus\n$$\n\\begin{aligned}\nP_5(t)\n&= a_1 U_0(t) + a_2 U_1(t) + a_3 U_2(t) + a_4 U_3(t) + a_5 U_4(t)\\\\[4pt]\n&= \\frac{5}{3}\\cdot 1\n + \\frac{10}{21}\\cdot (2t)\n + \\frac{5}{42}\\cdot (4t^2 - 1)\n + \\frac{5}{252}\\cdot (8t^3 - 4t)\n + \\frac{1}{630}\\cdot (16t^4 - 12t^2 + 1).\n\\end{aligned}\n$$\n\n\n\n\nSimplifying each term:\n$$\n\\begin{aligned}\nP_5(t)\n&= \\frac{5}{3}\n + \\frac{20}{21}t\n + \\left(\\frac{20}{42}t^2 - \\frac{5}{42}\\right)\n + \\left(\\frac{40}{252}t^3 - \\frac{20}{252}t\\right)\n + \\left(\\frac{16}{630}t^4 - \\frac{12}{630}t^2 + \\frac{1}{630}\\right)\\\\[4pt]\n&= \\frac{5}{3}\n + \\frac{20}{21}t\n + \\left(\\frac{10}{21}t^2 - \\frac{5}{42}\\right)\n + \\left(\\frac{10}{63}t^3 - \\frac{5}{63}t\\right)\n + \\left(\\frac{8}{315}t^4 - \\frac{2}{105}t^2 + \\frac{1}{630}\\right).\n\\end{aligned}\n$$\n\n\n\n\nNow collect like powers of $t$.\n\n\n\n\n$t^4$ term:\n$$\n\\frac{8}{315}t^4.\n$$\n\n\n\n\n$t^3$ term:\n$$\n\\frac{10}{63}t^3.\n$$\n\n\n\n\n$t^2$ term:\n$$\n\\frac{10}{21}t^2 - \\frac{2}{105}t^2\n= \\left(\\frac{10}{21} - \\frac{2}{105}\\right)t^2\n= \\left(\\frac{50}{105} - \\frac{2}{105}\\right)t^2\n= \\frac{48}{105}t^2\n= \\frac{16}{35}t^2.\n$$\n\n\n\n\n$t^1$ term:\n$$\n\\frac{20}{21}t - \\frac{5}{63}t\n= \\left(\\frac{20}{21} - \\frac{5}{63}\\right)t\n= \\left(\\frac{60}{63} - \\frac{5}{63}\\right)t\n= \\frac{55}{63}t.\n$$\n\n\n\n\nConstant term:\n$$\n\\frac{5}{3} - \\frac{5}{42} + \\frac{1}{630}\n= \\frac{1050}{630} - \\frac{75}{630} + \\frac{1}{630}\n= \\frac{976}{630}\n= \\frac{488}{315}.\n$$\n\n\n\n\nSo we obtain\n$$\nP_5(t)\n= \\frac{8}{315}t^4\n+ \\frac{10}{63}t^3\n+ \\frac{16}{35}t^2\n+ \\frac{55}{63}t\n+ \\frac{488}{315}.\n$$\n\n\n\n\nFactoring out $\\frac{1}{315}$ gives the compact form\n$$\nP_5(t)\n= \\frac{1}{315}\\bigl(8t^4 + 50t^3 + 144t^2 + 275t + 488\\bigr).\n$$\n\n\n\n\nTest Case\n\n\n\n\nFor $m = 5$ we have\n$$\nP_5(t) = \\frac{1}{315}\\bigl(8t^4 + 50t^3 + 144t^2 + 275t + 488\\bigr),\n$$\nand the iteration\n$$\nx_{n+1} = x_n + \\sin(x_n)\\,P_5(\\cos x_n).\n$$\n\n\n\n\nfrom mpmath import mp\nimport time\n\nmp.dps = 1000 # 1000 digits of precision\n\n# m = 5 polynomial:\n# P5(t) = (1/315) * (8 t^4 + 50 t^3 + 144 t^2 + 275 t + 488)\n\ndef step_m5(x):\n \"\"\"\n m = 5 iteration:\n x_{n+1} = x_n + sin(x_n) * P5(cos(x_n))\n\n where\n P5(t) = (1/315) * (8 t^4 + 50 t^3 + 144 t^2 + 275 t + 488).\n \"\"\"\n s = mp.sin(x)\n c = mp.cos(x)\n P5 = (mp.mpf(1) / 315) * (8*c**4 + 50*c**3 + 144*c**2 + 275*c + 488)\n return x + s * P5\n\n# initial value x0 = 3\nx = mp.mpf(3)\n\nstart = time.perf_counter()\nfor n in range(1, 4): # a few iterations are enough because order = 11\n x = step_m5(x)\nend = time.perf_counter()\n\nprint(\"Approximate pi (m=5):\")\nprint(mp.nstr(x, 1000))\nprint(f\"\\nTime Taken: {end - start:.6f} seconds\")\n\n# Show how close we are to the true mp.pi\nerr = x - mp.pi\nprint(\"\\nError x - pi:\")\nprint(mp.nstr(err, 5))\n\n\n\n\n\n\n\n\nApproximate pi (m=5):\n3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930381964428810975665933446128475648233786783165271201909145648566923460348610454326648213393607260249141273724587006606315588174881520920962829254091715364367892590360011330530548820466521384146951941511609433057270365759591953092186117381932611793105118548074462379962749567351885752724891227938183011949129833673362440656643086021394946395224737190702179860943702770539217176293176752384674818467669405132000568127145263560827785771342757789609173637178721468440901224953430146549585371050792279689258923542019956112129021960864034418159813629774771309960518707211349999998372978049951059731732816096318595024459455346908302642522308253344685035261931188171010003137838752886587533208381420617177669147303598253490428755468731159562863882353787593751957781857780532171226806613001927876611195909216420199\n\n\n\n\nTime Taken: 0.001180 seconds\n\n\n\n\nError x - pi:\n0.0", "answer_url": "https://scicomp.stackexchange.com/a/45295", "author": "vengy", "author_url": "https://scicomp.stackexchange.com/users/56070/vengy", "author_user_type": "registered", "content_license": "CC BY-SA 4.0", "created_at": "2025-11-27T16:01:03+00:00", "is_accepted": false, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:28:47.033952+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/cb6e5f564c84a92c4e121c0637c99292018f8935652e423630f2001099a2410f_1790825327386675300_0.json", "raw_sha256": "1a957289f56621bebd21cb45dd99baaedb2c3bc11cb28d700558e4bbcaa19695", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/questions/45545;45541;45538;45533;45532;45530;45523;45513;45510;45507;45499;45493;45488;45487;45479;45474;45472;45463;45461;45447;45444;45436;45428;45425;45424;45423;45422;45416;45414;45410;45404;45401;45396;45391;45389;45387;45380;45377;45376;45375;45369;45366;45365;45363;45362;45359;45350;45347;45344;45336;45334;45331;45326;45322;45316;45313;45311;45309;45305;45302;45300;45291;45289;45285;45276;45269;45263;45262;45261;45253;45247;45246;45238;45236;45230;45229;45208;45201;45200;45185;45183;45171;45167;45165;45158;45154;45146;45141;45139;45134;45129;45127;45122;45114;45112;45108;45105;45100;45098;45096/answers?filter=withbody&order=asc&page=1&pagesize=100&site=scicomp&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_id": 45291, "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "vengy", "profile_url": "https://scicomp.stackexchange.com/users/56070/vengy", "user_type": "registered"}, "created_at": "2025-11-27T16:01:03+00:00", "raw_file": "raw/codex_api_v1/932c57dde4e92dfe2af05c19643e98b6494a44cb31534e6703e92349c4e07eb4_1790825333093747000_0.json", "raw_sha256": "646e25c86dbb0c4df1ebe365442e733a253ac993340d2ed18168bbf783f75cac", "revision_guid": "12F528C5-3339-4BD9-82C4-1F98C0E30ABD", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/12F528C5-3339-4BD9-82C4-1F98C0E30ABD/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "vengy", "profile_url": "https://scicomp.stackexchange.com/users/56070/vengy", "user_type": "registered"}, "created_at": "2025-11-27T16:46:02+00:00", "raw_file": "raw/codex_api_v1/932c57dde4e92dfe2af05c19643e98b6494a44cb31534e6703e92349c4e07eb4_1790825333093747000_0.json", "raw_sha256": "646e25c86dbb0c4df1ebe365442e733a253ac993340d2ed18168bbf783f75cac", "revision_guid": "94F6BA8F-8639-48FE-844B-374EC8092EC7", "revision_number": 2, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/94F6BA8F-8639-48FE-844B-374EC8092EC7/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "vengy", "profile_url": "https://scicomp.stackexchange.com/users/56070/vengy", "user_type": "registered"}, "created_at": "2025-11-27T17:19:25+00:00", "raw_file": "raw/codex_api_v1/932c57dde4e92dfe2af05c19643e98b6494a44cb31534e6703e92349c4e07eb4_1790825333093747000_0.json", "raw_sha256": "646e25c86dbb0c4df1ebe365442e733a253ac993340d2ed18168bbf783f75cac", "revision_guid": "C72508F8-E2C5-4479-B135-70BE30A2F07C", "revision_number": 3, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/C72508F8-E2C5-4479-B135-70BE30A2F07C/view-source"}], "score": 7, "updated_at": "2025-11-27T17:19:25+00:00"}], "ground_truth": "community signals only; no scientific truth label", "product": "ranking", "question": "I have this recurrence formula for $\\pi$ with convergence order $2m+1$:\n\n\n\n\n$$\nx_{n+1} = x_n + \\sum_{k=1}^{m} \\left[ (-1)^{m+k} \\cdot \\frac{1}{k} \\prod_{\\substack{j=1 \\\\ j \\ne k}}^{m} \\frac{j^{2}}{k^{2} - j^{2}} \\right] \\sin(k x_n).\n$$\n\n\n\n\nFor example, let $m=2$. The recurrence is:\n$$\nx_{n+1}=x_n+ \\frac{4}{3}\\,\\sin(x_n)+ \\frac{1}{6}\\,\\sin(2x_n).\n$$\n\n\n\n\nAfter four iterations, $\\pi$ is accurate to $761$ digits:\n\n\n\n\n3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930381964428810975665933446128475648233786783165271201909145648566923460348610454326648213393607260249141273724587006606315588174881520920962829254091715364367892590360011330530548820466521384146951941511609433057270365759591953092186117381932611793105118548074462379962749567351885752724891227938183011949129833673362440656643086021394946395224737190702179860943702770539217176293176752384674818467669405132000568127145263560827785771342757789609173637178721468440901224953430146549585371050792279689258923542019956112129021960864034418159813629774771309960518707211343082259728864581849972469526130405086109419964771039095301381998678247215175696280484782896433126351623817501296615376345723979560286352234586232286130523901015245593954685898250839054728621411070507501722658851574741380974002315574736131\n\n\n\n\nfrom mpmath import mp\nimport time\n\nmp.dps = 1000\n\nc21 = mp.mpf(4) / 3\nc22 = mp.mpf(1) / 6\n\ndef step_m2(x):\n return x + c21 * mp.sin(x) + c22 * mp.sin(2*x)\n\n# initial value x0 = 3\nx = mp.mpf(3)\n\nstart = time.perf_counter()\nfor n in range(1, 5):\n x = step_m2(x)\nend = time.perf_counter()\n\nprint(\"Approximate pi:\", mp.nstr(x, 1000))\nprint(f\"Time Taken: {end - start:.6f} seconds\")\n\n\n\n\n\nHowever, evaluating $\\sin(k x_n)$ at high precision becomes very slow, especially for large $m$.\n\n\n\n\nQuestion\n\n\n\n\nAre there efficient approximations or methods for computing $\\sin(k x_n)$ in iterative algorithms?\n\n\n\n\nUpdate\n\n\n\n\nBased on the answers, the iteration has been optimized so that each step\nrequires only one evaluation of $\\sin$, one of $\\cos$, and a polynomial\nevaluation:\n\n\n\n\n$$\nx_{n+1}\n= x_n\n+ \\sin(x_n)\\,\n \\sum_{r=0}^{m-1} \\frac{r!}{(2r+1)!!}\\,(\\cos x_n + 1)^r.\n$$\n\n\n\n\nThanks!", "record_id": "Scientific-Answer-Ranking:scicomp:45291", "scores": [4, 2, 7], "split": "test", "thread": {"accepted_answer_id": null, "answers": [{"answer_html": "<p>An efficient way to compute <span class=\"math-container\">$\\sin(kx)$</span> in the context of iteration over <span class=\"math-container\">$k$</span> is to make use of the recursive formula <span class=\"math-container\">$\\sin(kx) = 2 \\cos x \\sin((k-1)x) - \\sin((k-2)x)$</span>.</p>\n<p>However, when performing this computation in fixed-precision floating-point arithmetic there is a caveat, in that accuracy can be lost due to subtractive cancellation. Some <em>quick</em> experiments indicate that this would be the case here.</p>\n<p>The issue of subtractive cancellation can be largely mitigated by the use of a <em>fused</em> multiply-add operation, or FMA. This operation first computes the <em>full</em>, unrounded, product <span class=\"math-container\">$ab$</span> before applying the addition of <span class=\"math-container\">$c$</span>, finally returning the final result <span class=\"math-container\">$ab+c$</span> with a <em>single</em> rounding. This operation is supported in many programming environments as a function <code>fma()</code> for precisions defined by IEEE-754, and as such is supported in hardware for most modern processor architectures such as x86-64 and ARM64.</p>\n<p>However, I am not personally aware of an arbitrary-precision library with support for FMA. One could try to <em>approximately</em> emulate it by computing <span class=\"math-container\">$ab+c$</span> at twice the current working precision and then rounding to working precision. This would still leave an issue of double rounding, which could likely be tolerated in the given context.</p>\n<p>With FMA support, one computes <span class=\"math-container\">$\\sin(kx)=\\mathrm{fma}(2\\cos x,\\sin((k-1)x),-\\sin((k-2)x))$</span>.</p>\n", "answer_id": 45293, "answer_text": "An efficient way to compute $\\sin(kx)$ in the context of iteration over $k$ is to make use of the recursive formula $\\sin(kx) = 2 \\cos x \\sin((k-1)x) - \\sin((k-2)x)$.\n\n\n\n\nHowever, when performing this computation in fixed-precision floating-point arithmetic there is a caveat, in that accuracy can be lost due to subtractive cancellation. Some quick experiments indicate that this would be the case here.\n\n\n\n\nThe issue of subtractive cancellation can be largely mitigated by the use of a fused multiply-add operation, or FMA. This operation first computes the full, unrounded, product $ab$ before applying the addition of $c$, finally returning the final result $ab+c$ with a single rounding. This operation is supported in many programming environments as a function fma() for precisions defined by IEEE-754, and as such is supported in hardware for most modern processor architectures such as x86-64 and ARM64.\n\n\n\n\nHowever, I am not personally aware of an arbitrary-precision library with support for FMA. One could try to approximately emulate it by computing $ab+c$ at twice the current working precision and then rounding to working precision. This would still leave an issue of double rounding, which could likely be tolerated in the given context.\n\n\n\n\nWith FMA support, one computes $\\sin(kx)=\\mathrm{fma}(2\\cos x,\\sin((k-1)x),-\\sin((k-2)x))$.", "answer_url": "https://scicomp.stackexchange.com/a/45293", "author": "njuffa", "author_url": "https://scicomp.stackexchange.com/users/20458/njuffa", "author_user_type": "registered", "content_license": "CC BY-SA 4.0", "created_at": "2025-11-26T23:33:21+00:00", "is_accepted": false, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:28:47.033952+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/cb6e5f564c84a92c4e121c0637c99292018f8935652e423630f2001099a2410f_1790825327386675300_0.json", "raw_sha256": "1a957289f56621bebd21cb45dd99baaedb2c3bc11cb28d700558e4bbcaa19695", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/questions/45545;45541;45538;45533;45532;45530;45523;45513;45510;45507;45499;45493;45488;45487;45479;45474;45472;45463;45461;45447;45444;45436;45428;45425;45424;45423;45422;45416;45414;45410;45404;45401;45396;45391;45389;45387;45380;45377;45376;45375;45369;45366;45365;45363;45362;45359;45350;45347;45344;45336;45334;45331;45326;45322;45316;45313;45311;45309;45305;45302;45300;45291;45289;45285;45276;45269;45263;45262;45261;45253;45247;45246;45238;45236;45230;45229;45208;45201;45200;45185;45183;45171;45167;45165;45158;45154;45146;45141;45139;45134;45129;45127;45122;45114;45112;45108;45105;45100;45098;45096/answers?filter=withbody&order=asc&page=1&pagesize=100&site=scicomp&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_id": 45291, "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "njuffa", "profile_url": "https://scicomp.stackexchange.com/users/20458/njuffa", "user_type": "registered"}, "created_at": "2025-11-26T23:33:21+00:00", "raw_file": "raw/codex_api_v1/932c57dde4e92dfe2af05c19643e98b6494a44cb31534e6703e92349c4e07eb4_1790825333093747000_0.json", "raw_sha256": "646e25c86dbb0c4df1ebe365442e733a253ac993340d2ed18168bbf783f75cac", "revision_guid": "B6ACA9A9-61E5-4827-8876-77505A1EE621", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/B6ACA9A9-61E5-4827-8876-77505A1EE621/view-source"}], "score": 4, "updated_at": "2025-11-26T23:33:21+00:00"}, {"answer_html": "<p>One idea would be to use part of the series expansion of <span class=\"math-container\">$sin(x)$</span> for the first couple of iterations. That is what the computer does internally anyway, but there you can control the order of approximation (how many terms of the expansion you consider and therefore how much compute you use). In iterative methods the first iterations often only have to put your solution in the general vicinity of the solution, being refined in the later stages.</p>\n<p>That way you spent less compute on the rough parts, and only when you are close to convergence you use the costly full-precision approximation of <span class=\"math-container\">$sin(x)$</span> as before.</p>\n<p><span class=\"math-container\">\\begin{align}\n\\sin(x) &= x - \\frac{x^3}{3!} + \\frac{x^5}{5!} - \\frac{x^7}{7!} + \\cdots \\\\\n &= \\sum_{n=0}^\\infty \\frac{(-1)^n}{(2n+1)!}x^{2n+1}\n\\end{align}</span></p>\n<p>Note that the expansion looses precision the further away you are from 0.</p>\n", "answer_id": 45294, "answer_text": "One idea would be to use part of the series expansion of $sin(x)$ for the first couple of iterations. That is what the computer does internally anyway, but there you can control the order of approximation (how many terms of the expansion you consider and therefore how much compute you use). In iterative methods the first iterations often only have to put your solution in the general vicinity of the solution, being refined in the later stages.\n\n\n\n\nThat way you spent less compute on the rough parts, and only when you are close to convergence you use the costly full-precision approximation of $sin(x)$ as before.\n\n\n\n\n\\begin{align}\n\\sin(x) &= x - \\frac{x^3}{3!} + \\frac{x^5}{5!} - \\frac{x^7}{7!} + \\cdots \\\\\n &= \\sum_{n=0}^\\infty \\frac{(-1)^n}{(2n+1)!}x^{2n+1}\n\\end{align}\n\n\n\n\nNote that the expansion looses precision the further away you are from 0.", "answer_url": "https://scicomp.stackexchange.com/a/45294", "author": "MPIchael", "author_url": "https://scicomp.stackexchange.com/users/28636/mpichael", "author_user_type": "registered", "content_license": "CC BY-SA 4.0", "created_at": "2025-11-27T07:31:18+00:00", "is_accepted": false, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:28:47.033952+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/cb6e5f564c84a92c4e121c0637c99292018f8935652e423630f2001099a2410f_1790825327386675300_0.json", "raw_sha256": "1a957289f56621bebd21cb45dd99baaedb2c3bc11cb28d700558e4bbcaa19695", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/questions/45545;45541;45538;45533;45532;45530;45523;45513;45510;45507;45499;45493;45488;45487;45479;45474;45472;45463;45461;45447;45444;45436;45428;45425;45424;45423;45422;45416;45414;45410;45404;45401;45396;45391;45389;45387;45380;45377;45376;45375;45369;45366;45365;45363;45362;45359;45350;45347;45344;45336;45334;45331;45326;45322;45316;45313;45311;45309;45305;45302;45300;45291;45289;45285;45276;45269;45263;45262;45261;45253;45247;45246;45238;45236;45230;45229;45208;45201;45200;45185;45183;45171;45167;45165;45158;45154;45146;45141;45139;45134;45129;45127;45122;45114;45112;45108;45105;45100;45098;45096/answers?filter=withbody&order=asc&page=1&pagesize=100&site=scicomp&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_id": 45291, "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "MPIchael", "profile_url": "https://scicomp.stackexchange.com/users/28636/mpichael", "user_type": "registered"}, "created_at": "2025-11-27T07:31:18+00:00", "raw_file": "raw/codex_api_v1/932c57dde4e92dfe2af05c19643e98b6494a44cb31534e6703e92349c4e07eb4_1790825333093747000_0.json", "raw_sha256": "646e25c86dbb0c4df1ebe365442e733a253ac993340d2ed18168bbf783f75cac", "revision_guid": "968C67F8-16E6-40D8-80A4-8E5335D3FC2C", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/968C67F8-16E6-40D8-80A4-8E5335D3FC2C/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "MPIchael", "profile_url": "https://scicomp.stackexchange.com/users/28636/mpichael", "user_type": "registered"}, "created_at": "2025-11-27T07:36:23+00:00", "raw_file": "raw/codex_api_v1/932c57dde4e92dfe2af05c19643e98b6494a44cb31534e6703e92349c4e07eb4_1790825333093747000_0.json", "raw_sha256": "646e25c86dbb0c4df1ebe365442e733a253ac993340d2ed18168bbf783f75cac", "revision_guid": "1885B799-B6E4-4653-BEFB-37E50B86F7E6", "revision_number": 2, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/1885B799-B6E4-4653-BEFB-37E50B86F7E6/view-source"}], "score": 2, "updated_at": "2025-11-27T07:36:23+00:00"}, {"answer_html": "<p>Given the recurrence\n<span class=\"math-container\">$$\nx_{n+1}\n= x_n + \\sum_{k=1}^{m} a_k \\,\\sin(k x_n),\n\\qquad\na_k := (-1)^{m+k}\\,\\frac{1}{k}\\prod_{\\substack{j=1 \\\\ j \\ne k}}^{m}\n\\frac{j^{2}}{k^{2} - j^{2}}.\n$$</span></p>\n<p>We can use the <a href=\"https://en.wikipedia.org/wiki/Chebyshev_polynomials\" rel=\"noreferrer\">Chebyshev polynomial</a> of the second kind:\n<span class=\"math-container\">$$\nU_n(\\cos x) = \\frac{\\sin\\bigl((n+1)x\\bigr)}{\\sin x}.\n$$</span></p>\n<p>Plugging <span class=\"math-container\">$n = k-1$</span> into this definition gives\n<span class=\"math-container\">$$\nU_{k-1}(\\cos x)= \\frac{\\sin(kx)}{\\sin x}\\;\\Longrightarrow\\;\n\\sin(kx) = \\sin x \\, U_{k-1}(\\cos x).\n$$</span></p>\n<p>Therefore, the iteration can be written equivalently as\n<span class=\"math-container\">$$\n\\sum_{k=1}^{m} a_k \\sin(kx)\n= \\sin x \\sum_{k=1}^{m} a_k U_{k-1}(\\cos x)\n= \\sin x \\, P_m(\\cos x),\n$$</span>\nwith\n<span class=\"math-container\">$$\nP_m(c) := \\sum_{k=1}^{m} a_k \\, U_{k-1}(c),\n$$</span></p>\n<p>and</p>\n<p><span class=\"math-container\">$$\nU_{k-1}(c)\n= \\sum_{r=0}^{\\left\\lfloor (k-1)/2 \\right\\rfloor}\n (-1)^r\n \\binom{k-1-r}{r}\\,\n (2c)^{\\,k-1-2r}.\n$$</span></p>\n<p>Therefore, the new iteration can be written as\n<span class=\"math-container\">$$\nx_{n+1}\n= x_n + \\sin(x_n)\\,P_m\\big(\\cos(x_n)\\big),\n$$</span></p>\n<p>where <span class=\"math-container\">$P_m$</span> is the polynomial\n<span class=\"math-container\">$$\nP_m(c)\n := \\sum_{k=1}^{m} a_k\n \\sum_{r=0}^{\\left\\lfloor (k-1)/2 \\right\\rfloor}\n (-1)^r\n \\binom{k-1-r}{r}\\,\n (2c)^{\\,k-1-2r}.\n$$</span></p>\n<p>So instead of computing <span class=\"math-container\">$\\sin(k x_n)$</span> for every <span class=\"math-container\">$k$</span>, we can:</p>\n<ul>\n<li>Compute <span class=\"math-container\">$s = \\sin(x_n)$</span> once,</li>\n<li>Compute <span class=\"math-container\">$c = \\cos(x_n)$</span> once,</li>\n<li>Evaluate the polynomial <span class=\"math-container\">$P_m(c)$</span>.</li>\n</ul>\n<h2>Example</h2>\n<p>We start from the Chebyshev representation for <span class=\"math-container\">$m=5$</span>:\n<span class=\"math-container\">$$\nP_5(t) = \\sum_{k=1}^5 a_k\\,U_{k-1}(t),\n$$</span>\nwith\n<span class=\"math-container\">$$\na_1 = \\frac{5}{3},\\quad\na_2 = \\frac{10}{21},\\quad\na_3 = \\frac{5}{42},\\quad\na_4 = \\frac{5}{252},\\quad\na_5 = \\frac{1}{630},\n$$</span>\nand\n<span class=\"math-container\">$$\n\\begin{aligned}\nU_0(t) &= 1,\\\\\nU_1(t) &= 2t,\\\\\nU_2(t) &= 4t^2 - 1,\\\\\nU_3(t) &= 8t^3 - 4t,\\\\\nU_4(t) &= 16t^4 - 12t^2 + 1.\n\\end{aligned}\n$$</span></p>\n<p>Thus\n<span class=\"math-container\">$$\n\\begin{aligned}\nP_5(t)\n&= a_1 U_0(t) + a_2 U_1(t) + a_3 U_2(t) + a_4 U_3(t) + a_5 U_4(t)\\\\[4pt]\n&= \\frac{5}{3}\\cdot 1\n + \\frac{10}{21}\\cdot (2t)\n + \\frac{5}{42}\\cdot (4t^2 - 1)\n + \\frac{5}{252}\\cdot (8t^3 - 4t)\n + \\frac{1}{630}\\cdot (16t^4 - 12t^2 + 1).\n\\end{aligned}\n$$</span></p>\n<p>Simplifying each term:\n<span class=\"math-container\">$$\n\\begin{aligned}\nP_5(t)\n&= \\frac{5}{3}\n + \\frac{20}{21}t\n + \\left(\\frac{20}{42}t^2 - \\frac{5}{42}\\right)\n + \\left(\\frac{40}{252}t^3 - \\frac{20}{252}t\\right)\n + \\left(\\frac{16}{630}t^4 - \\frac{12}{630}t^2 + \\frac{1}{630}\\right)\\\\[4pt]\n&= \\frac{5}{3}\n + \\frac{20}{21}t\n + \\left(\\frac{10}{21}t^2 - \\frac{5}{42}\\right)\n + \\left(\\frac{10}{63}t^3 - \\frac{5}{63}t\\right)\n + \\left(\\frac{8}{315}t^4 - \\frac{2}{105}t^2 + \\frac{1}{630}\\right).\n\\end{aligned}\n$$</span></p>\n<p>Now collect like powers of <span class=\"math-container\">$t$</span>.</p>\n<p><span class=\"math-container\">$t^4$</span> term:\n<span class=\"math-container\">$$\n\\frac{8}{315}t^4.\n$$</span></p>\n<p><span class=\"math-container\">$t^3$</span> term:\n<span class=\"math-container\">$$\n\\frac{10}{63}t^3.\n$$</span></p>\n<p><span class=\"math-container\">$t^2$</span> term:\n<span class=\"math-container\">$$\n\\frac{10}{21}t^2 - \\frac{2}{105}t^2\n= \\left(\\frac{10}{21} - \\frac{2}{105}\\right)t^2\n= \\left(\\frac{50}{105} - \\frac{2}{105}\\right)t^2\n= \\frac{48}{105}t^2\n= \\frac{16}{35}t^2.\n$$</span></p>\n<p><span class=\"math-container\">$t^1$</span> term:\n<span class=\"math-container\">$$\n\\frac{20}{21}t - \\frac{5}{63}t\n= \\left(\\frac{20}{21} - \\frac{5}{63}\\right)t\n= \\left(\\frac{60}{63} - \\frac{5}{63}\\right)t\n= \\frac{55}{63}t.\n$$</span></p>\n<p>Constant term:\n<span class=\"math-container\">$$\n\\frac{5}{3} - \\frac{5}{42} + \\frac{1}{630}\n= \\frac{1050}{630} - \\frac{75}{630} + \\frac{1}{630}\n= \\frac{976}{630}\n= \\frac{488}{315}.\n$$</span></p>\n<p>So we obtain\n<span class=\"math-container\">$$\nP_5(t)\n= \\frac{8}{315}t^4\n+ \\frac{10}{63}t^3\n+ \\frac{16}{35}t^2\n+ \\frac{55}{63}t\n+ \\frac{488}{315}.\n$$</span></p>\n<p>Factoring out <span class=\"math-container\">$\\frac{1}{315}$</span> gives the compact form\n<span class=\"math-container\">$$\nP_5(t)\n= \\frac{1}{315}\\bigl(8t^4 + 50t^3 + 144t^2 + 275t + 488\\bigr).\n$$</span></p>\n<h2>Test Case</h2>\n<p>For <span class=\"math-container\">$m = 5$</span> we have\n<span class=\"math-container\">$$\nP_5(t) = \\frac{1}{315}\\bigl(8t^4 + 50t^3 + 144t^2 + 275t + 488\\bigr),\n$$</span>\nand the iteration\n<span class=\"math-container\">$$\nx_{n+1} = x_n + \\sin(x_n)\\,P_5(\\cos x_n).\n$$</span></p>\n<pre><code>from mpmath import mp\nimport time\n\nmp.dps = 1000 # 1000 digits of precision\n\n# m = 5 polynomial:\n# P5(t) = (1/315) * (8 t^4 + 50 t^3 + 144 t^2 + 275 t + 488)\n\ndef step_m5(x):\n """\n m = 5 iteration:\n x_{n+1} = x_n + sin(x_n) * P5(cos(x_n))\n\n where\n P5(t) = (1/315) * (8 t^4 + 50 t^3 + 144 t^2 + 275 t + 488).\n """\n s = mp.sin(x)\n c = mp.cos(x)\n P5 = (mp.mpf(1) / 315) * (8*c**4 + 50*c**3 + 144*c**2 + 275*c + 488)\n return x + s * P5\n\n# initial value x0 = 3\nx = mp.mpf(3)\n\nstart = time.perf_counter()\nfor n in range(1, 4): # a few iterations are enough because order = 11\n x = step_m5(x)\nend = time.perf_counter()\n\nprint("Approximate pi (m=5):")\nprint(mp.nstr(x, 1000))\nprint(f"\\nTime Taken: {end - start:.6f} seconds")\n\n# Show how close we are to the true mp.pi\nerr = x - mp.pi\nprint("\\nError x - pi:")\nprint(mp.nstr(err, 5))\n</code></pre>\n<hr />\n<p>Approximate pi (m=5):\n3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930381964428810975665933446128475648233786783165271201909145648566923460348610454326648213393607260249141273724587006606315588174881520920962829254091715364367892590360011330530548820466521384146951941511609433057270365759591953092186117381932611793105118548074462379962749567351885752724891227938183011949129833673362440656643086021394946395224737190702179860943702770539217176293176752384674818467669405132000568127145263560827785771342757789609173637178721468440901224953430146549585371050792279689258923542019956112129021960864034418159813629774771309960518707211349999998372978049951059731732816096318595024459455346908302642522308253344685035261931188171010003137838752886587533208381420617177669147303598253490428755468731159562863882353787593751957781857780532171226806613001927876611195909216420199</p>\n<p>Time Taken: 0.001180 seconds</p>\n<p>Error x - pi:\n0.0</p>\n", "answer_id": 45295, "answer_text": "Given the recurrence\n$$\nx_{n+1}\n= x_n + \\sum_{k=1}^{m} a_k \\,\\sin(k x_n),\n\\qquad\na_k := (-1)^{m+k}\\,\\frac{1}{k}\\prod_{\\substack{j=1 \\\\ j \\ne k}}^{m}\n\\frac{j^{2}}{k^{2} - j^{2}}.\n$$\n\n\n\n\nWe can use the Chebyshev polynomial (https://en.wikipedia.org/wiki/Chebyshev_polynomials) of the second kind:\n$$\nU_n(\\cos x) = \\frac{\\sin\\bigl((n+1)x\\bigr)}{\\sin x}.\n$$\n\n\n\n\nPlugging $n = k-1$ into this definition gives\n$$\nU_{k-1}(\\cos x)= \\frac{\\sin(kx)}{\\sin x}\\;\\Longrightarrow\\;\n\\sin(kx) = \\sin x \\, U_{k-1}(\\cos x).\n$$\n\n\n\n\nTherefore, the iteration can be written equivalently as\n$$\n\\sum_{k=1}^{m} a_k \\sin(kx)\n= \\sin x \\sum_{k=1}^{m} a_k U_{k-1}(\\cos x)\n= \\sin x \\, P_m(\\cos x),\n$$\nwith\n$$\nP_m(c) := \\sum_{k=1}^{m} a_k \\, U_{k-1}(c),\n$$\n\n\n\n\nand\n\n\n\n\n$$\nU_{k-1}(c)\n= \\sum_{r=0}^{\\left\\lfloor (k-1)/2 \\right\\rfloor}\n (-1)^r\n \\binom{k-1-r}{r}\\,\n (2c)^{\\,k-1-2r}.\n$$\n\n\n\n\nTherefore, the new iteration can be written as\n$$\nx_{n+1}\n= x_n + \\sin(x_n)\\,P_m\\big(\\cos(x_n)\\big),\n$$\n\n\n\n\nwhere $P_m$ is the polynomial\n$$\nP_m(c)\n := \\sum_{k=1}^{m} a_k\n \\sum_{r=0}^{\\left\\lfloor (k-1)/2 \\right\\rfloor}\n (-1)^r\n \\binom{k-1-r}{r}\\,\n (2c)^{\\,k-1-2r}.\n$$\n\n\n\n\nSo instead of computing $\\sin(k x_n)$ for every $k$, we can:\n\n\n\n\n\nCompute $s = \\sin(x_n)$ once,\n\n\n\n\nCompute $c = \\cos(x_n)$ once,\n\n\n\n\nEvaluate the polynomial $P_m(c)$.\n\n\n\n\n\nExample\n\n\n\n\nWe start from the Chebyshev representation for $m=5$:\n$$\nP_5(t) = \\sum_{k=1}^5 a_k\\,U_{k-1}(t),\n$$\nwith\n$$\na_1 = \\frac{5}{3},\\quad\na_2 = \\frac{10}{21},\\quad\na_3 = \\frac{5}{42},\\quad\na_4 = \\frac{5}{252},\\quad\na_5 = \\frac{1}{630},\n$$\nand\n$$\n\\begin{aligned}\nU_0(t) &= 1,\\\\\nU_1(t) &= 2t,\\\\\nU_2(t) &= 4t^2 - 1,\\\\\nU_3(t) &= 8t^3 - 4t,\\\\\nU_4(t) &= 16t^4 - 12t^2 + 1.\n\\end{aligned}\n$$\n\n\n\n\nThus\n$$\n\\begin{aligned}\nP_5(t)\n&= a_1 U_0(t) + a_2 U_1(t) + a_3 U_2(t) + a_4 U_3(t) + a_5 U_4(t)\\\\[4pt]\n&= \\frac{5}{3}\\cdot 1\n + \\frac{10}{21}\\cdot (2t)\n + \\frac{5}{42}\\cdot (4t^2 - 1)\n + \\frac{5}{252}\\cdot (8t^3 - 4t)\n + \\frac{1}{630}\\cdot (16t^4 - 12t^2 + 1).\n\\end{aligned}\n$$\n\n\n\n\nSimplifying each term:\n$$\n\\begin{aligned}\nP_5(t)\n&= \\frac{5}{3}\n + \\frac{20}{21}t\n + \\left(\\frac{20}{42}t^2 - \\frac{5}{42}\\right)\n + \\left(\\frac{40}{252}t^3 - \\frac{20}{252}t\\right)\n + \\left(\\frac{16}{630}t^4 - \\frac{12}{630}t^2 + \\frac{1}{630}\\right)\\\\[4pt]\n&= \\frac{5}{3}\n + \\frac{20}{21}t\n + \\left(\\frac{10}{21}t^2 - \\frac{5}{42}\\right)\n + \\left(\\frac{10}{63}t^3 - \\frac{5}{63}t\\right)\n + \\left(\\frac{8}{315}t^4 - \\frac{2}{105}t^2 + \\frac{1}{630}\\right).\n\\end{aligned}\n$$\n\n\n\n\nNow collect like powers of $t$.\n\n\n\n\n$t^4$ term:\n$$\n\\frac{8}{315}t^4.\n$$\n\n\n\n\n$t^3$ term:\n$$\n\\frac{10}{63}t^3.\n$$\n\n\n\n\n$t^2$ term:\n$$\n\\frac{10}{21}t^2 - \\frac{2}{105}t^2\n= \\left(\\frac{10}{21} - \\frac{2}{105}\\right)t^2\n= \\left(\\frac{50}{105} - \\frac{2}{105}\\right)t^2\n= \\frac{48}{105}t^2\n= \\frac{16}{35}t^2.\n$$\n\n\n\n\n$t^1$ term:\n$$\n\\frac{20}{21}t - \\frac{5}{63}t\n= \\left(\\frac{20}{21} - \\frac{5}{63}\\right)t\n= \\left(\\frac{60}{63} - \\frac{5}{63}\\right)t\n= \\frac{55}{63}t.\n$$\n\n\n\n\nConstant term:\n$$\n\\frac{5}{3} - \\frac{5}{42} + \\frac{1}{630}\n= \\frac{1050}{630} - \\frac{75}{630} + \\frac{1}{630}\n= \\frac{976}{630}\n= \\frac{488}{315}.\n$$\n\n\n\n\nSo we obtain\n$$\nP_5(t)\n= \\frac{8}{315}t^4\n+ \\frac{10}{63}t^3\n+ \\frac{16}{35}t^2\n+ \\frac{55}{63}t\n+ \\frac{488}{315}.\n$$\n\n\n\n\nFactoring out $\\frac{1}{315}$ gives the compact form\n$$\nP_5(t)\n= \\frac{1}{315}\\bigl(8t^4 + 50t^3 + 144t^2 + 275t + 488\\bigr).\n$$\n\n\n\n\nTest Case\n\n\n\n\nFor $m = 5$ we have\n$$\nP_5(t) = \\frac{1}{315}\\bigl(8t^4 + 50t^3 + 144t^2 + 275t + 488\\bigr),\n$$\nand the iteration\n$$\nx_{n+1} = x_n + \\sin(x_n)\\,P_5(\\cos x_n).\n$$\n\n\n\n\nfrom mpmath import mp\nimport time\n\nmp.dps = 1000 # 1000 digits of precision\n\n# m = 5 polynomial:\n# P5(t) = (1/315) * (8 t^4 + 50 t^3 + 144 t^2 + 275 t + 488)\n\ndef step_m5(x):\n \"\"\"\n m = 5 iteration:\n x_{n+1} = x_n + sin(x_n) * P5(cos(x_n))\n\n where\n P5(t) = (1/315) * (8 t^4 + 50 t^3 + 144 t^2 + 275 t + 488).\n \"\"\"\n s = mp.sin(x)\n c = mp.cos(x)\n P5 = (mp.mpf(1) / 315) * (8*c**4 + 50*c**3 + 144*c**2 + 275*c + 488)\n return x + s * P5\n\n# initial value x0 = 3\nx = mp.mpf(3)\n\nstart = time.perf_counter()\nfor n in range(1, 4): # a few iterations are enough because order = 11\n x = step_m5(x)\nend = time.perf_counter()\n\nprint(\"Approximate pi (m=5):\")\nprint(mp.nstr(x, 1000))\nprint(f\"\\nTime Taken: {end - start:.6f} seconds\")\n\n# Show how close we are to the true mp.pi\nerr = x - mp.pi\nprint(\"\\nError x - pi:\")\nprint(mp.nstr(err, 5))\n\n\n\n\n\n\n\n\nApproximate pi (m=5):\n3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930381964428810975665933446128475648233786783165271201909145648566923460348610454326648213393607260249141273724587006606315588174881520920962829254091715364367892590360011330530548820466521384146951941511609433057270365759591953092186117381932611793105118548074462379962749567351885752724891227938183011949129833673362440656643086021394946395224737190702179860943702770539217176293176752384674818467669405132000568127145263560827785771342757789609173637178721468440901224953430146549585371050792279689258923542019956112129021960864034418159813629774771309960518707211349999998372978049951059731732816096318595024459455346908302642522308253344685035261931188171010003137838752886587533208381420617177669147303598253490428755468731159562863882353787593751957781857780532171226806613001927876611195909216420199\n\n\n\n\nTime Taken: 0.001180 seconds\n\n\n\n\nError x - pi:\n0.0", "answer_url": "https://scicomp.stackexchange.com/a/45295", "author": "vengy", "author_url": "https://scicomp.stackexchange.com/users/56070/vengy", "author_user_type": "registered", "content_license": "CC BY-SA 4.0", "created_at": "2025-11-27T16:01:03+00:00", "is_accepted": false, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:28:47.033952+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/cb6e5f564c84a92c4e121c0637c99292018f8935652e423630f2001099a2410f_1790825327386675300_0.json", "raw_sha256": "1a957289f56621bebd21cb45dd99baaedb2c3bc11cb28d700558e4bbcaa19695", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/questions/45545;45541;45538;45533;45532;45530;45523;45513;45510;45507;45499;45493;45488;45487;45479;45474;45472;45463;45461;45447;45444;45436;45428;45425;45424;45423;45422;45416;45414;45410;45404;45401;45396;45391;45389;45387;45380;45377;45376;45375;45369;45366;45365;45363;45362;45359;45350;45347;45344;45336;45334;45331;45326;45322;45316;45313;45311;45309;45305;45302;45300;45291;45289;45285;45276;45269;45263;45262;45261;45253;45247;45246;45238;45236;45230;45229;45208;45201;45200;45185;45183;45171;45167;45165;45158;45154;45146;45141;45139;45134;45129;45127;45122;45114;45112;45108;45105;45100;45098;45096/answers?filter=withbody&order=asc&page=1&pagesize=100&site=scicomp&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_id": 45291, "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "vengy", "profile_url": "https://scicomp.stackexchange.com/users/56070/vengy", "user_type": "registered"}, "created_at": "2025-11-27T16:01:03+00:00", "raw_file": "raw/codex_api_v1/932c57dde4e92dfe2af05c19643e98b6494a44cb31534e6703e92349c4e07eb4_1790825333093747000_0.json", "raw_sha256": "646e25c86dbb0c4df1ebe365442e733a253ac993340d2ed18168bbf783f75cac", "revision_guid": "12F528C5-3339-4BD9-82C4-1F98C0E30ABD", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/12F528C5-3339-4BD9-82C4-1F98C0E30ABD/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "vengy", "profile_url": "https://scicomp.stackexchange.com/users/56070/vengy", "user_type": "registered"}, "created_at": "2025-11-27T16:46:02+00:00", "raw_file": "raw/codex_api_v1/932c57dde4e92dfe2af05c19643e98b6494a44cb31534e6703e92349c4e07eb4_1790825333093747000_0.json", "raw_sha256": "646e25c86dbb0c4df1ebe365442e733a253ac993340d2ed18168bbf783f75cac", "revision_guid": "94F6BA8F-8639-48FE-844B-374EC8092EC7", "revision_number": 2, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/94F6BA8F-8639-48FE-844B-374EC8092EC7/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "vengy", "profile_url": "https://scicomp.stackexchange.com/users/56070/vengy", "user_type": "registered"}, "created_at": "2025-11-27T17:19:25+00:00", "raw_file": "raw/codex_api_v1/932c57dde4e92dfe2af05c19643e98b6494a44cb31534e6703e92349c4e07eb4_1790825333093747000_0.json", "raw_sha256": "646e25c86dbb0c4df1ebe365442e733a253ac993340d2ed18168bbf783f75cac", "revision_guid": "C72508F8-E2C5-4479-B135-70BE30A2F07C", "revision_number": 3, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/C72508F8-E2C5-4479-B135-70BE30A2F07C/view-source"}], "score": 7, "updated_at": "2025-11-27T17:19:25+00:00"}], "domain": "computational_science", "external_links": ["https://en.wikipedia.org/wiki/Chebyshev_polynomials"], "medical_sensitive": false, "patient_specific": false, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:28:44.584971+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/272744bcc95b58699f7df6e6979b288bb8b00a80ab9c7982dbe170a6d0b63584_1790825325025901700_0.json", "raw_sha256": "27a81850a40920682c29ada76a2b55e80340a5c82764a3e9dde8a9c2ba23db4e", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/search/advanced?answers=1&filter=withbody&order=desc&page=1&pagesize=100&site=scicomp&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_author": "vengy", "question_author_url": "https://scicomp.stackexchange.com/users/56070/vengy", "question_author_user_type": "registered", "question_created_at": "2025-11-26T20:12:50+00:00", "question_html": "<p>I have this recurrence formula for <span class=\"math-container\">$\\pi$</span> with convergence order <span class=\"math-container\">$2m+1$</span>:</p>\n<p><span class=\"math-container\">$$\nx_{n+1} = x_n + \\sum_{k=1}^{m} \\left[ (-1)^{m+k} \\cdot \\frac{1}{k} \\prod_{\\substack{j=1 \\\\ j \\ne k}}^{m} \\frac{j^{2}}{k^{2} - j^{2}} \\right] \\sin(k x_n).\n$$</span></p>\n<p>For example, let <span class=\"math-container\">$m=2$</span>. The recurrence is:\n<span class=\"math-container\">$$\nx_{n+1}=x_n+ \\frac{4}{3}\\,\\sin(x_n)+ \\frac{1}{6}\\,\\sin(2x_n).\n$$</span></p>\n<p>After four iterations, <span class=\"math-container\">$\\pi$</span> is accurate to <span class=\"math-container\">$761$</span> digits:</p>\n<p><em><strong>3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196442881097566593344612847564823378678316527120190914564856692346034861045432664821339360726024914127372458700660631558817488152092096282925409171536436789259036001133053054882046652138414695194151160943305727036575959195309218611738193261179310511854807446237996274956735188575272489122793818301194912983367336244065664308602139494639522473719070217986094370277053921717629317675238467481846766940513200056812714526356082778577134275778960917363717872146844090122495343014654958537105079227968925892354201995611212902196086403441815981362977477130996051870721134</strong></em>3082259728864581849972469526130405086109419964771039095301381998678247215175696280484782896433126351623817501296615376345723979560286352234586232286130523901015245593954685898250839054728621411070507501722658851574741380974002315574736131</p>\n<pre class=\"lang-py prettyprint-override\"><code>from mpmath import mp\nimport time\n\nmp.dps = 1000\n\nc21 = mp.mpf(4) / 3\nc22 = mp.mpf(1) / 6\n\ndef step_m2(x):\n return x + c21 * mp.sin(x) + c22 * mp.sin(2*x)\n\n# initial value x0 = 3\nx = mp.mpf(3)\n\nstart = time.perf_counter()\nfor n in range(1, 5):\n x = step_m2(x)\nend = time.perf_counter()\n\nprint("Approximate pi:", mp.nstr(x, 1000))\nprint(f"Time Taken: {end - start:.6f} seconds")\n</code></pre>\n<p>However, evaluating <span class=\"math-container\">$\\sin(k x_n)$</span> at high precision becomes very slow, especially for large <span class=\"math-container\">$m$</span>.</p>\n<h2>Question</h2>\n<p>Are there efficient approximations or methods for computing <span class=\"math-container\">$\\sin(k x_n)$</span> in iterative algorithms?</p>\n<h2>Update</h2>\n<p>Based on the answers, the iteration has been optimized so that each step\nrequires only one evaluation of <span class=\"math-container\">$\\sin$</span>, one of <span class=\"math-container\">$\\cos$</span>, and a polynomial\nevaluation:</p>\n<p><span class=\"math-container\">$$\nx_{n+1}\n= x_n\n+ \\sin(x_n)\\,\n \\sum_{r=0}^{m-1} \\frac{r!}{(2r+1)!!}\\,(\\cos x_n + 1)^r.\n$$</span></p>\n<p>Thanks!</p>\n", "question_id": 45291, "question_license": "CC BY-SA 4.0", "question_score": 6, "question_text": "I have this recurrence formula for $\\pi$ with convergence order $2m+1$:\n\n\n\n\n$$\nx_{n+1} = x_n + \\sum_{k=1}^{m} \\left[ (-1)^{m+k} \\cdot \\frac{1}{k} \\prod_{\\substack{j=1 \\\\ j \\ne k}}^{m} \\frac{j^{2}}{k^{2} - j^{2}} \\right] \\sin(k x_n).\n$$\n\n\n\n\nFor example, let $m=2$. The recurrence is:\n$$\nx_{n+1}=x_n+ \\frac{4}{3}\\,\\sin(x_n)+ \\frac{1}{6}\\,\\sin(2x_n).\n$$\n\n\n\n\nAfter four iterations, $\\pi$ is accurate to $761$ digits:\n\n\n\n\n3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930381964428810975665933446128475648233786783165271201909145648566923460348610454326648213393607260249141273724587006606315588174881520920962829254091715364367892590360011330530548820466521384146951941511609433057270365759591953092186117381932611793105118548074462379962749567351885752724891227938183011949129833673362440656643086021394946395224737190702179860943702770539217176293176752384674818467669405132000568127145263560827785771342757789609173637178721468440901224953430146549585371050792279689258923542019956112129021960864034418159813629774771309960518707211343082259728864581849972469526130405086109419964771039095301381998678247215175696280484782896433126351623817501296615376345723979560286352234586232286130523901015245593954685898250839054728621411070507501722658851574741380974002315574736131\n\n\n\n\nfrom mpmath import mp\nimport time\n\nmp.dps = 1000\n\nc21 = mp.mpf(4) / 3\nc22 = mp.mpf(1) / 6\n\ndef step_m2(x):\n return x + c21 * mp.sin(x) + c22 * mp.sin(2*x)\n\n# initial value x0 = 3\nx = mp.mpf(3)\n\nstart = time.perf_counter()\nfor n in range(1, 5):\n x = step_m2(x)\nend = time.perf_counter()\n\nprint(\"Approximate pi:\", mp.nstr(x, 1000))\nprint(f\"Time Taken: {end - start:.6f} seconds\")\n\n\n\n\n\nHowever, evaluating $\\sin(k x_n)$ at high precision becomes very slow, especially for large $m$.\n\n\n\n\nQuestion\n\n\n\n\nAre there efficient approximations or methods for computing $\\sin(k x_n)$ in iterative algorithms?\n\n\n\n\nUpdate\n\n\n\n\nBased on the answers, the iteration has been optimized so that each step\nrequires only one evaluation of $\\sin$, one of $\\cos$, and a polynomial\nevaluation:\n\n\n\n\n$$\nx_{n+1}\n= x_n\n+ \\sin(x_n)\\,\n \\sum_{r=0}^{m-1} \\frac{r!}{(2r+1)!!}\\,(\\cos x_n + 1)^r.\n$$\n\n\n\n\nThanks!", "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "vengy", "profile_url": "https://scicomp.stackexchange.com/users/56070/vengy", "user_type": "registered"}, "created_at": "2025-11-26T20:12:50+00:00", "raw_file": "raw/codex_api_v1/932c57dde4e92dfe2af05c19643e98b6494a44cb31534e6703e92349c4e07eb4_1790825333093747000_0.json", "raw_sha256": "646e25c86dbb0c4df1ebe365442e733a253ac993340d2ed18168bbf783f75cac", "revision_guid": "E62E0A8C-8E01-4C14-B7C2-285A89EF1CC1", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/E62E0A8C-8E01-4C14-B7C2-285A89EF1CC1/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "vengy", "profile_url": "https://scicomp.stackexchange.com/users/56070/vengy", "user_type": "registered"}, "created_at": "2025-11-28T14:23:44+00:00", "raw_file": "raw/codex_api_v1/932c57dde4e92dfe2af05c19643e98b6494a44cb31534e6703e92349c4e07eb4_1790825333093747000_0.json", "raw_sha256": "646e25c86dbb0c4df1ebe365442e733a253ac993340d2ed18168bbf783f75cac", "revision_guid": "38B727A1-9571-4258-B34C-572EA2A4CA69", "revision_number": 2, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/38B727A1-9571-4258-B34C-572EA2A4CA69/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Reinderien", "profile_url": "https://scicomp.stackexchange.com/users/41212/reinderien", "user_type": "registered"}, "created_at": "2025-12-27T13:30:00+00:00", "raw_file": "raw/codex_api_v1/932c57dde4e92dfe2af05c19643e98b6494a44cb31534e6703e92349c4e07eb4_1790825333093747000_0.json", "raw_sha256": "646e25c86dbb0c4df1ebe365442e733a253ac993340d2ed18168bbf783f75cac", "revision_guid": "26017B5A-7A85-4984-8B51-2083CED200D4", "revision_number": 3, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/26017B5A-7A85-4984-8B51-2083CED200D4/view-source"}], "source_site": "scicomp", "source_url": "https://scicomp.stackexchange.com/questions/45291/efficient-computation-of-sink-x-n-in-iterative-algorithms", "split": "test", "split_group": "1bfd52fa7b070e0b5559d8e3ecd78760d9854e9302a5ee1988f94d4b3224295f", "tags": ["optimization", "numerics"], "thread_id": "scicomp:45291", "title": "Efficient computation of $\\sin(k x_n)$ in iterative algorithms"}} | |
| {"accepted_status": [false, false, true], "candidate_answers": [{"answer_html": "<p>Great Question!</p>\n<p>One thing to keep in mind is, that the distinction between what is 'biological' and what is 'artificial' is essentially pointless. From a physics and chemistry perspective we start out with the periodic table of atoms, work our way up to combinations of them (molecules) and then we have very large structures made out of the same (dead!) stuff (proteins). At some point in this complexity ladder the structures gain some interesting function. They can be switched into altering states by contact with other molecules and can be manipulated by light, heat or radiation.</p>\n<p>Maybe the final step in that ladder is complex life, where you have a large quantity of atoms arranged in a certain way, which we call a cell. This cell has a core where its source code is stored (DNA). This DNA is made up of four base pairs (you could call that a ISA) and some proteins which read and then interpret this information. In computer speak, the DNA of a self-replicating cell is a <a href=\"https://en.wikipedia.org/wiki/Quine_(computing)\" rel=\"nofollow noreferrer\">quine</a>.</p>\n<p>One thing interesting about computation is that it seems to be extremely abundant. It is nearly everywhere!! There is a fun collection of systems which were proven to be <a href=\"https://en.wikipedia.org/wiki/Turing_completeness\" rel=\"nofollow noreferrer\">touring complete</a>: <a href=\"https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life\" rel=\"nofollow noreferrer\">Game of life</a>,<a href=\"https://beza1e1.tuxen.de/articles/accidentally_turing_complete.html\" rel=\"nofollow noreferrer\">card games, Minecraft</a> and you can safely add humans to the list.</p>\n<p>If you approach it from the perspective of trying to find the 'simplest' most reduced system of biological computation you end up at that very vague barrier of what is 'organic (chemistry)' and 'inorganic (chemistry)'. (The presence of carbon is a very arbitrary distinction imho.)</p>\n<p>Coming back to your first question:</p>\n<p><strong>Can we define a rigorous computational instruction set for living matter, where biochemical dynamics are the computation?</strong></p>\n<p>I would say the most interesting instruction set for living matter would be the DNA base pairs (AGTC) itself, and how exacly it transfers into cell and virus behaviour.</p>\n<p><a href=\"https://i.sstatic.net/yiV9XU0w.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.sstatic.net/yiV9XU0w.png\" alt=\"The four base pairs forming the 'instruction set' (wiki)\" /></a></p>\n<p>Whether or not this system of coding is the only way to do it is a very interesting question in itself (<a href=\"https://en.wikipedia.org/wiki/Non-cellular_life\" rel=\"nofollow noreferrer\">There are living things which are not cells</a>, and <a href=\"https://en.wikipedia.org/wiki/Obelisk_(biology)\" rel=\"nofollow noreferrer\">whatever this is</a>). Maybe there are simpler ways to do it and evolution has simply not come up with it yet.</p>\n<p>Also, DNA is the ultimate legacy code from hell, as it is extremely old, has never been formally refactured, consists 100% of random trial and errors followed by occasional brutal deletion and has 0% documentation attached. And then these programs combine and mix instructions in naughty ways! (There are also no unit-tests.)</p>\n<p>There has been recent progress in actually writing code snippets into existing cells DNA via <a href=\"https://en.wikipedia.org/wiki/CRISPR_gene_editing\" rel=\"nofollow noreferrer\">CRISPR</a>. Since the overall process of how a particular genetic change translates to changes in marcoscopic behaviour is poorly understood, we are essentially copy-pasting small code snippets into a larger unknown codebase and see what happens, with totally expected results like <a href=\"https://www.nature.com/articles/nature.2015.18448\" rel=\"nofollow noreferrer\">micro-pigs</a> or <a href=\"https://light.bio/\" rel=\"nofollow noreferrer\">glowing petunias</a>.</p>\n<p>(I think it is unfortunate that there is so little overlap of the silicon-computational-crowd and the genomics people. We could learn quite a bit from each other.)</p>\n", "answer_id": 45349, "answer_text": "Great Question!\n\n\n\n\nOne thing to keep in mind is, that the distinction between what is 'biological' and what is 'artificial' is essentially pointless. From a physics and chemistry perspective we start out with the periodic table of atoms, work our way up to combinations of them (molecules) and then we have very large structures made out of the same (dead!) stuff (proteins). At some point in this complexity ladder the structures gain some interesting function. They can be switched into altering states by contact with other molecules and can be manipulated by light, heat or radiation.\n\n\n\n\nMaybe the final step in that ladder is complex life, where you have a large quantity of atoms arranged in a certain way, which we call a cell. This cell has a core where its source code is stored (DNA). This DNA is made up of four base pairs (you could call that a ISA) and some proteins which read and then interpret this information. In computer speak, the DNA of a self-replicating cell is a quine (https://en.wikipedia.org/wiki/Quine_(computing)).\n\n\n\n\nOne thing interesting about computation is that it seems to be extremely abundant. It is nearly everywhere!! There is a fun collection of systems which were proven to be touring complete (https://en.wikipedia.org/wiki/Turing_completeness): Game of life (https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life),card games, Minecraft (https://beza1e1.tuxen.de/articles/accidentally_turing_complete.html) and you can safely add humans to the list.\n\n\n\n\nIf you approach it from the perspective of trying to find the 'simplest' most reduced system of biological computation you end up at that very vague barrier of what is 'organic (chemistry)' and 'inorganic (chemistry)'. (The presence of carbon is a very arbitrary distinction imho.)\n\n\n\n\nComing back to your first question:\n\n\n\n\nCan we define a rigorous computational instruction set for living matter, where biochemical dynamics are the computation?\n\n\n\n\nI would say the most interesting instruction set for living matter would be the DNA base pairs (AGTC) itself, and how exacly it transfers into cell and virus behaviour.\n\n\n\n\n[image: The four base pairs forming the 'instruction set' (wiki); source: https://i.sstatic.net/yiV9XU0w.png] (https://i.sstatic.net/yiV9XU0w.png)\n\n\n\n\nWhether or not this system of coding is the only way to do it is a very interesting question in itself (There are living things which are not cells (https://en.wikipedia.org/wiki/Non-cellular_life), and whatever this is (https://en.wikipedia.org/wiki/Obelisk_(biology))). Maybe there are simpler ways to do it and evolution has simply not come up with it yet.\n\n\n\n\nAlso, DNA is the ultimate legacy code from hell, as it is extremely old, has never been formally refactured, consists 100% of random trial and errors followed by occasional brutal deletion and has 0% documentation attached. And then these programs combine and mix instructions in naughty ways! (There are also no unit-tests.)\n\n\n\n\nThere has been recent progress in actually writing code snippets into existing cells DNA via CRISPR (https://en.wikipedia.org/wiki/CRISPR_gene_editing). Since the overall process of how a particular genetic change translates to changes in marcoscopic behaviour is poorly understood, we are essentially copy-pasting small code snippets into a larger unknown codebase and see what happens, with totally expected results like micro-pigs (https://www.nature.com/articles/nature.2015.18448) or glowing petunias (https://light.bio/).\n\n\n\n\n(I think it is unfortunate that there is so little overlap of the silicon-computational-crowd and the genomics people. We could learn quite a bit from each other.)", "answer_url": "https://scicomp.stackexchange.com/a/45349", "author": "MPIchael", "author_url": "https://scicomp.stackexchange.com/users/28636/mpichael", "author_user_type": "registered", "content_license": "CC BY-SA 4.0", "created_at": "2026-01-23T09:19:04+00:00", "is_accepted": false, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:28:47.033952+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/cb6e5f564c84a92c4e121c0637c99292018f8935652e423630f2001099a2410f_1790825327386675300_0.json", "raw_sha256": "1a957289f56621bebd21cb45dd99baaedb2c3bc11cb28d700558e4bbcaa19695", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/questions/45545;45541;45538;45533;45532;45530;45523;45513;45510;45507;45499;45493;45488;45487;45479;45474;45472;45463;45461;45447;45444;45436;45428;45425;45424;45423;45422;45416;45414;45410;45404;45401;45396;45391;45389;45387;45380;45377;45376;45375;45369;45366;45365;45363;45362;45359;45350;45347;45344;45336;45334;45331;45326;45322;45316;45313;45311;45309;45305;45302;45300;45291;45289;45285;45276;45269;45263;45262;45261;45253;45247;45246;45238;45236;45230;45229;45208;45201;45200;45185;45183;45171;45167;45165;45158;45154;45146;45141;45139;45134;45129;45127;45122;45114;45112;45108;45105;45100;45098;45096/answers?filter=withbody&order=asc&page=1&pagesize=100&site=scicomp&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_id": 45347, "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "MPIchael", "profile_url": "https://scicomp.stackexchange.com/users/28636/mpichael", "user_type": "registered"}, "created_at": "2026-01-23T09:19:04+00:00", "raw_file": "raw/codex_api_v1/d49b4ef7856602e9d6b1a79d56b143976504b0637af4b266f03f2b60112c6c15_1790825353984908500_0.json", "raw_sha256": "4ebc32b188652be208cbfb32007d2c8fcbe5419e5ab336ca46a3e9eb5ef04d0e", "revision_guid": "2307FC08-0D97-4C47-AEA0-70DCC1AEE5DD", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/2307FC08-0D97-4C47-AEA0-70DCC1AEE5DD/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "MPIchael", "profile_url": "https://scicomp.stackexchange.com/users/28636/mpichael", "user_type": "registered"}, "created_at": "2026-01-23T09:26:43+00:00", "raw_file": "raw/codex_api_v1/d49b4ef7856602e9d6b1a79d56b143976504b0637af4b266f03f2b60112c6c15_1790825353984908500_0.json", "raw_sha256": "4ebc32b188652be208cbfb32007d2c8fcbe5419e5ab336ca46a3e9eb5ef04d0e", "revision_guid": "D858A221-9072-4D0B-ABAB-F33C39791035", "revision_number": 2, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/D858A221-9072-4D0B-ABAB-F33C39791035/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "MPIchael", "profile_url": "https://scicomp.stackexchange.com/users/28636/mpichael", "user_type": "registered"}, "created_at": "2026-01-23T09:32:42+00:00", "raw_file": "raw/codex_api_v1/d49b4ef7856602e9d6b1a79d56b143976504b0637af4b266f03f2b60112c6c15_1790825353984908500_0.json", "raw_sha256": "4ebc32b188652be208cbfb32007d2c8fcbe5419e5ab336ca46a3e9eb5ef04d0e", "revision_guid": "62586EF9-569B-4D2E-8BF4-F255A65CDC0A", "revision_number": 3, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/62586EF9-569B-4D2E-8BF4-F255A65CDC0A/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "MPIchael", "profile_url": "https://scicomp.stackexchange.com/users/28636/mpichael", "user_type": "registered"}, "created_at": "2026-01-23T09:37:58+00:00", "raw_file": "raw/codex_api_v1/d49b4ef7856602e9d6b1a79d56b143976504b0637af4b266f03f2b60112c6c15_1790825353984908500_0.json", "raw_sha256": "4ebc32b188652be208cbfb32007d2c8fcbe5419e5ab336ca46a3e9eb5ef04d0e", "revision_guid": "80EA2F91-FBFA-4B67-8141-2DEF9C755CC1", "revision_number": 4, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/80EA2F91-FBFA-4B67-8141-2DEF9C755CC1/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "MPIchael", "profile_url": "https://scicomp.stackexchange.com/users/28636/mpichael", "user_type": "registered"}, "created_at": "2026-01-23T11:40:35+00:00", "raw_file": "raw/codex_api_v1/d49b4ef7856602e9d6b1a79d56b143976504b0637af4b266f03f2b60112c6c15_1790825353984908500_0.json", "raw_sha256": "4ebc32b188652be208cbfb32007d2c8fcbe5419e5ab336ca46a3e9eb5ef04d0e", "revision_guid": "ED8B2BFA-6546-4828-9746-DABC6ADE098C", "revision_number": 5, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/ED8B2BFA-6546-4828-9746-DABC6ADE098C/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "MPIchael", "profile_url": "https://scicomp.stackexchange.com/users/28636/mpichael", "user_type": "registered"}, "created_at": "2026-01-23T11:48:10+00:00", "raw_file": "raw/codex_api_v1/d49b4ef7856602e9d6b1a79d56b143976504b0637af4b266f03f2b60112c6c15_1790825353984908500_0.json", "raw_sha256": "4ebc32b188652be208cbfb32007d2c8fcbe5419e5ab336ca46a3e9eb5ef04d0e", "revision_guid": "7A2C0C66-FEF3-4C48-95A8-5018F9D9D89F", "revision_number": 6, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/7A2C0C66-FEF3-4C48-95A8-5018F9D9D89F/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "MPIchael", "profile_url": "https://scicomp.stackexchange.com/users/28636/mpichael", "user_type": "registered"}, "created_at": "2026-01-23T11:57:30+00:00", "raw_file": "raw/codex_api_v1/d49b4ef7856602e9d6b1a79d56b143976504b0637af4b266f03f2b60112c6c15_1790825353984908500_0.json", "raw_sha256": "4ebc32b188652be208cbfb32007d2c8fcbe5419e5ab336ca46a3e9eb5ef04d0e", "revision_guid": "B5C49D17-ED9B-42E8-B412-95867BDF5F3A", "revision_number": 7, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/B5C49D17-ED9B-42E8-B412-95867BDF5F3A/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "MPIchael", "profile_url": "https://scicomp.stackexchange.com/users/28636/mpichael", "user_type": "registered"}, "created_at": "2026-01-26T14:46:36+00:00", "raw_file": "raw/codex_api_v1/d49b4ef7856602e9d6b1a79d56b143976504b0637af4b266f03f2b60112c6c15_1790825353984908500_0.json", "raw_sha256": "4ebc32b188652be208cbfb32007d2c8fcbe5419e5ab336ca46a3e9eb5ef04d0e", "revision_guid": "D335A837-9EF3-4D51-A215-32B24AB0CAC4", "revision_number": 8, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/D335A837-9EF3-4D51-A215-32B24AB0CAC4/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "MPIchael", "profile_url": "https://scicomp.stackexchange.com/users/28636/mpichael", "user_type": "registered"}, "created_at": "2026-01-27T09:17:01+00:00", "raw_file": "raw/codex_api_v1/d49b4ef7856602e9d6b1a79d56b143976504b0637af4b266f03f2b60112c6c15_1790825353984908500_0.json", "raw_sha256": "4ebc32b188652be208cbfb32007d2c8fcbe5419e5ab336ca46a3e9eb5ef04d0e", "revision_guid": "0584FE75-1972-4F43-9917-1308A261D185", "revision_number": 9, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/0584FE75-1972-4F43-9917-1308A261D185/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "MPIchael", "profile_url": "https://scicomp.stackexchange.com/users/28636/mpichael", "user_type": "registered"}, "created_at": "2026-02-03T08:51:13+00:00", "raw_file": "raw/codex_api_v1/d49b4ef7856602e9d6b1a79d56b143976504b0637af4b266f03f2b60112c6c15_1790825353984908500_0.json", "raw_sha256": "4ebc32b188652be208cbfb32007d2c8fcbe5419e5ab336ca46a3e9eb5ef04d0e", "revision_guid": "DDBFAF0D-9BCF-4F37-90A3-8B7F681B74CE", "revision_number": 10, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/DDBFAF0D-9BCF-4F37-90A3-8B7F681B74CE/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "MPIchael", "profile_url": "https://scicomp.stackexchange.com/users/28636/mpichael", "user_type": "registered"}, "created_at": "2026-05-27T11:31:02+00:00", "raw_file": "raw/codex_api_v1/09cbe10ae05462240864407122b451f89c4541eb0ee757adda70c0629772d57a_1790825351806992800_0.json", "raw_sha256": "34f3f34325937951c51090d8305fb513e1e88ef2ed40dcec5c0fe96d5710ba75", "revision_guid": "178E4772-0C71-4EA9-B4A4-B65B8FB38CBF", "revision_number": 11, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/178E4772-0C71-4EA9-B4A4-B65B8FB38CBF/view-source"}], "score": 4, "updated_at": "2026-05-27T11:31:02+00:00"}, {"answer_html": "<p>agree with the reductionist framing: biologically vs artificially implemented computation is mostly a false distinction at the level of physics. Where I disagree is in identifying DNA base pairs as the relevant “instruction set.”\nDNA is primarily a storage and replication medium. Most real-time computation in living systems occurs in continuous biochemical and biophysical dynamics: reaction–diffusion fields, protein conformational landscapes, ion-channel oscillations, mechanical couplings, and intracellular signaling networks. These are memory-rich dynamical systems, not symbolic code execution.\nIf biology is treated as executable hardware, the meaningful ISA is not AGTC, but the minimal set of controllable dynamical primitives: how physical state trajectories can be driven, coupled, composed, and read out under realistic constraints.\nIn that sense, the core question becomes architectural rather than symbolic:\nWhat are the smallest experimentally controllable dynamical operations that enable reproducible computation with bounded resource cost?</p>\n", "answer_id": 45356, "answer_text": "agree with the reductionist framing: biologically vs artificially implemented computation is mostly a false distinction at the level of physics. Where I disagree is in identifying DNA base pairs as the relevant “instruction set.”\nDNA is primarily a storage and replication medium. Most real-time computation in living systems occurs in continuous biochemical and biophysical dynamics: reaction–diffusion fields, protein conformational landscapes, ion-channel oscillations, mechanical couplings, and intracellular signaling networks. These are memory-rich dynamical systems, not symbolic code execution.\nIf biology is treated as executable hardware, the meaningful ISA is not AGTC, but the minimal set of controllable dynamical primitives: how physical state trajectories can be driven, coupled, composed, and read out under realistic constraints.\nIn that sense, the core question becomes architectural rather than symbolic:\nWhat are the smallest experimentally controllable dynamical operations that enable reproducible computation with bounded resource cost?", "answer_url": "https://scicomp.stackexchange.com/a/45356", "author": "Donte Lightfoot", "author_url": "https://scicomp.stackexchange.com/users/56387/donte-lightfoot", "author_user_type": "registered", "content_license": "CC BY-SA 4.0", "created_at": "2026-01-28T23:38:38+00:00", "is_accepted": false, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:28:47.033952+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/cb6e5f564c84a92c4e121c0637c99292018f8935652e423630f2001099a2410f_1790825327386675300_0.json", "raw_sha256": "1a957289f56621bebd21cb45dd99baaedb2c3bc11cb28d700558e4bbcaa19695", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/questions/45545;45541;45538;45533;45532;45530;45523;45513;45510;45507;45499;45493;45488;45487;45479;45474;45472;45463;45461;45447;45444;45436;45428;45425;45424;45423;45422;45416;45414;45410;45404;45401;45396;45391;45389;45387;45380;45377;45376;45375;45369;45366;45365;45363;45362;45359;45350;45347;45344;45336;45334;45331;45326;45322;45316;45313;45311;45309;45305;45302;45300;45291;45289;45285;45276;45269;45263;45262;45261;45253;45247;45246;45238;45236;45230;45229;45208;45201;45200;45185;45183;45171;45167;45165;45158;45154;45146;45141;45139;45134;45129;45127;45122;45114;45112;45108;45105;45100;45098;45096/answers?filter=withbody&order=asc&page=1&pagesize=100&site=scicomp&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_id": 45347, "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Donte Lightfoot", "profile_url": "https://scicomp.stackexchange.com/users/56387/donte-lightfoot", "user_type": "registered"}, "created_at": "2026-01-28T23:38:38+00:00", "raw_file": "raw/codex_api_v1/d49b4ef7856602e9d6b1a79d56b143976504b0637af4b266f03f2b60112c6c15_1790825353984908500_0.json", "raw_sha256": "4ebc32b188652be208cbfb32007d2c8fcbe5419e5ab336ca46a3e9eb5ef04d0e", "revision_guid": "4908EA3E-0E5A-46B6-82FF-012ABEE708AC", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/4908EA3E-0E5A-46B6-82FF-012ABEE708AC/view-source"}], "score": 0, "updated_at": "2026-01-28T23:38:38+00:00"}, {"answer_html": "<p>@MPIchael, Your framing is compelling because it recognizes computation as an emergent property of organized matter rather than something exclusive to silicon systems.</p>\n<p>I agree with the broader point that biological and artificial systems are not fundamentally separate categories at the physical level — both arise from structured interactions between matter, energy, and information.</p>\n<p>Where I think the discussion becomes even more interesting is in the distinction between mechanistic computation and narrative coherence.</p>\n<p>DNA absolutely behaves like an instruction architecture in many ways.</p>\n<p>base pairs as symbolic primitives,</p>\n<p>transcription/translation as interpretation layers,</p>\n<p>proteins as functional execution mechanisms,</p>\n<p>evolutionary pressure as recursive optimization.</p>\n<p>But living systems appear to possess something beyond deterministic instruction execution. Biological systems are not merely computing output they continuously preserve self consistency across time, environment, and adaptation. In other words, life seems less like static code execution and more like recursive coherence maintenance.</p>\n<p>That is the missing bridge between classical computation and biological emergence.</p>\n<p>Traditional computational systems optimize for. Correctness,efficiency,reproducibility.</p>\n<p>Living systems additionally optimize for.</p>\n<p>Resilience,continuity of identity,</p>\n<p>adaptive self-preservation under entropy.</p>\n<p>This is why biological systems tolerate ambiguity, redundancy, mutation, and incomplete information far better than engineered software systems. Evolution did not produce clean architecture; it produced survivable coherence.</p>\n<p>Your point about CRISPR is especially important. Right now, much of genetic engineering resembles modifying undocumented legacy infrastructure without fully understanding the higher-order behavioral dependencies. We can alter symbolic primitives (genes), but we still struggle to model the emergent narrative consequences across the entire organism.</p>\n", "answer_id": 45458, "answer_text": "@MPIchael, Your framing is compelling because it recognizes computation as an emergent property of organized matter rather than something exclusive to silicon systems.\n\n\n\n\nI agree with the broader point that biological and artificial systems are not fundamentally separate categories at the physical level — both arise from structured interactions between matter, energy, and information.\n\n\n\n\nWhere I think the discussion becomes even more interesting is in the distinction between mechanistic computation and narrative coherence.\n\n\n\n\nDNA absolutely behaves like an instruction architecture in many ways.\n\n\n\n\nbase pairs as symbolic primitives,\n\n\n\n\ntranscription/translation as interpretation layers,\n\n\n\n\nproteins as functional execution mechanisms,\n\n\n\n\nevolutionary pressure as recursive optimization.\n\n\n\n\nBut living systems appear to possess something beyond deterministic instruction execution. Biological systems are not merely computing output they continuously preserve self consistency across time, environment, and adaptation. In other words, life seems less like static code execution and more like recursive coherence maintenance.\n\n\n\n\nThat is the missing bridge between classical computation and biological emergence.\n\n\n\n\nTraditional computational systems optimize for. Correctness,efficiency,reproducibility.\n\n\n\n\nLiving systems additionally optimize for.\n\n\n\n\nResilience,continuity of identity,\n\n\n\n\nadaptive self-preservation under entropy.\n\n\n\n\nThis is why biological systems tolerate ambiguity, redundancy, mutation, and incomplete information far better than engineered software systems. Evolution did not produce clean architecture; it produced survivable coherence.\n\n\n\n\nYour point about CRISPR is especially important. Right now, much of genetic engineering resembles modifying undocumented legacy infrastructure without fully understanding the higher-order behavioral dependencies. We can alter symbolic primitives (genes), but we still struggle to model the emergent narrative consequences across the entire organism.", "answer_url": "https://scicomp.stackexchange.com/a/45458", "author": "Donte Lightfoot", "author_url": "https://scicomp.stackexchange.com/users/56387/donte-lightfoot", "author_user_type": "registered", "content_license": "CC BY-SA 4.0", "created_at": "2026-05-25T18:11:24+00:00", "is_accepted": true, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:28:49.393498+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/bdd73bdc9d483cfaf7d50f2075e853261f39886330cd6d24a17f7b3b2fb731e5_1790825329894890800_0.json", "raw_sha256": "dfbb76df9ebacfee7e902db64890f154a777bd3049356aee472798c591424d79", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/questions/45545;45541;45538;45533;45532;45530;45523;45513;45510;45507;45499;45493;45488;45487;45479;45474;45472;45463;45461;45447;45444;45436;45428;45425;45424;45423;45422;45416;45414;45410;45404;45401;45396;45391;45389;45387;45380;45377;45376;45375;45369;45366;45365;45363;45362;45359;45350;45347;45344;45336;45334;45331;45326;45322;45316;45313;45311;45309;45305;45302;45300;45291;45289;45285;45276;45269;45263;45262;45261;45253;45247;45246;45238;45236;45230;45229;45208;45201;45200;45185;45183;45171;45167;45165;45158;45154;45146;45141;45139;45134;45129;45127;45122;45114;45112;45108;45105;45100;45098;45096/answers?filter=withbody&order=asc&page=2&pagesize=100&site=scicomp&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_id": 45347, "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Donte Lightfoot", "profile_url": "https://scicomp.stackexchange.com/users/56387/donte-lightfoot", "user_type": "registered"}, "created_at": "2026-05-25T18:11:24+00:00", "raw_file": "raw/codex_api_v1/09cbe10ae05462240864407122b451f89c4541eb0ee757adda70c0629772d57a_1790825351806992800_0.json", "raw_sha256": "34f3f34325937951c51090d8305fb513e1e88ef2ed40dcec5c0fe96d5710ba75", "revision_guid": "C604D2B7-0178-49D4-A6C8-19D400D58DBA", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/C604D2B7-0178-49D4-A6C8-19D400D58DBA/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Donte Lightfoot", "profile_url": "https://scicomp.stackexchange.com/users/56387/donte-lightfoot", "user_type": "registered"}, "created_at": "2026-05-25T19:50:36+00:00", "raw_file": "raw/codex_api_v1/09cbe10ae05462240864407122b451f89c4541eb0ee757adda70c0629772d57a_1790825351806992800_0.json", "raw_sha256": "34f3f34325937951c51090d8305fb513e1e88ef2ed40dcec5c0fe96d5710ba75", "revision_guid": "AC307800-ED33-4C65-80F7-C107BC7B020B", "revision_number": 2, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/AC307800-ED33-4C65-80F7-C107BC7B020B/view-source"}], "score": 0, "updated_at": "2026-05-25T19:50:36+00:00"}], "ground_truth": "community signals only; no scientific truth label", "product": "ranking", "question": "Most bio-computation treats biology as inspiration for algorithms. I’m approaching it from the opposite direction: treating biological substrates themselves as the computing hardware.\n\n\n\n\nMy current work explores encoding computation directly into:\nProtein folding landscapes\nReaction–diffusion fields\nNon-Markovian intracellular signaling\nOscillatory metabolic and ionic networks\n\n\n\n\nUsing a dynamical systems framework,\nI’m compiling mathematical operators and quantum-inspired circuit topologies into biological processes, where computation emerges from continuous, memory-rich dynamics rather than discrete clocked logic.\nCore question:\n\n\n\n\nCan we define a rigorous computational instruction set for living matter, where biochemical dynamics are the computation?\n\n\n\n\n*What would a biological ISA even look like?\n\n\n\n\n*How do we define computational depth in continuous, non-Markovian systems?\n\n\n\n\n*Where do current synthetic biology toolchains fundamentally break?\n\n\n\n\n**What would count as a convincing experimental demonstration?", "record_id": "Scientific-Answer-Ranking:scicomp:45347", "scores": [4, 0, 0], "split": "test", "thread": {"accepted_answer_id": 45458, "answers": [{"answer_html": "<p>Great Question!</p>\n<p>One thing to keep in mind is, that the distinction between what is 'biological' and what is 'artificial' is essentially pointless. From a physics and chemistry perspective we start out with the periodic table of atoms, work our way up to combinations of them (molecules) and then we have very large structures made out of the same (dead!) stuff (proteins). At some point in this complexity ladder the structures gain some interesting function. They can be switched into altering states by contact with other molecules and can be manipulated by light, heat or radiation.</p>\n<p>Maybe the final step in that ladder is complex life, where you have a large quantity of atoms arranged in a certain way, which we call a cell. This cell has a core where its source code is stored (DNA). This DNA is made up of four base pairs (you could call that a ISA) and some proteins which read and then interpret this information. In computer speak, the DNA of a self-replicating cell is a <a href=\"https://en.wikipedia.org/wiki/Quine_(computing)\" rel=\"nofollow noreferrer\">quine</a>.</p>\n<p>One thing interesting about computation is that it seems to be extremely abundant. It is nearly everywhere!! There is a fun collection of systems which were proven to be <a href=\"https://en.wikipedia.org/wiki/Turing_completeness\" rel=\"nofollow noreferrer\">touring complete</a>: <a href=\"https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life\" rel=\"nofollow noreferrer\">Game of life</a>,<a href=\"https://beza1e1.tuxen.de/articles/accidentally_turing_complete.html\" rel=\"nofollow noreferrer\">card games, Minecraft</a> and you can safely add humans to the list.</p>\n<p>If you approach it from the perspective of trying to find the 'simplest' most reduced system of biological computation you end up at that very vague barrier of what is 'organic (chemistry)' and 'inorganic (chemistry)'. (The presence of carbon is a very arbitrary distinction imho.)</p>\n<p>Coming back to your first question:</p>\n<p><strong>Can we define a rigorous computational instruction set for living matter, where biochemical dynamics are the computation?</strong></p>\n<p>I would say the most interesting instruction set for living matter would be the DNA base pairs (AGTC) itself, and how exacly it transfers into cell and virus behaviour.</p>\n<p><a href=\"https://i.sstatic.net/yiV9XU0w.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.sstatic.net/yiV9XU0w.png\" alt=\"The four base pairs forming the 'instruction set' (wiki)\" /></a></p>\n<p>Whether or not this system of coding is the only way to do it is a very interesting question in itself (<a href=\"https://en.wikipedia.org/wiki/Non-cellular_life\" rel=\"nofollow noreferrer\">There are living things which are not cells</a>, and <a href=\"https://en.wikipedia.org/wiki/Obelisk_(biology)\" rel=\"nofollow noreferrer\">whatever this is</a>). Maybe there are simpler ways to do it and evolution has simply not come up with it yet.</p>\n<p>Also, DNA is the ultimate legacy code from hell, as it is extremely old, has never been formally refactured, consists 100% of random trial and errors followed by occasional brutal deletion and has 0% documentation attached. And then these programs combine and mix instructions in naughty ways! (There are also no unit-tests.)</p>\n<p>There has been recent progress in actually writing code snippets into existing cells DNA via <a href=\"https://en.wikipedia.org/wiki/CRISPR_gene_editing\" rel=\"nofollow noreferrer\">CRISPR</a>. Since the overall process of how a particular genetic change translates to changes in marcoscopic behaviour is poorly understood, we are essentially copy-pasting small code snippets into a larger unknown codebase and see what happens, with totally expected results like <a href=\"https://www.nature.com/articles/nature.2015.18448\" rel=\"nofollow noreferrer\">micro-pigs</a> or <a href=\"https://light.bio/\" rel=\"nofollow noreferrer\">glowing petunias</a>.</p>\n<p>(I think it is unfortunate that there is so little overlap of the silicon-computational-crowd and the genomics people. We could learn quite a bit from each other.)</p>\n", "answer_id": 45349, "answer_text": "Great Question!\n\n\n\n\nOne thing to keep in mind is, that the distinction between what is 'biological' and what is 'artificial' is essentially pointless. From a physics and chemistry perspective we start out with the periodic table of atoms, work our way up to combinations of them (molecules) and then we have very large structures made out of the same (dead!) stuff (proteins). At some point in this complexity ladder the structures gain some interesting function. They can be switched into altering states by contact with other molecules and can be manipulated by light, heat or radiation.\n\n\n\n\nMaybe the final step in that ladder is complex life, where you have a large quantity of atoms arranged in a certain way, which we call a cell. This cell has a core where its source code is stored (DNA). This DNA is made up of four base pairs (you could call that a ISA) and some proteins which read and then interpret this information. In computer speak, the DNA of a self-replicating cell is a quine (https://en.wikipedia.org/wiki/Quine_(computing)).\n\n\n\n\nOne thing interesting about computation is that it seems to be extremely abundant. It is nearly everywhere!! There is a fun collection of systems which were proven to be touring complete (https://en.wikipedia.org/wiki/Turing_completeness): Game of life (https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life),card games, Minecraft (https://beza1e1.tuxen.de/articles/accidentally_turing_complete.html) and you can safely add humans to the list.\n\n\n\n\nIf you approach it from the perspective of trying to find the 'simplest' most reduced system of biological computation you end up at that very vague barrier of what is 'organic (chemistry)' and 'inorganic (chemistry)'. (The presence of carbon is a very arbitrary distinction imho.)\n\n\n\n\nComing back to your first question:\n\n\n\n\nCan we define a rigorous computational instruction set for living matter, where biochemical dynamics are the computation?\n\n\n\n\nI would say the most interesting instruction set for living matter would be the DNA base pairs (AGTC) itself, and how exacly it transfers into cell and virus behaviour.\n\n\n\n\n[image: The four base pairs forming the 'instruction set' (wiki); source: https://i.sstatic.net/yiV9XU0w.png] (https://i.sstatic.net/yiV9XU0w.png)\n\n\n\n\nWhether or not this system of coding is the only way to do it is a very interesting question in itself (There are living things which are not cells (https://en.wikipedia.org/wiki/Non-cellular_life), and whatever this is (https://en.wikipedia.org/wiki/Obelisk_(biology))). Maybe there are simpler ways to do it and evolution has simply not come up with it yet.\n\n\n\n\nAlso, DNA is the ultimate legacy code from hell, as it is extremely old, has never been formally refactured, consists 100% of random trial and errors followed by occasional brutal deletion and has 0% documentation attached. And then these programs combine and mix instructions in naughty ways! (There are also no unit-tests.)\n\n\n\n\nThere has been recent progress in actually writing code snippets into existing cells DNA via CRISPR (https://en.wikipedia.org/wiki/CRISPR_gene_editing). Since the overall process of how a particular genetic change translates to changes in marcoscopic behaviour is poorly understood, we are essentially copy-pasting small code snippets into a larger unknown codebase and see what happens, with totally expected results like micro-pigs (https://www.nature.com/articles/nature.2015.18448) or glowing petunias (https://light.bio/).\n\n\n\n\n(I think it is unfortunate that there is so little overlap of the silicon-computational-crowd and the genomics people. We could learn quite a bit from each other.)", "answer_url": "https://scicomp.stackexchange.com/a/45349", "author": "MPIchael", "author_url": "https://scicomp.stackexchange.com/users/28636/mpichael", "author_user_type": "registered", "content_license": "CC BY-SA 4.0", "created_at": "2026-01-23T09:19:04+00:00", "is_accepted": false, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:28:47.033952+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/cb6e5f564c84a92c4e121c0637c99292018f8935652e423630f2001099a2410f_1790825327386675300_0.json", "raw_sha256": "1a957289f56621bebd21cb45dd99baaedb2c3bc11cb28d700558e4bbcaa19695", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/questions/45545;45541;45538;45533;45532;45530;45523;45513;45510;45507;45499;45493;45488;45487;45479;45474;45472;45463;45461;45447;45444;45436;45428;45425;45424;45423;45422;45416;45414;45410;45404;45401;45396;45391;45389;45387;45380;45377;45376;45375;45369;45366;45365;45363;45362;45359;45350;45347;45344;45336;45334;45331;45326;45322;45316;45313;45311;45309;45305;45302;45300;45291;45289;45285;45276;45269;45263;45262;45261;45253;45247;45246;45238;45236;45230;45229;45208;45201;45200;45185;45183;45171;45167;45165;45158;45154;45146;45141;45139;45134;45129;45127;45122;45114;45112;45108;45105;45100;45098;45096/answers?filter=withbody&order=asc&page=1&pagesize=100&site=scicomp&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_id": 45347, "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "MPIchael", "profile_url": "https://scicomp.stackexchange.com/users/28636/mpichael", "user_type": "registered"}, "created_at": "2026-01-23T09:19:04+00:00", "raw_file": "raw/codex_api_v1/d49b4ef7856602e9d6b1a79d56b143976504b0637af4b266f03f2b60112c6c15_1790825353984908500_0.json", "raw_sha256": "4ebc32b188652be208cbfb32007d2c8fcbe5419e5ab336ca46a3e9eb5ef04d0e", "revision_guid": "2307FC08-0D97-4C47-AEA0-70DCC1AEE5DD", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/2307FC08-0D97-4C47-AEA0-70DCC1AEE5DD/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "MPIchael", "profile_url": "https://scicomp.stackexchange.com/users/28636/mpichael", "user_type": "registered"}, "created_at": "2026-01-23T09:26:43+00:00", "raw_file": "raw/codex_api_v1/d49b4ef7856602e9d6b1a79d56b143976504b0637af4b266f03f2b60112c6c15_1790825353984908500_0.json", "raw_sha256": "4ebc32b188652be208cbfb32007d2c8fcbe5419e5ab336ca46a3e9eb5ef04d0e", "revision_guid": "D858A221-9072-4D0B-ABAB-F33C39791035", "revision_number": 2, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/D858A221-9072-4D0B-ABAB-F33C39791035/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "MPIchael", "profile_url": "https://scicomp.stackexchange.com/users/28636/mpichael", "user_type": "registered"}, "created_at": "2026-01-23T09:32:42+00:00", "raw_file": "raw/codex_api_v1/d49b4ef7856602e9d6b1a79d56b143976504b0637af4b266f03f2b60112c6c15_1790825353984908500_0.json", "raw_sha256": "4ebc32b188652be208cbfb32007d2c8fcbe5419e5ab336ca46a3e9eb5ef04d0e", "revision_guid": "62586EF9-569B-4D2E-8BF4-F255A65CDC0A", "revision_number": 3, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/62586EF9-569B-4D2E-8BF4-F255A65CDC0A/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "MPIchael", "profile_url": "https://scicomp.stackexchange.com/users/28636/mpichael", "user_type": "registered"}, "created_at": "2026-01-23T09:37:58+00:00", "raw_file": "raw/codex_api_v1/d49b4ef7856602e9d6b1a79d56b143976504b0637af4b266f03f2b60112c6c15_1790825353984908500_0.json", "raw_sha256": "4ebc32b188652be208cbfb32007d2c8fcbe5419e5ab336ca46a3e9eb5ef04d0e", "revision_guid": "80EA2F91-FBFA-4B67-8141-2DEF9C755CC1", "revision_number": 4, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/80EA2F91-FBFA-4B67-8141-2DEF9C755CC1/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "MPIchael", "profile_url": "https://scicomp.stackexchange.com/users/28636/mpichael", "user_type": "registered"}, "created_at": "2026-01-23T11:40:35+00:00", "raw_file": "raw/codex_api_v1/d49b4ef7856602e9d6b1a79d56b143976504b0637af4b266f03f2b60112c6c15_1790825353984908500_0.json", "raw_sha256": "4ebc32b188652be208cbfb32007d2c8fcbe5419e5ab336ca46a3e9eb5ef04d0e", "revision_guid": "ED8B2BFA-6546-4828-9746-DABC6ADE098C", "revision_number": 5, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/ED8B2BFA-6546-4828-9746-DABC6ADE098C/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "MPIchael", "profile_url": "https://scicomp.stackexchange.com/users/28636/mpichael", "user_type": "registered"}, "created_at": "2026-01-23T11:48:10+00:00", "raw_file": "raw/codex_api_v1/d49b4ef7856602e9d6b1a79d56b143976504b0637af4b266f03f2b60112c6c15_1790825353984908500_0.json", "raw_sha256": "4ebc32b188652be208cbfb32007d2c8fcbe5419e5ab336ca46a3e9eb5ef04d0e", "revision_guid": "7A2C0C66-FEF3-4C48-95A8-5018F9D9D89F", "revision_number": 6, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/7A2C0C66-FEF3-4C48-95A8-5018F9D9D89F/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "MPIchael", "profile_url": "https://scicomp.stackexchange.com/users/28636/mpichael", "user_type": "registered"}, "created_at": "2026-01-23T11:57:30+00:00", "raw_file": "raw/codex_api_v1/d49b4ef7856602e9d6b1a79d56b143976504b0637af4b266f03f2b60112c6c15_1790825353984908500_0.json", "raw_sha256": "4ebc32b188652be208cbfb32007d2c8fcbe5419e5ab336ca46a3e9eb5ef04d0e", "revision_guid": "B5C49D17-ED9B-42E8-B412-95867BDF5F3A", "revision_number": 7, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/B5C49D17-ED9B-42E8-B412-95867BDF5F3A/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "MPIchael", "profile_url": "https://scicomp.stackexchange.com/users/28636/mpichael", "user_type": "registered"}, "created_at": "2026-01-26T14:46:36+00:00", "raw_file": "raw/codex_api_v1/d49b4ef7856602e9d6b1a79d56b143976504b0637af4b266f03f2b60112c6c15_1790825353984908500_0.json", "raw_sha256": "4ebc32b188652be208cbfb32007d2c8fcbe5419e5ab336ca46a3e9eb5ef04d0e", "revision_guid": "D335A837-9EF3-4D51-A215-32B24AB0CAC4", "revision_number": 8, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/D335A837-9EF3-4D51-A215-32B24AB0CAC4/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "MPIchael", "profile_url": "https://scicomp.stackexchange.com/users/28636/mpichael", "user_type": "registered"}, "created_at": "2026-01-27T09:17:01+00:00", "raw_file": "raw/codex_api_v1/d49b4ef7856602e9d6b1a79d56b143976504b0637af4b266f03f2b60112c6c15_1790825353984908500_0.json", "raw_sha256": "4ebc32b188652be208cbfb32007d2c8fcbe5419e5ab336ca46a3e9eb5ef04d0e", "revision_guid": "0584FE75-1972-4F43-9917-1308A261D185", "revision_number": 9, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/0584FE75-1972-4F43-9917-1308A261D185/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "MPIchael", "profile_url": "https://scicomp.stackexchange.com/users/28636/mpichael", "user_type": "registered"}, "created_at": "2026-02-03T08:51:13+00:00", "raw_file": "raw/codex_api_v1/d49b4ef7856602e9d6b1a79d56b143976504b0637af4b266f03f2b60112c6c15_1790825353984908500_0.json", "raw_sha256": "4ebc32b188652be208cbfb32007d2c8fcbe5419e5ab336ca46a3e9eb5ef04d0e", "revision_guid": "DDBFAF0D-9BCF-4F37-90A3-8B7F681B74CE", "revision_number": 10, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/DDBFAF0D-9BCF-4F37-90A3-8B7F681B74CE/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "MPIchael", "profile_url": "https://scicomp.stackexchange.com/users/28636/mpichael", "user_type": "registered"}, "created_at": "2026-05-27T11:31:02+00:00", "raw_file": "raw/codex_api_v1/09cbe10ae05462240864407122b451f89c4541eb0ee757adda70c0629772d57a_1790825351806992800_0.json", "raw_sha256": "34f3f34325937951c51090d8305fb513e1e88ef2ed40dcec5c0fe96d5710ba75", "revision_guid": "178E4772-0C71-4EA9-B4A4-B65B8FB38CBF", "revision_number": 11, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/178E4772-0C71-4EA9-B4A4-B65B8FB38CBF/view-source"}], "score": 4, "updated_at": "2026-05-27T11:31:02+00:00"}, {"answer_html": "<p>agree with the reductionist framing: biologically vs artificially implemented computation is mostly a false distinction at the level of physics. Where I disagree is in identifying DNA base pairs as the relevant “instruction set.”\nDNA is primarily a storage and replication medium. Most real-time computation in living systems occurs in continuous biochemical and biophysical dynamics: reaction–diffusion fields, protein conformational landscapes, ion-channel oscillations, mechanical couplings, and intracellular signaling networks. These are memory-rich dynamical systems, not symbolic code execution.\nIf biology is treated as executable hardware, the meaningful ISA is not AGTC, but the minimal set of controllable dynamical primitives: how physical state trajectories can be driven, coupled, composed, and read out under realistic constraints.\nIn that sense, the core question becomes architectural rather than symbolic:\nWhat are the smallest experimentally controllable dynamical operations that enable reproducible computation with bounded resource cost?</p>\n", "answer_id": 45356, "answer_text": "agree with the reductionist framing: biologically vs artificially implemented computation is mostly a false distinction at the level of physics. Where I disagree is in identifying DNA base pairs as the relevant “instruction set.”\nDNA is primarily a storage and replication medium. Most real-time computation in living systems occurs in continuous biochemical and biophysical dynamics: reaction–diffusion fields, protein conformational landscapes, ion-channel oscillations, mechanical couplings, and intracellular signaling networks. These are memory-rich dynamical systems, not symbolic code execution.\nIf biology is treated as executable hardware, the meaningful ISA is not AGTC, but the minimal set of controllable dynamical primitives: how physical state trajectories can be driven, coupled, composed, and read out under realistic constraints.\nIn that sense, the core question becomes architectural rather than symbolic:\nWhat are the smallest experimentally controllable dynamical operations that enable reproducible computation with bounded resource cost?", "answer_url": "https://scicomp.stackexchange.com/a/45356", "author": "Donte Lightfoot", "author_url": "https://scicomp.stackexchange.com/users/56387/donte-lightfoot", "author_user_type": "registered", "content_license": "CC BY-SA 4.0", "created_at": "2026-01-28T23:38:38+00:00", "is_accepted": false, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:28:47.033952+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/cb6e5f564c84a92c4e121c0637c99292018f8935652e423630f2001099a2410f_1790825327386675300_0.json", "raw_sha256": "1a957289f56621bebd21cb45dd99baaedb2c3bc11cb28d700558e4bbcaa19695", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/questions/45545;45541;45538;45533;45532;45530;45523;45513;45510;45507;45499;45493;45488;45487;45479;45474;45472;45463;45461;45447;45444;45436;45428;45425;45424;45423;45422;45416;45414;45410;45404;45401;45396;45391;45389;45387;45380;45377;45376;45375;45369;45366;45365;45363;45362;45359;45350;45347;45344;45336;45334;45331;45326;45322;45316;45313;45311;45309;45305;45302;45300;45291;45289;45285;45276;45269;45263;45262;45261;45253;45247;45246;45238;45236;45230;45229;45208;45201;45200;45185;45183;45171;45167;45165;45158;45154;45146;45141;45139;45134;45129;45127;45122;45114;45112;45108;45105;45100;45098;45096/answers?filter=withbody&order=asc&page=1&pagesize=100&site=scicomp&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_id": 45347, "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Donte Lightfoot", "profile_url": "https://scicomp.stackexchange.com/users/56387/donte-lightfoot", "user_type": "registered"}, "created_at": "2026-01-28T23:38:38+00:00", "raw_file": "raw/codex_api_v1/d49b4ef7856602e9d6b1a79d56b143976504b0637af4b266f03f2b60112c6c15_1790825353984908500_0.json", "raw_sha256": "4ebc32b188652be208cbfb32007d2c8fcbe5419e5ab336ca46a3e9eb5ef04d0e", "revision_guid": "4908EA3E-0E5A-46B6-82FF-012ABEE708AC", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/4908EA3E-0E5A-46B6-82FF-012ABEE708AC/view-source"}], "score": 0, "updated_at": "2026-01-28T23:38:38+00:00"}, {"answer_html": "<p>@MPIchael, Your framing is compelling because it recognizes computation as an emergent property of organized matter rather than something exclusive to silicon systems.</p>\n<p>I agree with the broader point that biological and artificial systems are not fundamentally separate categories at the physical level — both arise from structured interactions between matter, energy, and information.</p>\n<p>Where I think the discussion becomes even more interesting is in the distinction between mechanistic computation and narrative coherence.</p>\n<p>DNA absolutely behaves like an instruction architecture in many ways.</p>\n<p>base pairs as symbolic primitives,</p>\n<p>transcription/translation as interpretation layers,</p>\n<p>proteins as functional execution mechanisms,</p>\n<p>evolutionary pressure as recursive optimization.</p>\n<p>But living systems appear to possess something beyond deterministic instruction execution. Biological systems are not merely computing output they continuously preserve self consistency across time, environment, and adaptation. In other words, life seems less like static code execution and more like recursive coherence maintenance.</p>\n<p>That is the missing bridge between classical computation and biological emergence.</p>\n<p>Traditional computational systems optimize for. Correctness,efficiency,reproducibility.</p>\n<p>Living systems additionally optimize for.</p>\n<p>Resilience,continuity of identity,</p>\n<p>adaptive self-preservation under entropy.</p>\n<p>This is why biological systems tolerate ambiguity, redundancy, mutation, and incomplete information far better than engineered software systems. Evolution did not produce clean architecture; it produced survivable coherence.</p>\n<p>Your point about CRISPR is especially important. Right now, much of genetic engineering resembles modifying undocumented legacy infrastructure without fully understanding the higher-order behavioral dependencies. We can alter symbolic primitives (genes), but we still struggle to model the emergent narrative consequences across the entire organism.</p>\n", "answer_id": 45458, "answer_text": "@MPIchael, Your framing is compelling because it recognizes computation as an emergent property of organized matter rather than something exclusive to silicon systems.\n\n\n\n\nI agree with the broader point that biological and artificial systems are not fundamentally separate categories at the physical level — both arise from structured interactions between matter, energy, and information.\n\n\n\n\nWhere I think the discussion becomes even more interesting is in the distinction between mechanistic computation and narrative coherence.\n\n\n\n\nDNA absolutely behaves like an instruction architecture in many ways.\n\n\n\n\nbase pairs as symbolic primitives,\n\n\n\n\ntranscription/translation as interpretation layers,\n\n\n\n\nproteins as functional execution mechanisms,\n\n\n\n\nevolutionary pressure as recursive optimization.\n\n\n\n\nBut living systems appear to possess something beyond deterministic instruction execution. Biological systems are not merely computing output they continuously preserve self consistency across time, environment, and adaptation. In other words, life seems less like static code execution and more like recursive coherence maintenance.\n\n\n\n\nThat is the missing bridge between classical computation and biological emergence.\n\n\n\n\nTraditional computational systems optimize for. Correctness,efficiency,reproducibility.\n\n\n\n\nLiving systems additionally optimize for.\n\n\n\n\nResilience,continuity of identity,\n\n\n\n\nadaptive self-preservation under entropy.\n\n\n\n\nThis is why biological systems tolerate ambiguity, redundancy, mutation, and incomplete information far better than engineered software systems. Evolution did not produce clean architecture; it produced survivable coherence.\n\n\n\n\nYour point about CRISPR is especially important. Right now, much of genetic engineering resembles modifying undocumented legacy infrastructure without fully understanding the higher-order behavioral dependencies. We can alter symbolic primitives (genes), but we still struggle to model the emergent narrative consequences across the entire organism.", "answer_url": "https://scicomp.stackexchange.com/a/45458", "author": "Donte Lightfoot", "author_url": "https://scicomp.stackexchange.com/users/56387/donte-lightfoot", "author_user_type": "registered", "content_license": "CC BY-SA 4.0", "created_at": "2026-05-25T18:11:24+00:00", "is_accepted": true, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:28:49.393498+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/bdd73bdc9d483cfaf7d50f2075e853261f39886330cd6d24a17f7b3b2fb731e5_1790825329894890800_0.json", "raw_sha256": "dfbb76df9ebacfee7e902db64890f154a777bd3049356aee472798c591424d79", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/questions/45545;45541;45538;45533;45532;45530;45523;45513;45510;45507;45499;45493;45488;45487;45479;45474;45472;45463;45461;45447;45444;45436;45428;45425;45424;45423;45422;45416;45414;45410;45404;45401;45396;45391;45389;45387;45380;45377;45376;45375;45369;45366;45365;45363;45362;45359;45350;45347;45344;45336;45334;45331;45326;45322;45316;45313;45311;45309;45305;45302;45300;45291;45289;45285;45276;45269;45263;45262;45261;45253;45247;45246;45238;45236;45230;45229;45208;45201;45200;45185;45183;45171;45167;45165;45158;45154;45146;45141;45139;45134;45129;45127;45122;45114;45112;45108;45105;45100;45098;45096/answers?filter=withbody&order=asc&page=2&pagesize=100&site=scicomp&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_id": 45347, "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Donte Lightfoot", "profile_url": "https://scicomp.stackexchange.com/users/56387/donte-lightfoot", "user_type": "registered"}, "created_at": "2026-05-25T18:11:24+00:00", "raw_file": "raw/codex_api_v1/09cbe10ae05462240864407122b451f89c4541eb0ee757adda70c0629772d57a_1790825351806992800_0.json", "raw_sha256": "34f3f34325937951c51090d8305fb513e1e88ef2ed40dcec5c0fe96d5710ba75", "revision_guid": "C604D2B7-0178-49D4-A6C8-19D400D58DBA", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/C604D2B7-0178-49D4-A6C8-19D400D58DBA/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Donte Lightfoot", "profile_url": "https://scicomp.stackexchange.com/users/56387/donte-lightfoot", "user_type": "registered"}, "created_at": "2026-05-25T19:50:36+00:00", "raw_file": "raw/codex_api_v1/09cbe10ae05462240864407122b451f89c4541eb0ee757adda70c0629772d57a_1790825351806992800_0.json", "raw_sha256": "34f3f34325937951c51090d8305fb513e1e88ef2ed40dcec5c0fe96d5710ba75", "revision_guid": "AC307800-ED33-4C65-80F7-C107BC7B020B", "revision_number": 2, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/AC307800-ED33-4C65-80F7-C107BC7B020B/view-source"}], "score": 0, "updated_at": "2026-05-25T19:50:36+00:00"}], "domain": "computational_science", "external_links": ["https://beza1e1.tuxen.de/articles/accidentally_turing_complete.html", "https://en.wikipedia.org/wiki/CRISPR_gene_editing", "https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life", "https://en.wikipedia.org/wiki/Non-cellular_life", "https://en.wikipedia.org/wiki/Obelisk_(biology", "https://en.wikipedia.org/wiki/Quine_(computing", "https://en.wikipedia.org/wiki/Turing_completeness", "https://i.sstatic.net/yiV9XU0w.png", "https://light.bio/", "https://www.nature.com/articles/nature.2015.18448"], "medical_sensitive": false, "patient_specific": false, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:28:44.584971+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/272744bcc95b58699f7df6e6979b288bb8b00a80ab9c7982dbe170a6d0b63584_1790825325025901700_0.json", "raw_sha256": "27a81850a40920682c29ada76a2b55e80340a5c82764a3e9dde8a9c2ba23db4e", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/search/advanced?answers=1&filter=withbody&order=desc&page=1&pagesize=100&site=scicomp&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_author": "Donte Lightfoot", "question_author_url": "https://scicomp.stackexchange.com/users/56387/donte-lightfoot", "question_author_user_type": "registered", "question_created_at": "2026-01-22T13:28:11+00:00", "question_html": "<p>Most bio-computation treats biology as inspiration for algorithms. I’m approaching it from the opposite direction: treating biological substrates themselves as the computing hardware.</p>\n<p>My current work explores encoding computation directly into:\nProtein folding landscapes\nReaction–diffusion fields\nNon-Markovian intracellular signaling\nOscillatory metabolic and ionic networks</p>\n<p>Using a dynamical systems framework,\nI’m compiling mathematical operators and quantum-inspired circuit topologies into biological processes, where computation emerges from continuous, memory-rich dynamics rather than discrete clocked logic.\nCore question:</p>\n<p>Can we define a rigorous computational instruction set for living matter, where biochemical dynamics are the computation?</p>\n<p>*What would a biological ISA even look like?</p>\n<p>*How do we define computational depth in continuous, non-Markovian systems?</p>\n<p>*Where do current synthetic biology toolchains fundamentally break?</p>\n<p>**What would count as a convincing experimental demonstration?</p>\n", "question_id": 45347, "question_license": "CC BY-SA 4.0", "question_score": 5, "question_text": "Most bio-computation treats biology as inspiration for algorithms. I’m approaching it from the opposite direction: treating biological substrates themselves as the computing hardware.\n\n\n\n\nMy current work explores encoding computation directly into:\nProtein folding landscapes\nReaction–diffusion fields\nNon-Markovian intracellular signaling\nOscillatory metabolic and ionic networks\n\n\n\n\nUsing a dynamical systems framework,\nI’m compiling mathematical operators and quantum-inspired circuit topologies into biological processes, where computation emerges from continuous, memory-rich dynamics rather than discrete clocked logic.\nCore question:\n\n\n\n\nCan we define a rigorous computational instruction set for living matter, where biochemical dynamics are the computation?\n\n\n\n\n*What would a biological ISA even look like?\n\n\n\n\n*How do we define computational depth in continuous, non-Markovian systems?\n\n\n\n\n*Where do current synthetic biology toolchains fundamentally break?\n\n\n\n\n**What would count as a convincing experimental demonstration?", "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Donte Lightfoot", "profile_url": "https://scicomp.stackexchange.com/users/56387/donte-lightfoot", "user_type": "registered"}, "created_at": "2026-01-22T13:28:11+00:00", "raw_file": "raw/codex_api_v1/d49b4ef7856602e9d6b1a79d56b143976504b0637af4b266f03f2b60112c6c15_1790825353984908500_0.json", "raw_sha256": "4ebc32b188652be208cbfb32007d2c8fcbe5419e5ab336ca46a3e9eb5ef04d0e", "revision_guid": "0E691519-A338-4491-A061-23454917E13E", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/0E691519-A338-4491-A061-23454917E13E/view-source"}, {"content_license": null, "contributor": {"display_name": "Community", "profile_url": "https://scicomp.stackexchange.com/users/-1/community", "user_type": "moderator"}, "created_at": "2026-02-05T01:09:22+00:00", "raw_file": "raw/codex_api_v1/d49b4ef7856602e9d6b1a79d56b143976504b0637af4b266f03f2b60112c6c15_1790825353984908500_0.json", "raw_sha256": "4ebc32b188652be208cbfb32007d2c8fcbe5419e5ab336ca46a3e9eb5ef04d0e", "revision_guid": "EADA9E8C-CC8B-4BFF-85D2-36B5D470F7DD", "revision_number": 2, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/EADA9E8C-CC8B-4BFF-85D2-36B5D470F7DD/view-source"}, {"content_license": null, "contributor": {"display_name": "Donte Lightfoot", "profile_url": "https://scicomp.stackexchange.com/users/56387/donte-lightfoot", "user_type": "registered"}, "created_at": "2026-02-16T22:12:47+00:00", "raw_file": "raw/codex_api_v1/d49b4ef7856602e9d6b1a79d56b143976504b0637af4b266f03f2b60112c6c15_1790825353984908500_0.json", "raw_sha256": "4ebc32b188652be208cbfb32007d2c8fcbe5419e5ab336ca46a3e9eb5ef04d0e", "revision_guid": "4CA194AA-003B-4D32-97C1-8BAF607E2849", "revision_number": 3, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/4CA194AA-003B-4D32-97C1-8BAF607E2849/view-source"}], "source_site": "scicomp", "source_url": "https://scicomp.stackexchange.com/questions/45347/can-biological-systems-act-as-executable-computational-hardware", "split": "test", "split_group": "97e14d3d54a21fa41336b1233350eadd23e8fc11ef129f4ee948c64444040981", "tags": ["quantum-mechanics", "computational-biology", "reproducibility"], "thread_id": "scicomp:45347", "title": "Can Biological Systems Act as Executable Computational Hardware?"}} | |
| {"accepted_status": [false, false], "candidate_answers": [{"answer_html": "<p>Disclaimer, I'm not an expert in this, I'm just repeating things I've heard from CS colleagues.\nThere are two parts to your question.\nFirst, is it feasible to distribute ML model training among many distant compute nodes that might have high communication latency?\nI don't know enough to answer this.</p>\n<p>Second, if you want to train a model on private data, can you do that in a way that does not leak private data?\nThere is a field of research that aims to answer this question called <a href=\"https://en.wikipedia.org/wiki/Differential_privacy\" rel=\"nofollow noreferrer\">differential privacy</a>.\nThe nightmare scenario is that a group of large hospital systems train a ML model on patient data but some bad actor is able to execute a <a href=\"https://en.wikipedia.org/wiki/Reconstruction_attack\" rel=\"nofollow noreferrer\">reconstruction attack</a> that reveals that you, MPIchael, are not a human but rather a large bird.\nDifferential privacy aims to prevent such attacks through intentionally injecting noise into the data such that information about any individual is untrustworthy despite the fact that global aggregate results still have the same statistical average as what is desired.\n<a href=\"https://en.wikipedia.org/wiki/Differential_privacy#Randomized_response\" rel=\"nofollow noreferrer\">This section</a> on the differential privacy wiki is a succinct example.</p>\n<p>So it would appear that information in the training data can in fact remain confidential; the mechanism is the intentional injection of noise; and there is a rigorous mathematical theory describing how much noise you need to inject given the number of samples.</p>\n<p>Now, the counter-argument.\nThe field of ML has a lot of hype.\nA lot of people have a financial interest in maintaining this hype.\nPart of that hype is that it will revolutionize healthcare.\nA reasonable person could ask how we can train ML models to solve problems in healthcare when all that data falls under HIPAA.\nIt suits the interests of people with lots of money to be able to say that differential privacy is a theoretically sound answer to this objection.\nIt's possible that (1) there are exploitable flaws in the theory of differential privacy itself, or (2) there are flaws in the practical application of this theory, such that it doesn't provide the privacy protection that the theory claims.\nThe first feels far-fetched to me and I don't know enough to have a hunch about the second.\nBut it's also important to acknowledge where there are vested interests.\nTo make an analogy, there is a mathematical theory of public-key cryptography.\nThis theory is a necessary component of practical cybersecurity, but it is far from sufficient: I can transmit password hashes using a cryptographically-secure hash function, but if a user chooses "password" as his password, then a malicious actor can guess that.</p>\n", "answer_id": 45367, "answer_text": "Disclaimer, I'm not an expert in this, I'm just repeating things I've heard from CS colleagues.\nThere are two parts to your question.\nFirst, is it feasible to distribute ML model training among many distant compute nodes that might have high communication latency?\nI don't know enough to answer this.\n\n\n\n\nSecond, if you want to train a model on private data, can you do that in a way that does not leak private data?\nThere is a field of research that aims to answer this question called differential privacy (https://en.wikipedia.org/wiki/Differential_privacy).\nThe nightmare scenario is that a group of large hospital systems train a ML model on patient data but some bad actor is able to execute a reconstruction attack (https://en.wikipedia.org/wiki/Reconstruction_attack) that reveals that you, MPIchael, are not a human but rather a large bird.\nDifferential privacy aims to prevent such attacks through intentionally injecting noise into the data such that information about any individual is untrustworthy despite the fact that global aggregate results still have the same statistical average as what is desired.\nThis section (https://en.wikipedia.org/wiki/Differential_privacy#Randomized_response) on the differential privacy wiki is a succinct example.\n\n\n\n\nSo it would appear that information in the training data can in fact remain confidential; the mechanism is the intentional injection of noise; and there is a rigorous mathematical theory describing how much noise you need to inject given the number of samples.\n\n\n\n\nNow, the counter-argument.\nThe field of ML has a lot of hype.\nA lot of people have a financial interest in maintaining this hype.\nPart of that hype is that it will revolutionize healthcare.\nA reasonable person could ask how we can train ML models to solve problems in healthcare when all that data falls under HIPAA.\nIt suits the interests of people with lots of money to be able to say that differential privacy is a theoretically sound answer to this objection.\nIt's possible that (1) there are exploitable flaws in the theory of differential privacy itself, or (2) there are flaws in the practical application of this theory, such that it doesn't provide the privacy protection that the theory claims.\nThe first feels far-fetched to me and I don't know enough to have a hunch about the second.\nBut it's also important to acknowledge where there are vested interests.\nTo make an analogy, there is a mathematical theory of public-key cryptography.\nThis theory is a necessary component of practical cybersecurity, but it is far from sufficient: I can transmit password hashes using a cryptographically-secure hash function, but if a user chooses \"password\" as his password, then a malicious actor can guess that.", "answer_url": "https://scicomp.stackexchange.com/a/45367", "author": "Daniel Shapero", "author_url": "https://scicomp.stackexchange.com/users/3481/daniel-shapero", "author_user_type": "registered", "content_license": "CC BY-SA 4.0", "created_at": "2026-02-12T18:36:02+00:00", "is_accepted": false, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:28:47.033952+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/cb6e5f564c84a92c4e121c0637c99292018f8935652e423630f2001099a2410f_1790825327386675300_0.json", "raw_sha256": "1a957289f56621bebd21cb45dd99baaedb2c3bc11cb28d700558e4bbcaa19695", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/questions/45545;45541;45538;45533;45532;45530;45523;45513;45510;45507;45499;45493;45488;45487;45479;45474;45472;45463;45461;45447;45444;45436;45428;45425;45424;45423;45422;45416;45414;45410;45404;45401;45396;45391;45389;45387;45380;45377;45376;45375;45369;45366;45365;45363;45362;45359;45350;45347;45344;45336;45334;45331;45326;45322;45316;45313;45311;45309;45305;45302;45300;45291;45289;45285;45276;45269;45263;45262;45261;45253;45247;45246;45238;45236;45230;45229;45208;45201;45200;45185;45183;45171;45167;45165;45158;45154;45146;45141;45139;45134;45129;45127;45122;45114;45112;45108;45105;45100;45098;45096/answers?filter=withbody&order=asc&page=1&pagesize=100&site=scicomp&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_id": 45366, "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Daniel Shapero", "profile_url": "https://scicomp.stackexchange.com/users/3481/daniel-shapero", "user_type": "registered"}, "created_at": "2026-02-12T18:36:02+00:00", "raw_file": "raw/codex_api_v1/d49b4ef7856602e9d6b1a79d56b143976504b0637af4b266f03f2b60112c6c15_1790825353984908500_0.json", "raw_sha256": "4ebc32b188652be208cbfb32007d2c8fcbe5419e5ab336ca46a3e9eb5ef04d0e", "revision_guid": "E77DB701-1B32-4706-A801-DAF6D024D5E4", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/E77DB701-1B32-4706-A801-DAF6D024D5E4/view-source"}], "score": 4, "updated_at": "2026-02-12T18:36:02+00:00"}, {"answer_html": "<p>Many machine learning algorithms, under the hood, try to determine some internal parameters of a class of functions (say, the weights and biases of a neural network) by minimizing an objective function that is a sum over the training set. Let's say that the neural network or whatever other approach you want to use corresponds to an operator <span class=\"math-container\">$F(x; \\cdot)$</span> that maps an input <span class=\"math-container\">$a$</span> to an output <span class=\"math-container\">$b=F(x;a)$</span> where the vector <span class=\"math-container\">$x$</span> corresponds to the internal parameters. The machine learning part is to determine the best internal parameters <span class=\"math-container\">$x$</span> for given input/output data sets.</p>\n<p>If you have training inputs <span class=\"math-container\">$a_i$</span> and corresponding correct answers <span class=\"math-container\">$b_i$</span>, then a typical approach is to minimize the objective function\n<span class=\"math-container\">$$\n f(x) = \\frac 12 \\sum_i \\left( b_i - F(x;a_i) \\right)^2.\n$$</span>\nIf you use the usual steepest descent algorithm, you will need to compute\n<span class=\"math-container\">$$\n \\nabla_x f(x) = -\\sum_i \\left( b_i - F(x;a_i) \\right) \\nabla_x F(x;a_i).\n$$</span>\nThis is computable in a perfectly distributed manner if a central processor sends the current <span class=\"math-container\">$x$</span> to other machines who, given their own knowledge of <span class=\"math-container\">$a_i,b_i$</span> can compute the gradient contribution for data point <span class=\"math-container\">$i$</span> without ever sending <span class=\"math-container\">$a_i$</span> or <span class=\"math-container\">$b_i$</span> to another process -- preserving the privacy of the data from the rest of the world, including the process that then updates the current parameters <span class=\"math-container\">$x$</span> through the gradient <span class=\"math-container\">$\\nabla f$</span>.</p>\n", "answer_id": 45374, "answer_text": "Many machine learning algorithms, under the hood, try to determine some internal parameters of a class of functions (say, the weights and biases of a neural network) by minimizing an objective function that is a sum over the training set. Let's say that the neural network or whatever other approach you want to use corresponds to an operator $F(x; \\cdot)$ that maps an input $a$ to an output $b=F(x;a)$ where the vector $x$ corresponds to the internal parameters. The machine learning part is to determine the best internal parameters $x$ for given input/output data sets.\n\n\n\n\nIf you have training inputs $a_i$ and corresponding correct answers $b_i$, then a typical approach is to minimize the objective function\n$$\n f(x) = \\frac 12 \\sum_i \\left( b_i - F(x;a_i) \\right)^2.\n$$\nIf you use the usual steepest descent algorithm, you will need to compute\n$$\n \\nabla_x f(x) = -\\sum_i \\left( b_i - F(x;a_i) \\right) \\nabla_x F(x;a_i).\n$$\nThis is computable in a perfectly distributed manner if a central processor sends the current $x$ to other machines who, given their own knowledge of $a_i,b_i$ can compute the gradient contribution for data point $i$ without ever sending $a_i$ or $b_i$ to another process -- preserving the privacy of the data from the rest of the world, including the process that then updates the current parameters $x$ through the gradient $\\nabla f$.", "answer_url": "https://scicomp.stackexchange.com/a/45374", "author": "Wolfgang Bangerth", "author_url": "https://scicomp.stackexchange.com/users/393/wolfgang-bangerth", "author_user_type": "registered", "content_license": "CC BY-SA 4.0", "created_at": "2026-02-14T05:37:48+00:00", "is_accepted": false, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:28:47.033952+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/cb6e5f564c84a92c4e121c0637c99292018f8935652e423630f2001099a2410f_1790825327386675300_0.json", "raw_sha256": "1a957289f56621bebd21cb45dd99baaedb2c3bc11cb28d700558e4bbcaa19695", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/questions/45545;45541;45538;45533;45532;45530;45523;45513;45510;45507;45499;45493;45488;45487;45479;45474;45472;45463;45461;45447;45444;45436;45428;45425;45424;45423;45422;45416;45414;45410;45404;45401;45396;45391;45389;45387;45380;45377;45376;45375;45369;45366;45365;45363;45362;45359;45350;45347;45344;45336;45334;45331;45326;45322;45316;45313;45311;45309;45305;45302;45300;45291;45289;45285;45276;45269;45263;45262;45261;45253;45247;45246;45238;45236;45230;45229;45208;45201;45200;45185;45183;45171;45167;45165;45158;45154;45146;45141;45139;45134;45129;45127;45122;45114;45112;45108;45105;45100;45098;45096/answers?filter=withbody&order=asc&page=1&pagesize=100&site=scicomp&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_id": 45366, "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Wolfgang Bangerth", "profile_url": "https://scicomp.stackexchange.com/users/393/wolfgang-bangerth", "user_type": "registered"}, "created_at": "2026-02-14T05:37:48+00:00", "raw_file": "raw/codex_api_v1/d49b4ef7856602e9d6b1a79d56b143976504b0637af4b266f03f2b60112c6c15_1790825353984908500_0.json", "raw_sha256": "4ebc32b188652be208cbfb32007d2c8fcbe5419e5ab336ca46a3e9eb5ef04d0e", "revision_guid": "0D5DD87B-5B83-423D-9881-0AA2556859E2", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/0D5DD87B-5B83-423D-9881-0AA2556859E2/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Wolfgang Bangerth", "profile_url": "https://scicomp.stackexchange.com/users/393/wolfgang-bangerth", "user_type": "registered"}, "created_at": "2026-02-19T23:03:54+00:00", "raw_file": "raw/codex_api_v1/d49b4ef7856602e9d6b1a79d56b143976504b0637af4b266f03f2b60112c6c15_1790825353984908500_0.json", "raw_sha256": "4ebc32b188652be208cbfb32007d2c8fcbe5419e5ab336ca46a3e9eb5ef04d0e", "revision_guid": "384FD55C-E139-4B7B-BDD7-ED16AA122B8B", "revision_number": 2, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/384FD55C-E139-4B7B-BDD7-ED16AA122B8B/view-source"}], "score": 4, "updated_at": "2026-02-19T23:03:54+00:00"}], "ground_truth": "community signals only; no scientific truth label", "product": "ranking", "question": "I came into contact with projects pushing some \"federated learning\" approaches for training AI models. The idea behind federated learning is that machine learning algorithms can be trained decentrally on a set of data chunks, so that sensitive data does not leave data providers, and the computing power can be separated into nodes.\n\n\n\n\nI have done some distributed HPC before and the idea struck me as very odd since not all computations can be neatly paralellized. Any computation where there are reasonable intermediate results, that can be put together at a later stage, can be done in parallel like calculating a mean value or combining stochastic distributions. Explicit timestepping methods have to be calculated sequentially!\n\n\n\n\nThere is a prominent list of problems wich are \"P-complete (https://en.wikipedia.org/wiki/P-complete)\" and can never be parallized. I would have assumed that if any learning is done where information from more than on chunk is needed in combination, then that would also fall into the category of algorithms which can not be reasonably parallelized.\n\n\n\n\nOne explanation I could see is that information from the chunks is not actually left in place, but that the decentralized algorithms merely compress the info and then the actual learning is done at the recombination stage. That would completely defy the selling point of privacy of training data!\n\n\n\n\nThe other explanation I can come up with is that these ML methods are essentially limited to calculating high level statistics about their training data. These could be collected separately and then recombined. This would make sense to me, but then we should call it high dimensional linear regression and not artificial intelligence.\n\n\n\n\nAny 'learning' that would require information from multiple chunks which are distributed seems impossible to me.\n\n\n\n\nHow does \"Federated Learning\" actually work? How can information of the training data be left confidential?", "record_id": "Scientific-Answer-Ranking:scicomp:45366", "scores": [4, 4], "split": "test", "thread": {"accepted_answer_id": null, "answers": [{"answer_html": "<p>Disclaimer, I'm not an expert in this, I'm just repeating things I've heard from CS colleagues.\nThere are two parts to your question.\nFirst, is it feasible to distribute ML model training among many distant compute nodes that might have high communication latency?\nI don't know enough to answer this.</p>\n<p>Second, if you want to train a model on private data, can you do that in a way that does not leak private data?\nThere is a field of research that aims to answer this question called <a href=\"https://en.wikipedia.org/wiki/Differential_privacy\" rel=\"nofollow noreferrer\">differential privacy</a>.\nThe nightmare scenario is that a group of large hospital systems train a ML model on patient data but some bad actor is able to execute a <a href=\"https://en.wikipedia.org/wiki/Reconstruction_attack\" rel=\"nofollow noreferrer\">reconstruction attack</a> that reveals that you, MPIchael, are not a human but rather a large bird.\nDifferential privacy aims to prevent such attacks through intentionally injecting noise into the data such that information about any individual is untrustworthy despite the fact that global aggregate results still have the same statistical average as what is desired.\n<a href=\"https://en.wikipedia.org/wiki/Differential_privacy#Randomized_response\" rel=\"nofollow noreferrer\">This section</a> on the differential privacy wiki is a succinct example.</p>\n<p>So it would appear that information in the training data can in fact remain confidential; the mechanism is the intentional injection of noise; and there is a rigorous mathematical theory describing how much noise you need to inject given the number of samples.</p>\n<p>Now, the counter-argument.\nThe field of ML has a lot of hype.\nA lot of people have a financial interest in maintaining this hype.\nPart of that hype is that it will revolutionize healthcare.\nA reasonable person could ask how we can train ML models to solve problems in healthcare when all that data falls under HIPAA.\nIt suits the interests of people with lots of money to be able to say that differential privacy is a theoretically sound answer to this objection.\nIt's possible that (1) there are exploitable flaws in the theory of differential privacy itself, or (2) there are flaws in the practical application of this theory, such that it doesn't provide the privacy protection that the theory claims.\nThe first feels far-fetched to me and I don't know enough to have a hunch about the second.\nBut it's also important to acknowledge where there are vested interests.\nTo make an analogy, there is a mathematical theory of public-key cryptography.\nThis theory is a necessary component of practical cybersecurity, but it is far from sufficient: I can transmit password hashes using a cryptographically-secure hash function, but if a user chooses "password" as his password, then a malicious actor can guess that.</p>\n", "answer_id": 45367, "answer_text": "Disclaimer, I'm not an expert in this, I'm just repeating things I've heard from CS colleagues.\nThere are two parts to your question.\nFirst, is it feasible to distribute ML model training among many distant compute nodes that might have high communication latency?\nI don't know enough to answer this.\n\n\n\n\nSecond, if you want to train a model on private data, can you do that in a way that does not leak private data?\nThere is a field of research that aims to answer this question called differential privacy (https://en.wikipedia.org/wiki/Differential_privacy).\nThe nightmare scenario is that a group of large hospital systems train a ML model on patient data but some bad actor is able to execute a reconstruction attack (https://en.wikipedia.org/wiki/Reconstruction_attack) that reveals that you, MPIchael, are not a human but rather a large bird.\nDifferential privacy aims to prevent such attacks through intentionally injecting noise into the data such that information about any individual is untrustworthy despite the fact that global aggregate results still have the same statistical average as what is desired.\nThis section (https://en.wikipedia.org/wiki/Differential_privacy#Randomized_response) on the differential privacy wiki is a succinct example.\n\n\n\n\nSo it would appear that information in the training data can in fact remain confidential; the mechanism is the intentional injection of noise; and there is a rigorous mathematical theory describing how much noise you need to inject given the number of samples.\n\n\n\n\nNow, the counter-argument.\nThe field of ML has a lot of hype.\nA lot of people have a financial interest in maintaining this hype.\nPart of that hype is that it will revolutionize healthcare.\nA reasonable person could ask how we can train ML models to solve problems in healthcare when all that data falls under HIPAA.\nIt suits the interests of people with lots of money to be able to say that differential privacy is a theoretically sound answer to this objection.\nIt's possible that (1) there are exploitable flaws in the theory of differential privacy itself, or (2) there are flaws in the practical application of this theory, such that it doesn't provide the privacy protection that the theory claims.\nThe first feels far-fetched to me and I don't know enough to have a hunch about the second.\nBut it's also important to acknowledge where there are vested interests.\nTo make an analogy, there is a mathematical theory of public-key cryptography.\nThis theory is a necessary component of practical cybersecurity, but it is far from sufficient: I can transmit password hashes using a cryptographically-secure hash function, but if a user chooses \"password\" as his password, then a malicious actor can guess that.", "answer_url": "https://scicomp.stackexchange.com/a/45367", "author": "Daniel Shapero", "author_url": "https://scicomp.stackexchange.com/users/3481/daniel-shapero", "author_user_type": "registered", "content_license": "CC BY-SA 4.0", "created_at": "2026-02-12T18:36:02+00:00", "is_accepted": false, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:28:47.033952+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/cb6e5f564c84a92c4e121c0637c99292018f8935652e423630f2001099a2410f_1790825327386675300_0.json", "raw_sha256": "1a957289f56621bebd21cb45dd99baaedb2c3bc11cb28d700558e4bbcaa19695", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/questions/45545;45541;45538;45533;45532;45530;45523;45513;45510;45507;45499;45493;45488;45487;45479;45474;45472;45463;45461;45447;45444;45436;45428;45425;45424;45423;45422;45416;45414;45410;45404;45401;45396;45391;45389;45387;45380;45377;45376;45375;45369;45366;45365;45363;45362;45359;45350;45347;45344;45336;45334;45331;45326;45322;45316;45313;45311;45309;45305;45302;45300;45291;45289;45285;45276;45269;45263;45262;45261;45253;45247;45246;45238;45236;45230;45229;45208;45201;45200;45185;45183;45171;45167;45165;45158;45154;45146;45141;45139;45134;45129;45127;45122;45114;45112;45108;45105;45100;45098;45096/answers?filter=withbody&order=asc&page=1&pagesize=100&site=scicomp&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_id": 45366, "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Daniel Shapero", "profile_url": "https://scicomp.stackexchange.com/users/3481/daniel-shapero", "user_type": "registered"}, "created_at": "2026-02-12T18:36:02+00:00", "raw_file": "raw/codex_api_v1/d49b4ef7856602e9d6b1a79d56b143976504b0637af4b266f03f2b60112c6c15_1790825353984908500_0.json", "raw_sha256": "4ebc32b188652be208cbfb32007d2c8fcbe5419e5ab336ca46a3e9eb5ef04d0e", "revision_guid": "E77DB701-1B32-4706-A801-DAF6D024D5E4", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/E77DB701-1B32-4706-A801-DAF6D024D5E4/view-source"}], "score": 4, "updated_at": "2026-02-12T18:36:02+00:00"}, {"answer_html": "<p>Many machine learning algorithms, under the hood, try to determine some internal parameters of a class of functions (say, the weights and biases of a neural network) by minimizing an objective function that is a sum over the training set. Let's say that the neural network or whatever other approach you want to use corresponds to an operator <span class=\"math-container\">$F(x; \\cdot)$</span> that maps an input <span class=\"math-container\">$a$</span> to an output <span class=\"math-container\">$b=F(x;a)$</span> where the vector <span class=\"math-container\">$x$</span> corresponds to the internal parameters. The machine learning part is to determine the best internal parameters <span class=\"math-container\">$x$</span> for given input/output data sets.</p>\n<p>If you have training inputs <span class=\"math-container\">$a_i$</span> and corresponding correct answers <span class=\"math-container\">$b_i$</span>, then a typical approach is to minimize the objective function\n<span class=\"math-container\">$$\n f(x) = \\frac 12 \\sum_i \\left( b_i - F(x;a_i) \\right)^2.\n$$</span>\nIf you use the usual steepest descent algorithm, you will need to compute\n<span class=\"math-container\">$$\n \\nabla_x f(x) = -\\sum_i \\left( b_i - F(x;a_i) \\right) \\nabla_x F(x;a_i).\n$$</span>\nThis is computable in a perfectly distributed manner if a central processor sends the current <span class=\"math-container\">$x$</span> to other machines who, given their own knowledge of <span class=\"math-container\">$a_i,b_i$</span> can compute the gradient contribution for data point <span class=\"math-container\">$i$</span> without ever sending <span class=\"math-container\">$a_i$</span> or <span class=\"math-container\">$b_i$</span> to another process -- preserving the privacy of the data from the rest of the world, including the process that then updates the current parameters <span class=\"math-container\">$x$</span> through the gradient <span class=\"math-container\">$\\nabla f$</span>.</p>\n", "answer_id": 45374, "answer_text": "Many machine learning algorithms, under the hood, try to determine some internal parameters of a class of functions (say, the weights and biases of a neural network) by minimizing an objective function that is a sum over the training set. Let's say that the neural network or whatever other approach you want to use corresponds to an operator $F(x; \\cdot)$ that maps an input $a$ to an output $b=F(x;a)$ where the vector $x$ corresponds to the internal parameters. The machine learning part is to determine the best internal parameters $x$ for given input/output data sets.\n\n\n\n\nIf you have training inputs $a_i$ and corresponding correct answers $b_i$, then a typical approach is to minimize the objective function\n$$\n f(x) = \\frac 12 \\sum_i \\left( b_i - F(x;a_i) \\right)^2.\n$$\nIf you use the usual steepest descent algorithm, you will need to compute\n$$\n \\nabla_x f(x) = -\\sum_i \\left( b_i - F(x;a_i) \\right) \\nabla_x F(x;a_i).\n$$\nThis is computable in a perfectly distributed manner if a central processor sends the current $x$ to other machines who, given their own knowledge of $a_i,b_i$ can compute the gradient contribution for data point $i$ without ever sending $a_i$ or $b_i$ to another process -- preserving the privacy of the data from the rest of the world, including the process that then updates the current parameters $x$ through the gradient $\\nabla f$.", "answer_url": "https://scicomp.stackexchange.com/a/45374", "author": "Wolfgang Bangerth", "author_url": "https://scicomp.stackexchange.com/users/393/wolfgang-bangerth", "author_user_type": "registered", "content_license": "CC BY-SA 4.0", "created_at": "2026-02-14T05:37:48+00:00", "is_accepted": false, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:28:47.033952+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/cb6e5f564c84a92c4e121c0637c99292018f8935652e423630f2001099a2410f_1790825327386675300_0.json", "raw_sha256": "1a957289f56621bebd21cb45dd99baaedb2c3bc11cb28d700558e4bbcaa19695", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/questions/45545;45541;45538;45533;45532;45530;45523;45513;45510;45507;45499;45493;45488;45487;45479;45474;45472;45463;45461;45447;45444;45436;45428;45425;45424;45423;45422;45416;45414;45410;45404;45401;45396;45391;45389;45387;45380;45377;45376;45375;45369;45366;45365;45363;45362;45359;45350;45347;45344;45336;45334;45331;45326;45322;45316;45313;45311;45309;45305;45302;45300;45291;45289;45285;45276;45269;45263;45262;45261;45253;45247;45246;45238;45236;45230;45229;45208;45201;45200;45185;45183;45171;45167;45165;45158;45154;45146;45141;45139;45134;45129;45127;45122;45114;45112;45108;45105;45100;45098;45096/answers?filter=withbody&order=asc&page=1&pagesize=100&site=scicomp&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_id": 45366, "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Wolfgang Bangerth", "profile_url": "https://scicomp.stackexchange.com/users/393/wolfgang-bangerth", "user_type": "registered"}, "created_at": "2026-02-14T05:37:48+00:00", "raw_file": "raw/codex_api_v1/d49b4ef7856602e9d6b1a79d56b143976504b0637af4b266f03f2b60112c6c15_1790825353984908500_0.json", "raw_sha256": "4ebc32b188652be208cbfb32007d2c8fcbe5419e5ab336ca46a3e9eb5ef04d0e", "revision_guid": "0D5DD87B-5B83-423D-9881-0AA2556859E2", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/0D5DD87B-5B83-423D-9881-0AA2556859E2/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Wolfgang Bangerth", "profile_url": "https://scicomp.stackexchange.com/users/393/wolfgang-bangerth", "user_type": "registered"}, "created_at": "2026-02-19T23:03:54+00:00", "raw_file": "raw/codex_api_v1/d49b4ef7856602e9d6b1a79d56b143976504b0637af4b266f03f2b60112c6c15_1790825353984908500_0.json", "raw_sha256": "4ebc32b188652be208cbfb32007d2c8fcbe5419e5ab336ca46a3e9eb5ef04d0e", "revision_guid": "384FD55C-E139-4B7B-BDD7-ED16AA122B8B", "revision_number": 2, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/384FD55C-E139-4B7B-BDD7-ED16AA122B8B/view-source"}], "score": 4, "updated_at": "2026-02-19T23:03:54+00:00"}], "domain": "computational_science", "external_links": ["https://en.wikipedia.org/wiki/Differential_privacy", "https://en.wikipedia.org/wiki/Differential_privacy#Randomized_response", "https://en.wikipedia.org/wiki/P-complete", "https://en.wikipedia.org/wiki/Reconstruction_attack"], "medical_sensitive": true, "patient_specific": false, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:28:44.584971+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/272744bcc95b58699f7df6e6979b288bb8b00a80ab9c7982dbe170a6d0b63584_1790825325025901700_0.json", "raw_sha256": "27a81850a40920682c29ada76a2b55e80340a5c82764a3e9dde8a9c2ba23db4e", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/search/advanced?answers=1&filter=withbody&order=desc&page=1&pagesize=100&site=scicomp&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_author": "MPIchael", "question_author_url": "https://scicomp.stackexchange.com/users/28636/mpichael", "question_author_user_type": "registered", "question_created_at": "2026-02-12T11:38:00+00:00", "question_html": "<p>I came into contact with projects pushing some "federated learning" approaches for training AI models. The idea behind federated learning is that machine learning algorithms can be trained decentrally on a set of data chunks, so that sensitive data does not leave data providers, and the computing power can be separated into nodes.</p>\n<p>I have done some distributed HPC before and the idea struck me as very odd since not all computations can be neatly paralellized. Any computation where there are reasonable intermediate results, that can be put together at a later stage, can be done in parallel like calculating a mean value or combining stochastic distributions. Explicit timestepping methods have to be calculated sequentially!</p>\n<p>There is a prominent list of problems wich are "<a href=\"https://en.wikipedia.org/wiki/P-complete\" rel=\"nofollow noreferrer\">P-complete</a>" and can never be parallized. I would have assumed that if any learning is done where information from more than on chunk is needed in combination, then that would also fall into the category of algorithms which can not be reasonably parallelized.</p>\n<p>One explanation I could see is that information from the chunks is not actually left in place, but that the decentralized algorithms merely compress the info and then the actual learning is done at the recombination stage. That would completely defy the selling point of privacy of training data!</p>\n<p>The other explanation I can come up with is that these ML methods are essentially limited to calculating high level statistics about their training data. These could be collected separately and then recombined. This would make sense to me, but then we should call it high dimensional <em>linear regression</em> and not <em>artificial intelligence</em>.</p>\n<p>Any 'learning' that would require information from multiple chunks which are distributed seems impossible to me.</p>\n<p><strong>How does "Federated Learning" actually work? How can information of the training data be left confidential?</strong></p>\n", "question_id": 45366, "question_license": "CC BY-SA 4.0", "question_score": 3, "question_text": "I came into contact with projects pushing some \"federated learning\" approaches for training AI models. The idea behind federated learning is that machine learning algorithms can be trained decentrally on a set of data chunks, so that sensitive data does not leave data providers, and the computing power can be separated into nodes.\n\n\n\n\nI have done some distributed HPC before and the idea struck me as very odd since not all computations can be neatly paralellized. Any computation where there are reasonable intermediate results, that can be put together at a later stage, can be done in parallel like calculating a mean value or combining stochastic distributions. Explicit timestepping methods have to be calculated sequentially!\n\n\n\n\nThere is a prominent list of problems wich are \"P-complete (https://en.wikipedia.org/wiki/P-complete)\" and can never be parallized. I would have assumed that if any learning is done where information from more than on chunk is needed in combination, then that would also fall into the category of algorithms which can not be reasonably parallelized.\n\n\n\n\nOne explanation I could see is that information from the chunks is not actually left in place, but that the decentralized algorithms merely compress the info and then the actual learning is done at the recombination stage. That would completely defy the selling point of privacy of training data!\n\n\n\n\nThe other explanation I can come up with is that these ML methods are essentially limited to calculating high level statistics about their training data. These could be collected separately and then recombined. This would make sense to me, but then we should call it high dimensional linear regression and not artificial intelligence.\n\n\n\n\nAny 'learning' that would require information from multiple chunks which are distributed seems impossible to me.\n\n\n\n\nHow does \"Federated Learning\" actually work? How can information of the training data be left confidential?", "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "MPIchael", "profile_url": "https://scicomp.stackexchange.com/users/28636/mpichael", "user_type": "registered"}, "created_at": "2026-02-12T11:38:00+00:00", "raw_file": "raw/codex_api_v1/d49b4ef7856602e9d6b1a79d56b143976504b0637af4b266f03f2b60112c6c15_1790825353984908500_0.json", "raw_sha256": "4ebc32b188652be208cbfb32007d2c8fcbe5419e5ab336ca46a3e9eb5ef04d0e", "revision_guid": "F4054CE7-4D32-4BF3-9451-F79096A1E0EF", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://scicomp.stackexchange.com/revisions/F4054CE7-4D32-4BF3-9451-F79096A1E0EF/view-source"}, {"content_license": null, "contributor": {"display_name": "[deleted/unavailable user]", "profile_url": null, "user_type": "does_not_exist"}, "created_at": "2026-02-13T00:47:30+00:00", "raw_file": "raw/codex_api_v1/d49b4ef7856602e9d6b1a79d56b143976504b0637af4b266f03f2b60112c6c15_1790825353984908500_0.json", "raw_sha256": "4ebc32b188652be208cbfb32007d2c8fcbe5419e5ab336ca46a3e9eb5ef04d0e", "revision_guid": "1EC62651-6157-48CF-9911-09F9F1340AB1", "revision_number": null, "revision_type": "vote_based", "revision_url": "https://scicomp.stackexchange.com/revisions/1EC62651-6157-48CF-9911-09F9F1340AB1/view-source"}], "source_site": "scicomp", "source_url": "https://scicomp.stackexchange.com/questions/45366/is-federated-learning-a-computationaly-sound-idea", "split": "test", "split_group": "1c83d94409976ab407c4c0691435e4f90d777304123956cbb24b2cf869fae846", "tags": ["machine-learning"], "thread_id": "scicomp:45366", "title": "Is \"Federated Learning\" a computationaly sound idea?"}} | |
| {"accepted_status": [false, false, false, false, false, false, false], "candidate_answers": [{"answer_html": "<p><sub>I find your question to be fine for this site, and you've provided the asked for sources, so it's fair to give you an answer.</sub></p>\n<blockquote>\n<p>Where is the error in my thinking?</p>\n</blockquote>\n<p>The error is in thinking that evolution is somehow directed towards the greater good. It's not. It's the result of <strong>random</strong> mutations.</p>\n<p>Evolution doesn't make us perfect for the environment in which we evolved. We will never be perfect in any way, let alone every way. You're only addressing the risks of UV light, but people can come up with any number of imaginable "deficiencies" in humans that make us "imperfectly evolved".</p>\n<p>That we're imperfect in no way means evolution has failed us somehow. Evolution doesn't occur to select for perfection. Evolution doesn't happen for any "reason" at all, in that it's not <em>directed</em> by a goal; evolution simply happens because <a href=\"https://www.nature.com/scitable/topicpage/dna-is-constantly-changing-through-the-process-6524898/\" rel=\"noreferrer\">DNA is mutable</a>. If a mutation is harmless or beneficial in an environment, it will be passed on and likely persist. If it's harmful, depending on the degree to which it's detrimental, it will not be passed on. Sometimes in an particular environment, a mutation is both (e.g. sickle cell trait.)</p>\n<p>If we're "good enough" overall to reproduce, if we're able to survive and pass on our genetic material, then that's what's going to happen, regardless of our perceived imperfections.</p>\n<p>Also, somewhat aside to your question are the <a href=\"https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3427189/\" rel=\"noreferrer\">benefits of UV light to humans</a>. We know that <a href=\"https://www.cuimc.columbia.edu/news/whats-deal-vitamin-d\" rel=\"noreferrer\">UVB allows us to synthesize Vitamin D, which is critical for survival.</a> There are other <a href=\"https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3427189/\" rel=\"noreferrer\">possible benefits to UV light as well</a>. It might well happen that we'll discover more concrete benefits.</p>\n<p>The question which has been linked to as a duplicate discusses evolution in more detail (and more helpfully). This is only a fairly quick answer.</p>\n", "answer_id": 115175, "answer_text": "I find your question to be fine for this site, and you've provided the asked for sources, so it's fair to give you an answer.\n\n\n\n\n\n\n\nWhere is the error in my thinking?\n\n\n\n\n\n\n\nThe error is in thinking that evolution is somehow directed towards the greater good. It's not. It's the result of random mutations.\n\n\n\n\nEvolution doesn't make us perfect for the environment in which we evolved. We will never be perfect in any way, let alone every way. You're only addressing the risks of UV light, but people can come up with any number of imaginable \"deficiencies\" in humans that make us \"imperfectly evolved\".\n\n\n\n\nThat we're imperfect in no way means evolution has failed us somehow. Evolution doesn't occur to select for perfection. Evolution doesn't happen for any \"reason\" at all, in that it's not directed by a goal; evolution simply happens because DNA is mutable (https://www.nature.com/scitable/topicpage/dna-is-constantly-changing-through-the-process-6524898/). If a mutation is harmless or beneficial in an environment, it will be passed on and likely persist. If it's harmful, depending on the degree to which it's detrimental, it will not be passed on. Sometimes in an particular environment, a mutation is both (e.g. sickle cell trait.)\n\n\n\n\nIf we're \"good enough\" overall to reproduce, if we're able to survive and pass on our genetic material, then that's what's going to happen, regardless of our perceived imperfections.\n\n\n\n\nAlso, somewhat aside to your question are the benefits of UV light to humans (https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3427189/). We know that UVB allows us to synthesize Vitamin D, which is critical for survival. (https://www.cuimc.columbia.edu/news/whats-deal-vitamin-d) There are other possible benefits to UV light as well (https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3427189/). It might well happen that we'll discover more concrete benefits.\n\n\n\n\nThe question which has been linked to as a duplicate discusses evolution in more detail (and more helpfully). This is only a fairly quick answer.", "answer_url": "https://biology.stackexchange.com/a/115175", "author": "anongoodnurse", "author_url": "https://biology.stackexchange.com/users/5198/anongoodnurse", "author_user_type": "registered", "content_license": "CC BY-SA 4.0", "created_at": "2024-08-13T19:19:48+00:00", "is_accepted": false, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:03:25.304620+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/7fe0b66593eb4c0f175024453138b8bd50811f1580a079ffb990af38e09cd1cf_0.json", "raw_sha256": "b0a655f3b4c9626cf981180b3ac018a4a26330c5ab9b925b3df78bedd8169a84", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/questions/115493;115490;115488;115483;115479;115477;115456;115453;115452;115447;115445;115444;115436;115431;115427;115413;115404;115403;115396;115391;115389;115388;115386;115383;115382;115379;115367;115365;115355;115340;115334;115328;115321;115314;115309;115304;115296;115295;115292;115283;115272;115270;115269;115265;115264;115260;115255;115252;115243;115235;115233;115225;115218;115215;115214;115213;115207;115204;115179;115177;115170;115167;115165;115164;115154;115149;115137;115131;115129;115115;115107;115099;115095;115094;115093;115085;115082;115081;115077;115076;115075;115074;115073;115072;115063;115044;115039;115035;115030;115025;115022;115019;115016;115012;115003;115002;114997;114993;114991;114987/answers?filter=withbody&order=asc&page=1&pagesize=100&site=biology&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_id": 115170, "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "anongoodnurse", "profile_url": "https://biology.stackexchange.com/users/5198/anongoodnurse", "user_type": "registered"}, "created_at": "2024-08-13T19:19:48+00:00", "raw_file": "raw/codex_api_v1/920b7e5633cbad837bacc37f0887fd883044a5fce63b6e0fa3cc1504390bec54_1790824091899465600_0.json", "raw_sha256": "bac2cc1988c9b300f258cae319a9302dc73ac2617e76f7491908df2a0b939d11", "revision_guid": "B27F09D5-F235-448E-AFF2-AD09B10346FA", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/B27F09D5-F235-448E-AFF2-AD09B10346FA/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "anongoodnurse", "profile_url": "https://biology.stackexchange.com/users/5198/anongoodnurse", "user_type": "registered"}, "created_at": "2024-08-13T19:27:18+00:00", "raw_file": "raw/codex_api_v1/920b7e5633cbad837bacc37f0887fd883044a5fce63b6e0fa3cc1504390bec54_1790824091899465600_0.json", "raw_sha256": "bac2cc1988c9b300f258cae319a9302dc73ac2617e76f7491908df2a0b939d11", "revision_guid": "D6BC325F-2058-42EC-A622-79DDDBAE9D28", "revision_number": 2, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/D6BC325F-2058-42EC-A622-79DDDBAE9D28/view-source"}, {"content_license": null, "contributor": {"display_name": "AliceD", "profile_url": "https://biology.stackexchange.com/users/9943/aliced", "user_type": "registered"}, "created_at": "2024-08-16T08:11:51+00:00", "raw_file": "raw/codex_api_v1/920b7e5633cbad837bacc37f0887fd883044a5fce63b6e0fa3cc1504390bec54_1790824091899465600_0.json", "raw_sha256": "bac2cc1988c9b300f258cae319a9302dc73ac2617e76f7491908df2a0b939d11", "revision_guid": "70F33937-681F-4BBB-90ED-DB3715ED6BF6", "revision_number": null, "revision_type": "vote_based", "revision_url": "https://biology.stackexchange.com/revisions/70F33937-681F-4BBB-90ED-DB3715ED6BF6/view-source"}], "score": 25, "updated_at": "2024-08-13T19:27:18+00:00"}, {"answer_html": "<p>Skin cancer typically results from a lifetime of sun exposure, and is usually seen in older individuals. 90% of new melanoma cases are diagnosed in people over 45. Nearly 95% of melanoma deaths are observed in people over 45. Simply put, humans' currently level of adaptation to the sun is "good enough" - the vast majority of people do not have their reproductive fitness affected in any way by how they handle sun exposure. There is little selective pressure that would result in someone with better sun adaptation being more likely to pass on their genes. Evolution won't typically operate on traits that are only meaningful after reproductive age, as "selective pressure" refers to selection for reproduction specifically.</p>\n<p><a href=\"https://seer.cancer.gov/statfacts/html/melan.html\" rel=\"noreferrer\">https://seer.cancer.gov/statfacts/html/melan.html</a></p>\n", "answer_id": 115176, "answer_text": "Skin cancer typically results from a lifetime of sun exposure, and is usually seen in older individuals. 90% of new melanoma cases are diagnosed in people over 45. Nearly 95% of melanoma deaths are observed in people over 45. Simply put, humans' currently level of adaptation to the sun is \"good enough\" - the vast majority of people do not have their reproductive fitness affected in any way by how they handle sun exposure. There is little selective pressure that would result in someone with better sun adaptation being more likely to pass on their genes. Evolution won't typically operate on traits that are only meaningful after reproductive age, as \"selective pressure\" refers to selection for reproduction specifically.\n\n\n\n\nhttps://seer.cancer.gov/statfacts/html/melan.html (https://seer.cancer.gov/statfacts/html/melan.html)", "answer_url": "https://biology.stackexchange.com/a/115176", "author": "Nuclear Hoagie", "author_url": "https://biology.stackexchange.com/users/16849/nuclear-hoagie", "author_user_type": "registered", "content_license": "CC BY-SA 4.0", "created_at": "2024-08-13T19:41:14+00:00", "is_accepted": false, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:03:25.304620+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/7fe0b66593eb4c0f175024453138b8bd50811f1580a079ffb990af38e09cd1cf_0.json", "raw_sha256": "b0a655f3b4c9626cf981180b3ac018a4a26330c5ab9b925b3df78bedd8169a84", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/questions/115493;115490;115488;115483;115479;115477;115456;115453;115452;115447;115445;115444;115436;115431;115427;115413;115404;115403;115396;115391;115389;115388;115386;115383;115382;115379;115367;115365;115355;115340;115334;115328;115321;115314;115309;115304;115296;115295;115292;115283;115272;115270;115269;115265;115264;115260;115255;115252;115243;115235;115233;115225;115218;115215;115214;115213;115207;115204;115179;115177;115170;115167;115165;115164;115154;115149;115137;115131;115129;115115;115107;115099;115095;115094;115093;115085;115082;115081;115077;115076;115075;115074;115073;115072;115063;115044;115039;115035;115030;115025;115022;115019;115016;115012;115003;115002;114997;114993;114991;114987/answers?filter=withbody&order=asc&page=1&pagesize=100&site=biology&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_id": 115170, "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Nuclear Hoagie", "profile_url": "https://biology.stackexchange.com/users/16849/nuclear-hoagie", "user_type": "registered"}, "created_at": "2024-08-13T19:41:14+00:00", "raw_file": "raw/codex_api_v1/920b7e5633cbad837bacc37f0887fd883044a5fce63b6e0fa3cc1504390bec54_1790824091899465600_0.json", "raw_sha256": "bac2cc1988c9b300f258cae319a9302dc73ac2617e76f7491908df2a0b939d11", "revision_guid": "E020D650-7DF7-42B4-A813-C07287A63A06", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/E020D650-7DF7-42B4-A813-C07287A63A06/view-source"}], "score": 53, "updated_at": "2024-08-13T19:41:14+00:00"}, {"answer_html": "<p>Besides the arguments already mentioned in the previous answers, the human body has developed numerous ways to protect itself from the harmful effects of sunlight and ultraviolet (UV) radiation.</p>\n<ul>\n<li><p>Melanin Production:</p>\n<p>Melanin is the main pigment in the skin that absorbs UV radiation to\nkeep it from damaging its structure. So, if the skin is exposed to UV\nrays, it is going to make more of this pigment, making the skin\ndarker, or tanned, which is a way of a protective response to the\ndeeper layers of the skin from getting damaged. This process helps absorb and dissipate UV radiation, reducing the risk of DNA damage that can lead to skin cancer.</p>\n</li>\n<li><p>Epidermal Thickening:</p>\n<p>Another defense mechanism is the thickening of the outermost skin layers (epidermis) in response to UV exposure. This thickening serves to attenuate UV penetration to deeper skin layers, thus providing an additional barrier against potential damage.</p>\n</li>\n<li><p>DNA Repair Mechanisms:</p>\n<p>The human skin protects its genetic material from being damaged by\nDNA repair. These mechanisms are the body's way of dealing\nwith and repairing UV-induced damage by the sun. This includes repair mechanisms like the <a href=\"https://en.wikipedia.org/wiki/Photolyase\" rel=\"noreferrer\">photolyase</a> repair mechanism, which specifically repairs pyrimidine dimers of the DNA which are generated by UV exposure.</p>\n</li>\n<li><p>Inflammatory Response:</p>\n<p>The acute response to excessive UV exposure is sunburn. This reaction is part of the body's inflammatory response, which serves to alert the immune system to potential damage and initiate repair processes.</p>\n</li>\n</ul>\n", "answer_id": 115181, "answer_text": "Besides the arguments already mentioned in the previous answers, the human body has developed numerous ways to protect itself from the harmful effects of sunlight and ultraviolet (UV) radiation.\n\n\n\n\n\n\n\nMelanin Production:\n\n\n\n\nMelanin is the main pigment in the skin that absorbs UV radiation to\nkeep it from damaging its structure. So, if the skin is exposed to UV\nrays, it is going to make more of this pigment, making the skin\ndarker, or tanned, which is a way of a protective response to the\ndeeper layers of the skin from getting damaged. This process helps absorb and dissipate UV radiation, reducing the risk of DNA damage that can lead to skin cancer.\n\n\n\n\n\n\n\n\n\nEpidermal Thickening:\n\n\n\n\nAnother defense mechanism is the thickening of the outermost skin layers (epidermis) in response to UV exposure. This thickening serves to attenuate UV penetration to deeper skin layers, thus providing an additional barrier against potential damage.\n\n\n\n\n\n\n\n\n\nDNA Repair Mechanisms:\n\n\n\n\nThe human skin protects its genetic material from being damaged by\nDNA repair. These mechanisms are the body's way of dealing\nwith and repairing UV-induced damage by the sun. This includes repair mechanisms like the photolyase (https://en.wikipedia.org/wiki/Photolyase) repair mechanism, which specifically repairs pyrimidine dimers of the DNA which are generated by UV exposure.\n\n\n\n\n\n\n\n\n\nInflammatory Response:\n\n\n\n\nThe acute response to excessive UV exposure is sunburn. This reaction is part of the body's inflammatory response, which serves to alert the immune system to potential damage and initiate repair processes.", "answer_url": "https://biology.stackexchange.com/a/115181", "author": "Chris", "author_url": "https://biology.stackexchange.com/users/5144/chris", "author_user_type": "moderator", "content_license": "CC BY-SA 4.0", "created_at": "2024-08-14T08:30:31+00:00", "is_accepted": false, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:03:25.304620+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/7fe0b66593eb4c0f175024453138b8bd50811f1580a079ffb990af38e09cd1cf_0.json", "raw_sha256": "b0a655f3b4c9626cf981180b3ac018a4a26330c5ab9b925b3df78bedd8169a84", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/questions/115493;115490;115488;115483;115479;115477;115456;115453;115452;115447;115445;115444;115436;115431;115427;115413;115404;115403;115396;115391;115389;115388;115386;115383;115382;115379;115367;115365;115355;115340;115334;115328;115321;115314;115309;115304;115296;115295;115292;115283;115272;115270;115269;115265;115264;115260;115255;115252;115243;115235;115233;115225;115218;115215;115214;115213;115207;115204;115179;115177;115170;115167;115165;115164;115154;115149;115137;115131;115129;115115;115107;115099;115095;115094;115093;115085;115082;115081;115077;115076;115075;115074;115073;115072;115063;115044;115039;115035;115030;115025;115022;115019;115016;115012;115003;115002;114997;114993;114991;114987/answers?filter=withbody&order=asc&page=1&pagesize=100&site=biology&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_id": 115170, "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Chris", "profile_url": "https://biology.stackexchange.com/users/5144/chris", "user_type": "moderator"}, "created_at": "2024-08-14T08:30:31+00:00", "raw_file": "raw/codex_api_v1/920b7e5633cbad837bacc37f0887fd883044a5fce63b6e0fa3cc1504390bec54_1790824091899465600_0.json", "raw_sha256": "bac2cc1988c9b300f258cae319a9302dc73ac2617e76f7491908df2a0b939d11", "revision_guid": "203DF798-60CE-4A5B-942C-F9066DA8BFEC", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/203DF798-60CE-4A5B-942C-F9066DA8BFEC/view-source"}], "score": 12, "updated_at": "2024-08-14T08:30:31+00:00"}, {"answer_html": "<p>To add to other answers, there have been behavioral changes in many societies with paler skin phototypes that have increased the risk of skin cancer. Laying on a beach or in a park to get a suntan is an activity that's only become common in recent decades, for centuries Europeans avoided working outside around the midday sun during summer (such as sleeping in the shade) and when working outside wore clothing that covered up most of the skin along with wide brimmed hats or other head covering (have a look at typical medieval peasant dress). That was enough to mitigate most of the risk of skin cancer, but not in more equatorial countries.</p>\n", "answer_id": 115184, "answer_text": "To add to other answers, there have been behavioral changes in many societies with paler skin phototypes that have increased the risk of skin cancer. Laying on a beach or in a park to get a suntan is an activity that's only become common in recent decades, for centuries Europeans avoided working outside around the midday sun during summer (such as sleeping in the shade) and when working outside wore clothing that covered up most of the skin along with wide brimmed hats or other head covering (have a look at typical medieval peasant dress). That was enough to mitigate most of the risk of skin cancer, but not in more equatorial countries.", "answer_url": "https://biology.stackexchange.com/a/115184", "author": "Crazymoomin", "author_url": "https://biology.stackexchange.com/users/77121/crazymoomin", "author_user_type": "registered", "content_license": "CC BY-SA 4.0", "created_at": "2024-08-14T14:44:29+00:00", "is_accepted": false, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:03:25.304620+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/7fe0b66593eb4c0f175024453138b8bd50811f1580a079ffb990af38e09cd1cf_0.json", "raw_sha256": "b0a655f3b4c9626cf981180b3ac018a4a26330c5ab9b925b3df78bedd8169a84", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/questions/115493;115490;115488;115483;115479;115477;115456;115453;115452;115447;115445;115444;115436;115431;115427;115413;115404;115403;115396;115391;115389;115388;115386;115383;115382;115379;115367;115365;115355;115340;115334;115328;115321;115314;115309;115304;115296;115295;115292;115283;115272;115270;115269;115265;115264;115260;115255;115252;115243;115235;115233;115225;115218;115215;115214;115213;115207;115204;115179;115177;115170;115167;115165;115164;115154;115149;115137;115131;115129;115115;115107;115099;115095;115094;115093;115085;115082;115081;115077;115076;115075;115074;115073;115072;115063;115044;115039;115035;115030;115025;115022;115019;115016;115012;115003;115002;114997;114993;114991;114987/answers?filter=withbody&order=asc&page=1&pagesize=100&site=biology&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_id": 115170, "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Crazymoomin", "profile_url": "https://biology.stackexchange.com/users/77121/crazymoomin", "user_type": "registered"}, "created_at": "2024-08-14T14:44:29+00:00", "raw_file": "raw/codex_api_v1/920b7e5633cbad837bacc37f0887fd883044a5fce63b6e0fa3cc1504390bec54_1790824091899465600_0.json", "raw_sha256": "bac2cc1988c9b300f258cae319a9302dc73ac2617e76f7491908df2a0b939d11", "revision_guid": "34124B84-4C54-404B-BD68-361FC0160072", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/34124B84-4C54-404B-BD68-361FC0160072/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Crazymoomin", "profile_url": "https://biology.stackexchange.com/users/77121/crazymoomin", "user_type": "registered"}, "created_at": "2024-08-14T14:50:43+00:00", "raw_file": "raw/codex_api_v1/920b7e5633cbad837bacc37f0887fd883044a5fce63b6e0fa3cc1504390bec54_1790824091899465600_0.json", "raw_sha256": "bac2cc1988c9b300f258cae319a9302dc73ac2617e76f7491908df2a0b939d11", "revision_guid": "90C8EF4F-C093-46C8-845F-34F1CDBE3D76", "revision_number": 2, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/90C8EF4F-C093-46C8-845F-34F1CDBE3D76/view-source"}], "score": 4, "updated_at": "2024-08-14T14:50:43+00:00"}, {"answer_html": "<p>There are some excellent answers already referencing melanin. I used to live in the Solomon Islands, and noticed that the people from the West of the islands, and also in the East of PNG were much darker than the neighbours: in fact they were among the darkest people I ever encountered anywhere in the world. I found this article useful: <a href=\"https://garamut.wordpress.com/2009/08/10/the-case-of-melanin-in-melanesia/\" rel=\"nofollow noreferrer\">The Case of Melanin in Melanesia</a>. It includes a map showing ultra violet levels, and it is quite clear that the high UV levels are correlated with the regions where skins are very dark.</p>\n<p>I recall Tim Flannery writing (alas, the book was lost during a move) that there are reefs in that area of the Western Solomons with an abundance of seafood, but that the optimum time for harvesting was also the peak for UV, hence greater selection pressure for melanin...</p>\n", "answer_id": 115189, "answer_text": "There are some excellent answers already referencing melanin. I used to live in the Solomon Islands, and noticed that the people from the West of the islands, and also in the East of PNG were much darker than the neighbours: in fact they were among the darkest people I ever encountered anywhere in the world. I found this article useful: The Case of Melanin in Melanesia (https://garamut.wordpress.com/2009/08/10/the-case-of-melanin-in-melanesia/). It includes a map showing ultra violet levels, and it is quite clear that the high UV levels are correlated with the regions where skins are very dark.\n\n\n\n\nI recall Tim Flannery writing (alas, the book was lost during a move) that there are reefs in that area of the Western Solomons with an abundance of seafood, but that the optimum time for harvesting was also the peak for UV, hence greater selection pressure for melanin...", "answer_url": "https://biology.stackexchange.com/a/115189", "author": "Simon Crase", "author_url": "https://biology.stackexchange.com/users/60999/simon-crase", "author_user_type": "registered", "content_license": "CC BY-SA 4.0", "created_at": "2024-08-15T06:47:00+00:00", "is_accepted": false, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:03:25.304620+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/7fe0b66593eb4c0f175024453138b8bd50811f1580a079ffb990af38e09cd1cf_0.json", "raw_sha256": "b0a655f3b4c9626cf981180b3ac018a4a26330c5ab9b925b3df78bedd8169a84", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/questions/115493;115490;115488;115483;115479;115477;115456;115453;115452;115447;115445;115444;115436;115431;115427;115413;115404;115403;115396;115391;115389;115388;115386;115383;115382;115379;115367;115365;115355;115340;115334;115328;115321;115314;115309;115304;115296;115295;115292;115283;115272;115270;115269;115265;115264;115260;115255;115252;115243;115235;115233;115225;115218;115215;115214;115213;115207;115204;115179;115177;115170;115167;115165;115164;115154;115149;115137;115131;115129;115115;115107;115099;115095;115094;115093;115085;115082;115081;115077;115076;115075;115074;115073;115072;115063;115044;115039;115035;115030;115025;115022;115019;115016;115012;115003;115002;114997;114993;114991;114987/answers?filter=withbody&order=asc&page=1&pagesize=100&site=biology&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_id": 115170, "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Simon Crase", "profile_url": "https://biology.stackexchange.com/users/60999/simon-crase", "user_type": "registered"}, "created_at": "2024-08-15T06:47:00+00:00", "raw_file": "raw/codex_api_v1/920b7e5633cbad837bacc37f0887fd883044a5fce63b6e0fa3cc1504390bec54_1790824091899465600_0.json", "raw_sha256": "bac2cc1988c9b300f258cae319a9302dc73ac2617e76f7491908df2a0b939d11", "revision_guid": "06C3F178-4AC5-4566-87E9-1B7866F7776D", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/06C3F178-4AC5-4566-87E9-1B7866F7776D/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Simon Crase", "profile_url": "https://biology.stackexchange.com/users/60999/simon-crase", "user_type": "registered"}, "created_at": "2024-08-16T00:56:43+00:00", "raw_file": "raw/codex_api_v1/920b7e5633cbad837bacc37f0887fd883044a5fce63b6e0fa3cc1504390bec54_1790824091899465600_0.json", "raw_sha256": "bac2cc1988c9b300f258cae319a9302dc73ac2617e76f7491908df2a0b939d11", "revision_guid": "E63DE613-A666-4300-87F8-B4DFC7B8CA59", "revision_number": 2, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/E63DE613-A666-4300-87F8-B4DFC7B8CA59/view-source"}], "score": 5, "updated_at": "2024-08-16T00:56:43+00:00"}, {"answer_html": "<p>The best natural sun protection is melanin. But melanin makes it harder for the skin to produce vitamin D. In places with lots of UV radiation black skin is an evolutionary advantage, and the weaker vitamin D absorption is no big problem because there is so much UV radiation.</p>\n<p>Now if you live in northern areas, your sun protection isn’t as good as it could be, but lots of melanin would reduce vitamin d absorption too much, because there isn’t enough UV radiation around. So there is a balancing act: Better sun protection would hurt your health in different ways.</p>\n<p>Also careless sun exposure was very much a thing say 1980 to 2000. Many people have wised up to the dangers and will avoid roasting themselves on the beach. So hopefully cases of cancer etc. will go down in the future. And health agencies are much more risk averse nowadays, and to some degree they have to because people get older and more survive to an age where skin cancer actually hits them.</p>\n", "answer_id": 115195, "answer_text": "The best natural sun protection is melanin. But melanin makes it harder for the skin to produce vitamin D. In places with lots of UV radiation black skin is an evolutionary advantage, and the weaker vitamin D absorption is no big problem because there is so much UV radiation.\n\n\n\n\nNow if you live in northern areas, your sun protection isn’t as good as it could be, but lots of melanin would reduce vitamin d absorption too much, because there isn’t enough UV radiation around. So there is a balancing act: Better sun protection would hurt your health in different ways.\n\n\n\n\nAlso careless sun exposure was very much a thing say 1980 to 2000. Many people have wised up to the dangers and will avoid roasting themselves on the beach. So hopefully cases of cancer etc. will go down in the future. And health agencies are much more risk averse nowadays, and to some degree they have to because people get older and more survive to an age where skin cancer actually hits them.", "answer_url": "https://biology.stackexchange.com/a/115195", "author": "gnasher729", "author_url": "https://biology.stackexchange.com/users/10077/gnasher729", "author_user_type": "registered", "content_license": "CC BY-SA 4.0", "created_at": "2024-08-15T20:13:04+00:00", "is_accepted": false, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:03:25.304620+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/7fe0b66593eb4c0f175024453138b8bd50811f1580a079ffb990af38e09cd1cf_0.json", "raw_sha256": "b0a655f3b4c9626cf981180b3ac018a4a26330c5ab9b925b3df78bedd8169a84", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/questions/115493;115490;115488;115483;115479;115477;115456;115453;115452;115447;115445;115444;115436;115431;115427;115413;115404;115403;115396;115391;115389;115388;115386;115383;115382;115379;115367;115365;115355;115340;115334;115328;115321;115314;115309;115304;115296;115295;115292;115283;115272;115270;115269;115265;115264;115260;115255;115252;115243;115235;115233;115225;115218;115215;115214;115213;115207;115204;115179;115177;115170;115167;115165;115164;115154;115149;115137;115131;115129;115115;115107;115099;115095;115094;115093;115085;115082;115081;115077;115076;115075;115074;115073;115072;115063;115044;115039;115035;115030;115025;115022;115019;115016;115012;115003;115002;114997;114993;114991;114987/answers?filter=withbody&order=asc&page=1&pagesize=100&site=biology&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_id": 115170, "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "gnasher729", "profile_url": "https://biology.stackexchange.com/users/10077/gnasher729", "user_type": "registered"}, "created_at": "2024-08-15T20:13:04+00:00", "raw_file": "raw/codex_api_v1/920b7e5633cbad837bacc37f0887fd883044a5fce63b6e0fa3cc1504390bec54_1790824091899465600_0.json", "raw_sha256": "bac2cc1988c9b300f258cae319a9302dc73ac2617e76f7491908df2a0b939d11", "revision_guid": "B98FEE88-41D0-4F31-8B9A-0D171031B546", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/B98FEE88-41D0-4F31-8B9A-0D171031B546/view-source"}, {"content_license": null, "contributor": {"display_name": "AliceD", "profile_url": "https://biology.stackexchange.com/users/9943/aliced", "user_type": "registered"}, "created_at": "2024-08-16T08:10:35+00:00", "raw_file": "raw/codex_api_v1/920b7e5633cbad837bacc37f0887fd883044a5fce63b6e0fa3cc1504390bec54_1790824091899465600_0.json", "raw_sha256": "bac2cc1988c9b300f258cae319a9302dc73ac2617e76f7491908df2a0b939d11", "revision_guid": "261F1C4D-1ECD-48FA-8442-CED29305E440", "revision_number": null, "revision_type": "vote_based", "revision_url": "https://biology.stackexchange.com/revisions/261F1C4D-1ECD-48FA-8442-CED29305E440/view-source"}], "score": 8, "updated_at": "2024-08-15T20:13:04+00:00"}, {"answer_html": "<p>Because cancer wasn't likely to be one's cause of death. Look <a href=\"https://www.statista.com/statistics/235703/major-causes-of-death-in-the-us/\" rel=\"nofollow noreferrer\">at this comparison</a> between 1900 and 2022:</p>\n<p><a href=\"https://i.sstatic.net/pzQsLWkf.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.sstatic.net/pzQsLWkf.png\" alt=\"enter image description here\" /></a></p>\n<p>Cancer used to be the cause of 5% of human deaths. Nowadays its at 24% thanks to us conquering diseases like tuberculosis and influenza. Similar data is available for the UK <a href=\"https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2672390/\" rel=\"nofollow noreferrer\">in the 1850s</a>:</p>\n<blockquote>\n<p>Cancers were relatively rare. While the Victorians did not possess sophisticated diagnostic or screening technology, they were as able to diagnose late stage cancer as we are today; but this was an uncommon finding. In that period, cancer carried none of the stigma that it has recently acquired, and was diagnosed without bias. For example, in 1869 the Physician to Charing Cross Hospital describes lung cancer as ‘… one of the rarer forms of a rare disease. You may probably pass the rest of your students life without seeing another example of it.’</p>\n</blockquote>\n<p>Evolution can't solve every problem all at once. Cancer was simply too far down the list of causes of mortality for it to enact sufficient evolutionary pressure. We <a href=\"https://en.wikipedia.org/wiki/Devil_facial_tumour_disease\" rel=\"nofollow noreferrer\">also have evidence</a> from the Tasmanian Devil population showing that immunity to certain types of cancers can evolve very quickly if necessary:</p>\n<blockquote>\n<p>Devil facial tumour disease (DFTD) is an aggressive non-viral clonally transmissible cancer which affects Tasmanian devils, a marsupial native to the Australian island of Tasmania. The cancer manifests itself as lumps of soft and ulcerating tissue around the mouth, which may invade surrounding organs and metastasise to other parts of the body. Severe genetic abnormalities exist in cancer cells—for example, DFT2 cells are tetraploid, containing twice as much genetic material as normal cells. DFTD is most often spread by bites, when teeth come into contact with cancer cells; less important pathways of transmission are ingesting of infected carcasses and sharing of food. Adult Tasmanian devils who are otherwise the fittest are most susceptible to the disease. DFTD is estimated to have first developed in 1986.</p>\n<p>...</p>\n<p>In 2016, devils are endangered as the localised populations were shown to have declined by 90 per cent and an overall species decline of more than 80 per cent in less than 20 years, with some models predicting extinction. Despite this, devil populations persist in disease-stricken areas. The devils have, in a way, fought back the extinction by developing the gene that is immune to face tumors. The genes have already existed in the Tasmanian devil as part of their immune system. They increased in frequency due to natural selection. That is, the individuals with particular forms of these genes (alleles) survived and reproduced disproportionately to those that lacked the specific variants when disease was present.</p>\n</blockquote>\n", "answer_id": 115199, "answer_text": "Because cancer wasn't likely to be one's cause of death. Look at this comparison (https://www.statista.com/statistics/235703/major-causes-of-death-in-the-us/) between 1900 and 2022:\n\n\n\n\n[image: enter image description here; source: https://i.sstatic.net/pzQsLWkf.png] (https://i.sstatic.net/pzQsLWkf.png)\n\n\n\n\nCancer used to be the cause of 5% of human deaths. Nowadays its at 24% thanks to us conquering diseases like tuberculosis and influenza. Similar data is available for the UK in the 1850s (https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2672390/):\n\n\n\n\n\n\n\nCancers were relatively rare. While the Victorians did not possess sophisticated diagnostic or screening technology, they were as able to diagnose late stage cancer as we are today; but this was an uncommon finding. In that period, cancer carried none of the stigma that it has recently acquired, and was diagnosed without bias. For example, in 1869 the Physician to Charing Cross Hospital describes lung cancer as ‘… one of the rarer forms of a rare disease. You may probably pass the rest of your students life without seeing another example of it.’\n\n\n\n\n\n\n\nEvolution can't solve every problem all at once. Cancer was simply too far down the list of causes of mortality for it to enact sufficient evolutionary pressure. We also have evidence (https://en.wikipedia.org/wiki/Devil_facial_tumour_disease) from the Tasmanian Devil population showing that immunity to certain types of cancers can evolve very quickly if necessary:\n\n\n\n\n\n\n\nDevil facial tumour disease (DFTD) is an aggressive non-viral clonally transmissible cancer which affects Tasmanian devils, a marsupial native to the Australian island of Tasmania. The cancer manifests itself as lumps of soft and ulcerating tissue around the mouth, which may invade surrounding organs and metastasise to other parts of the body. Severe genetic abnormalities exist in cancer cells—for example, DFT2 cells are tetraploid, containing twice as much genetic material as normal cells. DFTD is most often spread by bites, when teeth come into contact with cancer cells; less important pathways of transmission are ingesting of infected carcasses and sharing of food. Adult Tasmanian devils who are otherwise the fittest are most susceptible to the disease. DFTD is estimated to have first developed in 1986.\n\n\n\n\n...\n\n\n\n\nIn 2016, devils are endangered as the localised populations were shown to have declined by 90 per cent and an overall species decline of more than 80 per cent in less than 20 years, with some models predicting extinction. Despite this, devil populations persist in disease-stricken areas. The devils have, in a way, fought back the extinction by developing the gene that is immune to face tumors. The genes have already existed in the Tasmanian devil as part of their immune system. They increased in frequency due to natural selection. That is, the individuals with particular forms of these genes (alleles) survived and reproduced disproportionately to those that lacked the specific variants when disease was present.", "answer_url": "https://biology.stackexchange.com/a/115199", "author": "MilkLife", "author_url": "https://biology.stackexchange.com/users/5492/milklife", "author_user_type": "registered", "content_license": "CC BY-SA 4.0", "created_at": "2024-08-16T23:47:16+00:00", "is_accepted": false, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:03:25.304620+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/7fe0b66593eb4c0f175024453138b8bd50811f1580a079ffb990af38e09cd1cf_0.json", "raw_sha256": "b0a655f3b4c9626cf981180b3ac018a4a26330c5ab9b925b3df78bedd8169a84", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/questions/115493;115490;115488;115483;115479;115477;115456;115453;115452;115447;115445;115444;115436;115431;115427;115413;115404;115403;115396;115391;115389;115388;115386;115383;115382;115379;115367;115365;115355;115340;115334;115328;115321;115314;115309;115304;115296;115295;115292;115283;115272;115270;115269;115265;115264;115260;115255;115252;115243;115235;115233;115225;115218;115215;115214;115213;115207;115204;115179;115177;115170;115167;115165;115164;115154;115149;115137;115131;115129;115115;115107;115099;115095;115094;115093;115085;115082;115081;115077;115076;115075;115074;115073;115072;115063;115044;115039;115035;115030;115025;115022;115019;115016;115012;115003;115002;114997;114993;114991;114987/answers?filter=withbody&order=asc&page=1&pagesize=100&site=biology&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_id": 115170, "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "MilkLife", "profile_url": "https://biology.stackexchange.com/users/5492/milklife", "user_type": "registered"}, "created_at": "2024-08-16T23:47:16+00:00", "raw_file": "raw/codex_api_v1/920b7e5633cbad837bacc37f0887fd883044a5fce63b6e0fa3cc1504390bec54_1790824091899465600_0.json", "raw_sha256": "bac2cc1988c9b300f258cae319a9302dc73ac2617e76f7491908df2a0b939d11", "revision_guid": "FA30453C-1E93-40D2-9D07-DDC697CEF2EA", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/FA30453C-1E93-40D2-9D07-DDC697CEF2EA/view-source"}], "score": 0, "updated_at": "2024-08-16T23:47:16+00:00"}], "ground_truth": "community signals only; no scientific truth label", "product": "ranking", "question": "Experts recommend that people apply sunscreen every two hours throughout the year, even in winter.\n\n\n\n\nEspecially phototypes I - III are supposed to be most vulnerable to harmful UV radiation, so especially these phototypes should take care to keep applying sunscreen and to use at least SPF 50. This, at least, is what European health agencies tell us.\n\n\n\n\nNative to Europe are phototypes (https://en.wikipedia.org/wiki/Fitzpatrick_scale) I - III. This means that these phototypes evolved in these precise conditions. Isn't evolution suppose to lead to best adaptations to the precise conditions native to the area an organism evolved in?\n\n\n\n\nSo, by this line of argument, phototypes I - III should be well-adapted to the levels of Sun radiation present in Europe. They should not have to use sunscreen there. When traveling to areas that are significantly higher in Sun radiation, such as equatorial areas, they may have to start using sunscreen - but not in areas they are native to.\n\n\n\n\nYet European agencies keep telling us that especially phototypes I - III should use sunscreen while in Europe.\n\n\n\n\nWhere is the error in my thinking?", "record_id": "Scientific-Answer-Ranking:biology:115170", "scores": [25, 53, 12, 4, 5, 8, 0], "split": "test", "thread": {"accepted_answer_id": null, "answers": [{"answer_html": "<p><sub>I find your question to be fine for this site, and you've provided the asked for sources, so it's fair to give you an answer.</sub></p>\n<blockquote>\n<p>Where is the error in my thinking?</p>\n</blockquote>\n<p>The error is in thinking that evolution is somehow directed towards the greater good. It's not. It's the result of <strong>random</strong> mutations.</p>\n<p>Evolution doesn't make us perfect for the environment in which we evolved. We will never be perfect in any way, let alone every way. You're only addressing the risks of UV light, but people can come up with any number of imaginable "deficiencies" in humans that make us "imperfectly evolved".</p>\n<p>That we're imperfect in no way means evolution has failed us somehow. Evolution doesn't occur to select for perfection. Evolution doesn't happen for any "reason" at all, in that it's not <em>directed</em> by a goal; evolution simply happens because <a href=\"https://www.nature.com/scitable/topicpage/dna-is-constantly-changing-through-the-process-6524898/\" rel=\"noreferrer\">DNA is mutable</a>. If a mutation is harmless or beneficial in an environment, it will be passed on and likely persist. If it's harmful, depending on the degree to which it's detrimental, it will not be passed on. Sometimes in an particular environment, a mutation is both (e.g. sickle cell trait.)</p>\n<p>If we're "good enough" overall to reproduce, if we're able to survive and pass on our genetic material, then that's what's going to happen, regardless of our perceived imperfections.</p>\n<p>Also, somewhat aside to your question are the <a href=\"https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3427189/\" rel=\"noreferrer\">benefits of UV light to humans</a>. We know that <a href=\"https://www.cuimc.columbia.edu/news/whats-deal-vitamin-d\" rel=\"noreferrer\">UVB allows us to synthesize Vitamin D, which is critical for survival.</a> There are other <a href=\"https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3427189/\" rel=\"noreferrer\">possible benefits to UV light as well</a>. It might well happen that we'll discover more concrete benefits.</p>\n<p>The question which has been linked to as a duplicate discusses evolution in more detail (and more helpfully). This is only a fairly quick answer.</p>\n", "answer_id": 115175, "answer_text": "I find your question to be fine for this site, and you've provided the asked for sources, so it's fair to give you an answer.\n\n\n\n\n\n\n\nWhere is the error in my thinking?\n\n\n\n\n\n\n\nThe error is in thinking that evolution is somehow directed towards the greater good. It's not. It's the result of random mutations.\n\n\n\n\nEvolution doesn't make us perfect for the environment in which we evolved. We will never be perfect in any way, let alone every way. You're only addressing the risks of UV light, but people can come up with any number of imaginable \"deficiencies\" in humans that make us \"imperfectly evolved\".\n\n\n\n\nThat we're imperfect in no way means evolution has failed us somehow. Evolution doesn't occur to select for perfection. Evolution doesn't happen for any \"reason\" at all, in that it's not directed by a goal; evolution simply happens because DNA is mutable (https://www.nature.com/scitable/topicpage/dna-is-constantly-changing-through-the-process-6524898/). If a mutation is harmless or beneficial in an environment, it will be passed on and likely persist. If it's harmful, depending on the degree to which it's detrimental, it will not be passed on. Sometimes in an particular environment, a mutation is both (e.g. sickle cell trait.)\n\n\n\n\nIf we're \"good enough\" overall to reproduce, if we're able to survive and pass on our genetic material, then that's what's going to happen, regardless of our perceived imperfections.\n\n\n\n\nAlso, somewhat aside to your question are the benefits of UV light to humans (https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3427189/). We know that UVB allows us to synthesize Vitamin D, which is critical for survival. (https://www.cuimc.columbia.edu/news/whats-deal-vitamin-d) There are other possible benefits to UV light as well (https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3427189/). It might well happen that we'll discover more concrete benefits.\n\n\n\n\nThe question which has been linked to as a duplicate discusses evolution in more detail (and more helpfully). This is only a fairly quick answer.", "answer_url": "https://biology.stackexchange.com/a/115175", "author": "anongoodnurse", "author_url": "https://biology.stackexchange.com/users/5198/anongoodnurse", "author_user_type": "registered", "content_license": "CC BY-SA 4.0", "created_at": "2024-08-13T19:19:48+00:00", "is_accepted": false, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:03:25.304620+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/7fe0b66593eb4c0f175024453138b8bd50811f1580a079ffb990af38e09cd1cf_0.json", "raw_sha256": "b0a655f3b4c9626cf981180b3ac018a4a26330c5ab9b925b3df78bedd8169a84", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/questions/115493;115490;115488;115483;115479;115477;115456;115453;115452;115447;115445;115444;115436;115431;115427;115413;115404;115403;115396;115391;115389;115388;115386;115383;115382;115379;115367;115365;115355;115340;115334;115328;115321;115314;115309;115304;115296;115295;115292;115283;115272;115270;115269;115265;115264;115260;115255;115252;115243;115235;115233;115225;115218;115215;115214;115213;115207;115204;115179;115177;115170;115167;115165;115164;115154;115149;115137;115131;115129;115115;115107;115099;115095;115094;115093;115085;115082;115081;115077;115076;115075;115074;115073;115072;115063;115044;115039;115035;115030;115025;115022;115019;115016;115012;115003;115002;114997;114993;114991;114987/answers?filter=withbody&order=asc&page=1&pagesize=100&site=biology&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_id": 115170, "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "anongoodnurse", "profile_url": "https://biology.stackexchange.com/users/5198/anongoodnurse", "user_type": "registered"}, "created_at": "2024-08-13T19:19:48+00:00", "raw_file": "raw/codex_api_v1/920b7e5633cbad837bacc37f0887fd883044a5fce63b6e0fa3cc1504390bec54_1790824091899465600_0.json", "raw_sha256": "bac2cc1988c9b300f258cae319a9302dc73ac2617e76f7491908df2a0b939d11", "revision_guid": "B27F09D5-F235-448E-AFF2-AD09B10346FA", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/B27F09D5-F235-448E-AFF2-AD09B10346FA/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "anongoodnurse", "profile_url": "https://biology.stackexchange.com/users/5198/anongoodnurse", "user_type": "registered"}, "created_at": "2024-08-13T19:27:18+00:00", "raw_file": "raw/codex_api_v1/920b7e5633cbad837bacc37f0887fd883044a5fce63b6e0fa3cc1504390bec54_1790824091899465600_0.json", "raw_sha256": "bac2cc1988c9b300f258cae319a9302dc73ac2617e76f7491908df2a0b939d11", "revision_guid": "D6BC325F-2058-42EC-A622-79DDDBAE9D28", "revision_number": 2, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/D6BC325F-2058-42EC-A622-79DDDBAE9D28/view-source"}, {"content_license": null, "contributor": {"display_name": "AliceD", "profile_url": "https://biology.stackexchange.com/users/9943/aliced", "user_type": "registered"}, "created_at": "2024-08-16T08:11:51+00:00", "raw_file": "raw/codex_api_v1/920b7e5633cbad837bacc37f0887fd883044a5fce63b6e0fa3cc1504390bec54_1790824091899465600_0.json", "raw_sha256": "bac2cc1988c9b300f258cae319a9302dc73ac2617e76f7491908df2a0b939d11", "revision_guid": "70F33937-681F-4BBB-90ED-DB3715ED6BF6", "revision_number": null, "revision_type": "vote_based", "revision_url": "https://biology.stackexchange.com/revisions/70F33937-681F-4BBB-90ED-DB3715ED6BF6/view-source"}], "score": 25, "updated_at": "2024-08-13T19:27:18+00:00"}, {"answer_html": "<p>Skin cancer typically results from a lifetime of sun exposure, and is usually seen in older individuals. 90% of new melanoma cases are diagnosed in people over 45. Nearly 95% of melanoma deaths are observed in people over 45. Simply put, humans' currently level of adaptation to the sun is "good enough" - the vast majority of people do not have their reproductive fitness affected in any way by how they handle sun exposure. There is little selective pressure that would result in someone with better sun adaptation being more likely to pass on their genes. Evolution won't typically operate on traits that are only meaningful after reproductive age, as "selective pressure" refers to selection for reproduction specifically.</p>\n<p><a href=\"https://seer.cancer.gov/statfacts/html/melan.html\" rel=\"noreferrer\">https://seer.cancer.gov/statfacts/html/melan.html</a></p>\n", "answer_id": 115176, "answer_text": "Skin cancer typically results from a lifetime of sun exposure, and is usually seen in older individuals. 90% of new melanoma cases are diagnosed in people over 45. Nearly 95% of melanoma deaths are observed in people over 45. Simply put, humans' currently level of adaptation to the sun is \"good enough\" - the vast majority of people do not have their reproductive fitness affected in any way by how they handle sun exposure. There is little selective pressure that would result in someone with better sun adaptation being more likely to pass on their genes. Evolution won't typically operate on traits that are only meaningful after reproductive age, as \"selective pressure\" refers to selection for reproduction specifically.\n\n\n\n\nhttps://seer.cancer.gov/statfacts/html/melan.html (https://seer.cancer.gov/statfacts/html/melan.html)", "answer_url": "https://biology.stackexchange.com/a/115176", "author": "Nuclear Hoagie", "author_url": "https://biology.stackexchange.com/users/16849/nuclear-hoagie", "author_user_type": "registered", "content_license": "CC BY-SA 4.0", "created_at": "2024-08-13T19:41:14+00:00", "is_accepted": false, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:03:25.304620+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/7fe0b66593eb4c0f175024453138b8bd50811f1580a079ffb990af38e09cd1cf_0.json", "raw_sha256": "b0a655f3b4c9626cf981180b3ac018a4a26330c5ab9b925b3df78bedd8169a84", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/questions/115493;115490;115488;115483;115479;115477;115456;115453;115452;115447;115445;115444;115436;115431;115427;115413;115404;115403;115396;115391;115389;115388;115386;115383;115382;115379;115367;115365;115355;115340;115334;115328;115321;115314;115309;115304;115296;115295;115292;115283;115272;115270;115269;115265;115264;115260;115255;115252;115243;115235;115233;115225;115218;115215;115214;115213;115207;115204;115179;115177;115170;115167;115165;115164;115154;115149;115137;115131;115129;115115;115107;115099;115095;115094;115093;115085;115082;115081;115077;115076;115075;115074;115073;115072;115063;115044;115039;115035;115030;115025;115022;115019;115016;115012;115003;115002;114997;114993;114991;114987/answers?filter=withbody&order=asc&page=1&pagesize=100&site=biology&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_id": 115170, "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Nuclear Hoagie", "profile_url": "https://biology.stackexchange.com/users/16849/nuclear-hoagie", "user_type": "registered"}, "created_at": "2024-08-13T19:41:14+00:00", "raw_file": "raw/codex_api_v1/920b7e5633cbad837bacc37f0887fd883044a5fce63b6e0fa3cc1504390bec54_1790824091899465600_0.json", "raw_sha256": "bac2cc1988c9b300f258cae319a9302dc73ac2617e76f7491908df2a0b939d11", "revision_guid": "E020D650-7DF7-42B4-A813-C07287A63A06", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/E020D650-7DF7-42B4-A813-C07287A63A06/view-source"}], "score": 53, "updated_at": "2024-08-13T19:41:14+00:00"}, {"answer_html": "<p>Besides the arguments already mentioned in the previous answers, the human body has developed numerous ways to protect itself from the harmful effects of sunlight and ultraviolet (UV) radiation.</p>\n<ul>\n<li><p>Melanin Production:</p>\n<p>Melanin is the main pigment in the skin that absorbs UV radiation to\nkeep it from damaging its structure. So, if the skin is exposed to UV\nrays, it is going to make more of this pigment, making the skin\ndarker, or tanned, which is a way of a protective response to the\ndeeper layers of the skin from getting damaged. This process helps absorb and dissipate UV radiation, reducing the risk of DNA damage that can lead to skin cancer.</p>\n</li>\n<li><p>Epidermal Thickening:</p>\n<p>Another defense mechanism is the thickening of the outermost skin layers (epidermis) in response to UV exposure. This thickening serves to attenuate UV penetration to deeper skin layers, thus providing an additional barrier against potential damage.</p>\n</li>\n<li><p>DNA Repair Mechanisms:</p>\n<p>The human skin protects its genetic material from being damaged by\nDNA repair. These mechanisms are the body's way of dealing\nwith and repairing UV-induced damage by the sun. This includes repair mechanisms like the <a href=\"https://en.wikipedia.org/wiki/Photolyase\" rel=\"noreferrer\">photolyase</a> repair mechanism, which specifically repairs pyrimidine dimers of the DNA which are generated by UV exposure.</p>\n</li>\n<li><p>Inflammatory Response:</p>\n<p>The acute response to excessive UV exposure is sunburn. This reaction is part of the body's inflammatory response, which serves to alert the immune system to potential damage and initiate repair processes.</p>\n</li>\n</ul>\n", "answer_id": 115181, "answer_text": "Besides the arguments already mentioned in the previous answers, the human body has developed numerous ways to protect itself from the harmful effects of sunlight and ultraviolet (UV) radiation.\n\n\n\n\n\n\n\nMelanin Production:\n\n\n\n\nMelanin is the main pigment in the skin that absorbs UV radiation to\nkeep it from damaging its structure. So, if the skin is exposed to UV\nrays, it is going to make more of this pigment, making the skin\ndarker, or tanned, which is a way of a protective response to the\ndeeper layers of the skin from getting damaged. This process helps absorb and dissipate UV radiation, reducing the risk of DNA damage that can lead to skin cancer.\n\n\n\n\n\n\n\n\n\nEpidermal Thickening:\n\n\n\n\nAnother defense mechanism is the thickening of the outermost skin layers (epidermis) in response to UV exposure. This thickening serves to attenuate UV penetration to deeper skin layers, thus providing an additional barrier against potential damage.\n\n\n\n\n\n\n\n\n\nDNA Repair Mechanisms:\n\n\n\n\nThe human skin protects its genetic material from being damaged by\nDNA repair. These mechanisms are the body's way of dealing\nwith and repairing UV-induced damage by the sun. This includes repair mechanisms like the photolyase (https://en.wikipedia.org/wiki/Photolyase) repair mechanism, which specifically repairs pyrimidine dimers of the DNA which are generated by UV exposure.\n\n\n\n\n\n\n\n\n\nInflammatory Response:\n\n\n\n\nThe acute response to excessive UV exposure is sunburn. This reaction is part of the body's inflammatory response, which serves to alert the immune system to potential damage and initiate repair processes.", "answer_url": "https://biology.stackexchange.com/a/115181", "author": "Chris", "author_url": "https://biology.stackexchange.com/users/5144/chris", "author_user_type": "moderator", "content_license": "CC BY-SA 4.0", "created_at": "2024-08-14T08:30:31+00:00", "is_accepted": false, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:03:25.304620+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/7fe0b66593eb4c0f175024453138b8bd50811f1580a079ffb990af38e09cd1cf_0.json", "raw_sha256": "b0a655f3b4c9626cf981180b3ac018a4a26330c5ab9b925b3df78bedd8169a84", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/questions/115493;115490;115488;115483;115479;115477;115456;115453;115452;115447;115445;115444;115436;115431;115427;115413;115404;115403;115396;115391;115389;115388;115386;115383;115382;115379;115367;115365;115355;115340;115334;115328;115321;115314;115309;115304;115296;115295;115292;115283;115272;115270;115269;115265;115264;115260;115255;115252;115243;115235;115233;115225;115218;115215;115214;115213;115207;115204;115179;115177;115170;115167;115165;115164;115154;115149;115137;115131;115129;115115;115107;115099;115095;115094;115093;115085;115082;115081;115077;115076;115075;115074;115073;115072;115063;115044;115039;115035;115030;115025;115022;115019;115016;115012;115003;115002;114997;114993;114991;114987/answers?filter=withbody&order=asc&page=1&pagesize=100&site=biology&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_id": 115170, "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Chris", "profile_url": "https://biology.stackexchange.com/users/5144/chris", "user_type": "moderator"}, "created_at": "2024-08-14T08:30:31+00:00", "raw_file": "raw/codex_api_v1/920b7e5633cbad837bacc37f0887fd883044a5fce63b6e0fa3cc1504390bec54_1790824091899465600_0.json", "raw_sha256": "bac2cc1988c9b300f258cae319a9302dc73ac2617e76f7491908df2a0b939d11", "revision_guid": "203DF798-60CE-4A5B-942C-F9066DA8BFEC", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/203DF798-60CE-4A5B-942C-F9066DA8BFEC/view-source"}], "score": 12, "updated_at": "2024-08-14T08:30:31+00:00"}, {"answer_html": "<p>To add to other answers, there have been behavioral changes in many societies with paler skin phototypes that have increased the risk of skin cancer. Laying on a beach or in a park to get a suntan is an activity that's only become common in recent decades, for centuries Europeans avoided working outside around the midday sun during summer (such as sleeping in the shade) and when working outside wore clothing that covered up most of the skin along with wide brimmed hats or other head covering (have a look at typical medieval peasant dress). That was enough to mitigate most of the risk of skin cancer, but not in more equatorial countries.</p>\n", "answer_id": 115184, "answer_text": "To add to other answers, there have been behavioral changes in many societies with paler skin phototypes that have increased the risk of skin cancer. Laying on a beach or in a park to get a suntan is an activity that's only become common in recent decades, for centuries Europeans avoided working outside around the midday sun during summer (such as sleeping in the shade) and when working outside wore clothing that covered up most of the skin along with wide brimmed hats or other head covering (have a look at typical medieval peasant dress). That was enough to mitigate most of the risk of skin cancer, but not in more equatorial countries.", "answer_url": "https://biology.stackexchange.com/a/115184", "author": "Crazymoomin", "author_url": "https://biology.stackexchange.com/users/77121/crazymoomin", "author_user_type": "registered", "content_license": "CC BY-SA 4.0", "created_at": "2024-08-14T14:44:29+00:00", "is_accepted": false, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:03:25.304620+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/7fe0b66593eb4c0f175024453138b8bd50811f1580a079ffb990af38e09cd1cf_0.json", "raw_sha256": "b0a655f3b4c9626cf981180b3ac018a4a26330c5ab9b925b3df78bedd8169a84", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/questions/115493;115490;115488;115483;115479;115477;115456;115453;115452;115447;115445;115444;115436;115431;115427;115413;115404;115403;115396;115391;115389;115388;115386;115383;115382;115379;115367;115365;115355;115340;115334;115328;115321;115314;115309;115304;115296;115295;115292;115283;115272;115270;115269;115265;115264;115260;115255;115252;115243;115235;115233;115225;115218;115215;115214;115213;115207;115204;115179;115177;115170;115167;115165;115164;115154;115149;115137;115131;115129;115115;115107;115099;115095;115094;115093;115085;115082;115081;115077;115076;115075;115074;115073;115072;115063;115044;115039;115035;115030;115025;115022;115019;115016;115012;115003;115002;114997;114993;114991;114987/answers?filter=withbody&order=asc&page=1&pagesize=100&site=biology&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_id": 115170, "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Crazymoomin", "profile_url": "https://biology.stackexchange.com/users/77121/crazymoomin", "user_type": "registered"}, "created_at": "2024-08-14T14:44:29+00:00", "raw_file": "raw/codex_api_v1/920b7e5633cbad837bacc37f0887fd883044a5fce63b6e0fa3cc1504390bec54_1790824091899465600_0.json", "raw_sha256": "bac2cc1988c9b300f258cae319a9302dc73ac2617e76f7491908df2a0b939d11", "revision_guid": "34124B84-4C54-404B-BD68-361FC0160072", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/34124B84-4C54-404B-BD68-361FC0160072/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Crazymoomin", "profile_url": "https://biology.stackexchange.com/users/77121/crazymoomin", "user_type": "registered"}, "created_at": "2024-08-14T14:50:43+00:00", "raw_file": "raw/codex_api_v1/920b7e5633cbad837bacc37f0887fd883044a5fce63b6e0fa3cc1504390bec54_1790824091899465600_0.json", "raw_sha256": "bac2cc1988c9b300f258cae319a9302dc73ac2617e76f7491908df2a0b939d11", "revision_guid": "90C8EF4F-C093-46C8-845F-34F1CDBE3D76", "revision_number": 2, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/90C8EF4F-C093-46C8-845F-34F1CDBE3D76/view-source"}], "score": 4, "updated_at": "2024-08-14T14:50:43+00:00"}, {"answer_html": "<p>There are some excellent answers already referencing melanin. I used to live in the Solomon Islands, and noticed that the people from the West of the islands, and also in the East of PNG were much darker than the neighbours: in fact they were among the darkest people I ever encountered anywhere in the world. I found this article useful: <a href=\"https://garamut.wordpress.com/2009/08/10/the-case-of-melanin-in-melanesia/\" rel=\"nofollow noreferrer\">The Case of Melanin in Melanesia</a>. It includes a map showing ultra violet levels, and it is quite clear that the high UV levels are correlated with the regions where skins are very dark.</p>\n<p>I recall Tim Flannery writing (alas, the book was lost during a move) that there are reefs in that area of the Western Solomons with an abundance of seafood, but that the optimum time for harvesting was also the peak for UV, hence greater selection pressure for melanin...</p>\n", "answer_id": 115189, "answer_text": "There are some excellent answers already referencing melanin. I used to live in the Solomon Islands, and noticed that the people from the West of the islands, and also in the East of PNG were much darker than the neighbours: in fact they were among the darkest people I ever encountered anywhere in the world. I found this article useful: The Case of Melanin in Melanesia (https://garamut.wordpress.com/2009/08/10/the-case-of-melanin-in-melanesia/). It includes a map showing ultra violet levels, and it is quite clear that the high UV levels are correlated with the regions where skins are very dark.\n\n\n\n\nI recall Tim Flannery writing (alas, the book was lost during a move) that there are reefs in that area of the Western Solomons with an abundance of seafood, but that the optimum time for harvesting was also the peak for UV, hence greater selection pressure for melanin...", "answer_url": "https://biology.stackexchange.com/a/115189", "author": "Simon Crase", "author_url": "https://biology.stackexchange.com/users/60999/simon-crase", "author_user_type": "registered", "content_license": "CC BY-SA 4.0", "created_at": "2024-08-15T06:47:00+00:00", "is_accepted": false, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:03:25.304620+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/7fe0b66593eb4c0f175024453138b8bd50811f1580a079ffb990af38e09cd1cf_0.json", "raw_sha256": "b0a655f3b4c9626cf981180b3ac018a4a26330c5ab9b925b3df78bedd8169a84", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/questions/115493;115490;115488;115483;115479;115477;115456;115453;115452;115447;115445;115444;115436;115431;115427;115413;115404;115403;115396;115391;115389;115388;115386;115383;115382;115379;115367;115365;115355;115340;115334;115328;115321;115314;115309;115304;115296;115295;115292;115283;115272;115270;115269;115265;115264;115260;115255;115252;115243;115235;115233;115225;115218;115215;115214;115213;115207;115204;115179;115177;115170;115167;115165;115164;115154;115149;115137;115131;115129;115115;115107;115099;115095;115094;115093;115085;115082;115081;115077;115076;115075;115074;115073;115072;115063;115044;115039;115035;115030;115025;115022;115019;115016;115012;115003;115002;114997;114993;114991;114987/answers?filter=withbody&order=asc&page=1&pagesize=100&site=biology&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_id": 115170, "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Simon Crase", "profile_url": "https://biology.stackexchange.com/users/60999/simon-crase", "user_type": "registered"}, "created_at": "2024-08-15T06:47:00+00:00", "raw_file": "raw/codex_api_v1/920b7e5633cbad837bacc37f0887fd883044a5fce63b6e0fa3cc1504390bec54_1790824091899465600_0.json", "raw_sha256": "bac2cc1988c9b300f258cae319a9302dc73ac2617e76f7491908df2a0b939d11", "revision_guid": "06C3F178-4AC5-4566-87E9-1B7866F7776D", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/06C3F178-4AC5-4566-87E9-1B7866F7776D/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Simon Crase", "profile_url": "https://biology.stackexchange.com/users/60999/simon-crase", "user_type": "registered"}, "created_at": "2024-08-16T00:56:43+00:00", "raw_file": "raw/codex_api_v1/920b7e5633cbad837bacc37f0887fd883044a5fce63b6e0fa3cc1504390bec54_1790824091899465600_0.json", "raw_sha256": "bac2cc1988c9b300f258cae319a9302dc73ac2617e76f7491908df2a0b939d11", "revision_guid": "E63DE613-A666-4300-87F8-B4DFC7B8CA59", "revision_number": 2, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/E63DE613-A666-4300-87F8-B4DFC7B8CA59/view-source"}], "score": 5, "updated_at": "2024-08-16T00:56:43+00:00"}, {"answer_html": "<p>The best natural sun protection is melanin. But melanin makes it harder for the skin to produce vitamin D. In places with lots of UV radiation black skin is an evolutionary advantage, and the weaker vitamin D absorption is no big problem because there is so much UV radiation.</p>\n<p>Now if you live in northern areas, your sun protection isn’t as good as it could be, but lots of melanin would reduce vitamin d absorption too much, because there isn’t enough UV radiation around. So there is a balancing act: Better sun protection would hurt your health in different ways.</p>\n<p>Also careless sun exposure was very much a thing say 1980 to 2000. Many people have wised up to the dangers and will avoid roasting themselves on the beach. So hopefully cases of cancer etc. will go down in the future. And health agencies are much more risk averse nowadays, and to some degree they have to because people get older and more survive to an age where skin cancer actually hits them.</p>\n", "answer_id": 115195, "answer_text": "The best natural sun protection is melanin. But melanin makes it harder for the skin to produce vitamin D. In places with lots of UV radiation black skin is an evolutionary advantage, and the weaker vitamin D absorption is no big problem because there is so much UV radiation.\n\n\n\n\nNow if you live in northern areas, your sun protection isn’t as good as it could be, but lots of melanin would reduce vitamin d absorption too much, because there isn’t enough UV radiation around. So there is a balancing act: Better sun protection would hurt your health in different ways.\n\n\n\n\nAlso careless sun exposure was very much a thing say 1980 to 2000. Many people have wised up to the dangers and will avoid roasting themselves on the beach. So hopefully cases of cancer etc. will go down in the future. And health agencies are much more risk averse nowadays, and to some degree they have to because people get older and more survive to an age where skin cancer actually hits them.", "answer_url": "https://biology.stackexchange.com/a/115195", "author": "gnasher729", "author_url": "https://biology.stackexchange.com/users/10077/gnasher729", "author_user_type": "registered", "content_license": "CC BY-SA 4.0", "created_at": "2024-08-15T20:13:04+00:00", "is_accepted": false, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:03:25.304620+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/7fe0b66593eb4c0f175024453138b8bd50811f1580a079ffb990af38e09cd1cf_0.json", "raw_sha256": "b0a655f3b4c9626cf981180b3ac018a4a26330c5ab9b925b3df78bedd8169a84", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/questions/115493;115490;115488;115483;115479;115477;115456;115453;115452;115447;115445;115444;115436;115431;115427;115413;115404;115403;115396;115391;115389;115388;115386;115383;115382;115379;115367;115365;115355;115340;115334;115328;115321;115314;115309;115304;115296;115295;115292;115283;115272;115270;115269;115265;115264;115260;115255;115252;115243;115235;115233;115225;115218;115215;115214;115213;115207;115204;115179;115177;115170;115167;115165;115164;115154;115149;115137;115131;115129;115115;115107;115099;115095;115094;115093;115085;115082;115081;115077;115076;115075;115074;115073;115072;115063;115044;115039;115035;115030;115025;115022;115019;115016;115012;115003;115002;114997;114993;114991;114987/answers?filter=withbody&order=asc&page=1&pagesize=100&site=biology&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_id": 115170, "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "gnasher729", "profile_url": "https://biology.stackexchange.com/users/10077/gnasher729", "user_type": "registered"}, "created_at": "2024-08-15T20:13:04+00:00", "raw_file": "raw/codex_api_v1/920b7e5633cbad837bacc37f0887fd883044a5fce63b6e0fa3cc1504390bec54_1790824091899465600_0.json", "raw_sha256": "bac2cc1988c9b300f258cae319a9302dc73ac2617e76f7491908df2a0b939d11", "revision_guid": "B98FEE88-41D0-4F31-8B9A-0D171031B546", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/B98FEE88-41D0-4F31-8B9A-0D171031B546/view-source"}, {"content_license": null, "contributor": {"display_name": "AliceD", "profile_url": "https://biology.stackexchange.com/users/9943/aliced", "user_type": "registered"}, "created_at": "2024-08-16T08:10:35+00:00", "raw_file": "raw/codex_api_v1/920b7e5633cbad837bacc37f0887fd883044a5fce63b6e0fa3cc1504390bec54_1790824091899465600_0.json", "raw_sha256": "bac2cc1988c9b300f258cae319a9302dc73ac2617e76f7491908df2a0b939d11", "revision_guid": "261F1C4D-1ECD-48FA-8442-CED29305E440", "revision_number": null, "revision_type": "vote_based", "revision_url": "https://biology.stackexchange.com/revisions/261F1C4D-1ECD-48FA-8442-CED29305E440/view-source"}], "score": 8, "updated_at": "2024-08-15T20:13:04+00:00"}, {"answer_html": "<p>Because cancer wasn't likely to be one's cause of death. Look <a href=\"https://www.statista.com/statistics/235703/major-causes-of-death-in-the-us/\" rel=\"nofollow noreferrer\">at this comparison</a> between 1900 and 2022:</p>\n<p><a href=\"https://i.sstatic.net/pzQsLWkf.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.sstatic.net/pzQsLWkf.png\" alt=\"enter image description here\" /></a></p>\n<p>Cancer used to be the cause of 5% of human deaths. Nowadays its at 24% thanks to us conquering diseases like tuberculosis and influenza. Similar data is available for the UK <a href=\"https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2672390/\" rel=\"nofollow noreferrer\">in the 1850s</a>:</p>\n<blockquote>\n<p>Cancers were relatively rare. While the Victorians did not possess sophisticated diagnostic or screening technology, they were as able to diagnose late stage cancer as we are today; but this was an uncommon finding. In that period, cancer carried none of the stigma that it has recently acquired, and was diagnosed without bias. For example, in 1869 the Physician to Charing Cross Hospital describes lung cancer as ‘… one of the rarer forms of a rare disease. You may probably pass the rest of your students life without seeing another example of it.’</p>\n</blockquote>\n<p>Evolution can't solve every problem all at once. Cancer was simply too far down the list of causes of mortality for it to enact sufficient evolutionary pressure. We <a href=\"https://en.wikipedia.org/wiki/Devil_facial_tumour_disease\" rel=\"nofollow noreferrer\">also have evidence</a> from the Tasmanian Devil population showing that immunity to certain types of cancers can evolve very quickly if necessary:</p>\n<blockquote>\n<p>Devil facial tumour disease (DFTD) is an aggressive non-viral clonally transmissible cancer which affects Tasmanian devils, a marsupial native to the Australian island of Tasmania. The cancer manifests itself as lumps of soft and ulcerating tissue around the mouth, which may invade surrounding organs and metastasise to other parts of the body. Severe genetic abnormalities exist in cancer cells—for example, DFT2 cells are tetraploid, containing twice as much genetic material as normal cells. DFTD is most often spread by bites, when teeth come into contact with cancer cells; less important pathways of transmission are ingesting of infected carcasses and sharing of food. Adult Tasmanian devils who are otherwise the fittest are most susceptible to the disease. DFTD is estimated to have first developed in 1986.</p>\n<p>...</p>\n<p>In 2016, devils are endangered as the localised populations were shown to have declined by 90 per cent and an overall species decline of more than 80 per cent in less than 20 years, with some models predicting extinction. Despite this, devil populations persist in disease-stricken areas. The devils have, in a way, fought back the extinction by developing the gene that is immune to face tumors. The genes have already existed in the Tasmanian devil as part of their immune system. They increased in frequency due to natural selection. That is, the individuals with particular forms of these genes (alleles) survived and reproduced disproportionately to those that lacked the specific variants when disease was present.</p>\n</blockquote>\n", "answer_id": 115199, "answer_text": "Because cancer wasn't likely to be one's cause of death. Look at this comparison (https://www.statista.com/statistics/235703/major-causes-of-death-in-the-us/) between 1900 and 2022:\n\n\n\n\n[image: enter image description here; source: https://i.sstatic.net/pzQsLWkf.png] (https://i.sstatic.net/pzQsLWkf.png)\n\n\n\n\nCancer used to be the cause of 5% of human deaths. Nowadays its at 24% thanks to us conquering diseases like tuberculosis and influenza. Similar data is available for the UK in the 1850s (https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2672390/):\n\n\n\n\n\n\n\nCancers were relatively rare. While the Victorians did not possess sophisticated diagnostic or screening technology, they were as able to diagnose late stage cancer as we are today; but this was an uncommon finding. In that period, cancer carried none of the stigma that it has recently acquired, and was diagnosed without bias. For example, in 1869 the Physician to Charing Cross Hospital describes lung cancer as ‘… one of the rarer forms of a rare disease. You may probably pass the rest of your students life without seeing another example of it.’\n\n\n\n\n\n\n\nEvolution can't solve every problem all at once. Cancer was simply too far down the list of causes of mortality for it to enact sufficient evolutionary pressure. We also have evidence (https://en.wikipedia.org/wiki/Devil_facial_tumour_disease) from the Tasmanian Devil population showing that immunity to certain types of cancers can evolve very quickly if necessary:\n\n\n\n\n\n\n\nDevil facial tumour disease (DFTD) is an aggressive non-viral clonally transmissible cancer which affects Tasmanian devils, a marsupial native to the Australian island of Tasmania. The cancer manifests itself as lumps of soft and ulcerating tissue around the mouth, which may invade surrounding organs and metastasise to other parts of the body. Severe genetic abnormalities exist in cancer cells—for example, DFT2 cells are tetraploid, containing twice as much genetic material as normal cells. DFTD is most often spread by bites, when teeth come into contact with cancer cells; less important pathways of transmission are ingesting of infected carcasses and sharing of food. Adult Tasmanian devils who are otherwise the fittest are most susceptible to the disease. DFTD is estimated to have first developed in 1986.\n\n\n\n\n...\n\n\n\n\nIn 2016, devils are endangered as the localised populations were shown to have declined by 90 per cent and an overall species decline of more than 80 per cent in less than 20 years, with some models predicting extinction. Despite this, devil populations persist in disease-stricken areas. The devils have, in a way, fought back the extinction by developing the gene that is immune to face tumors. The genes have already existed in the Tasmanian devil as part of their immune system. They increased in frequency due to natural selection. That is, the individuals with particular forms of these genes (alleles) survived and reproduced disproportionately to those that lacked the specific variants when disease was present.", "answer_url": "https://biology.stackexchange.com/a/115199", "author": "MilkLife", "author_url": "https://biology.stackexchange.com/users/5492/milklife", "author_user_type": "registered", "content_license": "CC BY-SA 4.0", "created_at": "2024-08-16T23:47:16+00:00", "is_accepted": false, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:03:25.304620+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/7fe0b66593eb4c0f175024453138b8bd50811f1580a079ffb990af38e09cd1cf_0.json", "raw_sha256": "b0a655f3b4c9626cf981180b3ac018a4a26330c5ab9b925b3df78bedd8169a84", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/questions/115493;115490;115488;115483;115479;115477;115456;115453;115452;115447;115445;115444;115436;115431;115427;115413;115404;115403;115396;115391;115389;115388;115386;115383;115382;115379;115367;115365;115355;115340;115334;115328;115321;115314;115309;115304;115296;115295;115292;115283;115272;115270;115269;115265;115264;115260;115255;115252;115243;115235;115233;115225;115218;115215;115214;115213;115207;115204;115179;115177;115170;115167;115165;115164;115154;115149;115137;115131;115129;115115;115107;115099;115095;115094;115093;115085;115082;115081;115077;115076;115075;115074;115073;115072;115063;115044;115039;115035;115030;115025;115022;115019;115016;115012;115003;115002;114997;114993;114991;114987/answers?filter=withbody&order=asc&page=1&pagesize=100&site=biology&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_id": 115170, "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "MilkLife", "profile_url": "https://biology.stackexchange.com/users/5492/milklife", "user_type": "registered"}, "created_at": "2024-08-16T23:47:16+00:00", "raw_file": "raw/codex_api_v1/920b7e5633cbad837bacc37f0887fd883044a5fce63b6e0fa3cc1504390bec54_1790824091899465600_0.json", "raw_sha256": "bac2cc1988c9b300f258cae319a9302dc73ac2617e76f7491908df2a0b939d11", "revision_guid": "FA30453C-1E93-40D2-9D07-DDC697CEF2EA", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/FA30453C-1E93-40D2-9D07-DDC697CEF2EA/view-source"}], "score": 0, "updated_at": "2024-08-16T23:47:16+00:00"}], "domain": "biology", "external_links": ["https://en.wikipedia.org/wiki/Devil_facial_tumour_disease", "https://en.wikipedia.org/wiki/Fitzpatrick_scale", "https://en.wikipedia.org/wiki/Photolyase", "https://garamut.wordpress.com/2009/08/10/the-case-of-melanin-in-melanesia/", "https://i.sstatic.net/pzQsLWkf.png", "https://seer.cancer.gov/statfacts/html/melan.html", "https://www.cuimc.columbia.edu/news/whats-deal-vitamin-d", "https://www.nature.com/scitable/topicpage/dna-is-constantly-changing-through-the-process-6524898/", "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2672390/", "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3427189/", "https://www.statista.com/statistics/235703/major-causes-of-death-in-the-us/"], "medical_sensitive": true, "patient_specific": false, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:03:05.762873+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/04ed2aa314c5d877c5d79e42620d1f80988a21de8d429a22d8c6af5280cfd6e8_0.json", "raw_sha256": "6dd355b99094bb9ba2c965ee7dd7b0e95f92a8078d3b2b85b64196fcb6cf717c", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/search/advanced?answers=1&filter=withbody&order=desc&page=5&pagesize=100&site=biology&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_author": "gaazkam", "question_author_url": "https://biology.stackexchange.com/users/15177/gaazkam", "question_author_user_type": "registered", "question_created_at": "2024-08-13T05:20:41+00:00", "question_html": "<p>Experts recommend that people apply sunscreen every two hours throughout the year, even in winter.</p>\n<p>Especially phototypes I - III are supposed to be most vulnerable to harmful UV radiation, so especially these phototypes should take care to keep applying sunscreen and to use at least SPF 50. This, at least, is what European health agencies tell us.</p>\n<p>Native to Europe are <a href=\"https://en.wikipedia.org/wiki/Fitzpatrick_scale\" rel=\"nofollow noreferrer\">phototypes</a> I - III. This means that these phototypes evolved in these precise conditions. Isn't evolution suppose to lead to best adaptations to the precise conditions native to the area an organism evolved in?</p>\n<p>So, by this line of argument, phototypes I - III should be well-adapted to the levels of Sun radiation present in Europe. They should not have to use sunscreen there. When traveling to areas that are significantly higher in Sun radiation, such as equatorial areas, they may have to start using sunscreen - but not in areas they are native to.</p>\n<p>Yet European agencies keep telling us that especially phototypes I - III should use sunscreen while in Europe.</p>\n<p>Where is the error in my thinking?</p>\n", "question_id": 115170, "question_license": "CC BY-SA 4.0", "question_score": 17, "question_text": "Experts recommend that people apply sunscreen every two hours throughout the year, even in winter.\n\n\n\n\nEspecially phototypes I - III are supposed to be most vulnerable to harmful UV radiation, so especially these phototypes should take care to keep applying sunscreen and to use at least SPF 50. This, at least, is what European health agencies tell us.\n\n\n\n\nNative to Europe are phototypes (https://en.wikipedia.org/wiki/Fitzpatrick_scale) I - III. This means that these phototypes evolved in these precise conditions. Isn't evolution suppose to lead to best adaptations to the precise conditions native to the area an organism evolved in?\n\n\n\n\nSo, by this line of argument, phototypes I - III should be well-adapted to the levels of Sun radiation present in Europe. They should not have to use sunscreen there. When traveling to areas that are significantly higher in Sun radiation, such as equatorial areas, they may have to start using sunscreen - but not in areas they are native to.\n\n\n\n\nYet European agencies keep telling us that especially phototypes I - III should use sunscreen while in Europe.\n\n\n\n\nWhere is the error in my thinking?", "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "gaazkam", "profile_url": "https://biology.stackexchange.com/users/15177/gaazkam", "user_type": "registered"}, "created_at": "2024-08-13T05:20:41+00:00", "raw_file": "raw/codex_api_v1/920b7e5633cbad837bacc37f0887fd883044a5fce63b6e0fa3cc1504390bec54_1790824091899465600_0.json", "raw_sha256": "bac2cc1988c9b300f258cae319a9302dc73ac2617e76f7491908df2a0b939d11", "revision_guid": "828DB692-880A-4BBF-AD67-13CF3E06456A", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/828DB692-880A-4BBF-AD67-13CF3E06456A/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "gaazkam", "profile_url": "https://biology.stackexchange.com/users/15177/gaazkam", "user_type": "registered"}, "created_at": "2024-08-13T05:26:09+00:00", "raw_file": "raw/codex_api_v1/920b7e5633cbad837bacc37f0887fd883044a5fce63b6e0fa3cc1504390bec54_1790824091899465600_0.json", "raw_sha256": "bac2cc1988c9b300f258cae319a9302dc73ac2617e76f7491908df2a0b939d11", "revision_guid": "E6AEDC3C-D874-42D3-A8D8-7210CFC2D8AB", "revision_number": 2, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/E6AEDC3C-D874-42D3-A8D8-7210CFC2D8AB/view-source"}, {"content_license": null, "contributor": {"display_name": "[deleted/unavailable user]", "profile_url": null, "user_type": "does_not_exist"}, "created_at": "2024-08-14T08:31:47+00:00", "raw_file": "raw/codex_api_v1/920b7e5633cbad837bacc37f0887fd883044a5fce63b6e0fa3cc1504390bec54_1790824091899465600_0.json", "raw_sha256": "bac2cc1988c9b300f258cae319a9302dc73ac2617e76f7491908df2a0b939d11", "revision_guid": "BD6D1FEE-C8A1-4A4F-8BF6-62DE46F8A60D", "revision_number": null, "revision_type": "vote_based", "revision_url": "https://biology.stackexchange.com/revisions/BD6D1FEE-C8A1-4A4F-8BF6-62DE46F8A60D/view-source"}, {"content_license": null, "contributor": {"display_name": "Chris", "profile_url": "https://biology.stackexchange.com/users/5144/chris", "user_type": "moderator"}, "created_at": "2024-08-15T13:36:46+00:00", "raw_file": "raw/codex_api_v1/920b7e5633cbad837bacc37f0887fd883044a5fce63b6e0fa3cc1504390bec54_1790824091899465600_0.json", "raw_sha256": "bac2cc1988c9b300f258cae319a9302dc73ac2617e76f7491908df2a0b939d11", "revision_guid": "5FEC95C4-C66B-4A62-A8A4-C39F2EE4CA4E", "revision_number": null, "revision_type": "vote_based", "revision_url": "https://biology.stackexchange.com/revisions/5FEC95C4-C66B-4A62-A8A4-C39F2EE4CA4E/view-source"}, {"content_license": null, "contributor": {"display_name": "AliceD", "profile_url": "https://biology.stackexchange.com/users/9943/aliced", "user_type": "registered"}, "created_at": "2024-08-16T08:12:55+00:00", "raw_file": "raw/codex_api_v1/920b7e5633cbad837bacc37f0887fd883044a5fce63b6e0fa3cc1504390bec54_1790824091899465600_0.json", "raw_sha256": "bac2cc1988c9b300f258cae319a9302dc73ac2617e76f7491908df2a0b939d11", "revision_guid": "E7A91925-4841-42A6-89A7-24963075C01F", "revision_number": null, "revision_type": "vote_based", "revision_url": "https://biology.stackexchange.com/revisions/E7A91925-4841-42A6-89A7-24963075C01F/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Basil Bourque", "profile_url": "https://biology.stackexchange.com/users/32521/basil-bourque", "user_type": "registered"}, "created_at": "2024-09-02T17:31:11+00:00", "raw_file": "raw/codex_api_v1/920b7e5633cbad837bacc37f0887fd883044a5fce63b6e0fa3cc1504390bec54_1790824091899465600_0.json", "raw_sha256": "bac2cc1988c9b300f258cae319a9302dc73ac2617e76f7491908df2a0b939d11", "revision_guid": "C86E2648-B494-446F-A6EC-EE52D185A1B7", "revision_number": 3, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/C86E2648-B494-446F-A6EC-EE52D185A1B7/view-source"}], "source_site": "biology", "source_url": "https://biology.stackexchange.com/questions/115170/why-did-evolution-fail-to-protect-humans-against-sun", "split": "test", "split_group": "503625bcfe466937a26431096aee38aeab3e6012cf849f4c5706c832b5d6195c", "tags": ["human-evolution", "skin", "melanin"], "thread_id": "biology:115170", "title": "Why did evolution fail to protect humans against sun?"}} | |
| {"accepted_status": [false, true], "candidate_answers": [{"answer_html": "<p>The vast majority of nitrogen is <span class=\"math-container\">$\\ce{^{14}N}$</span>, see e.g. <a href=\"https://en.m.wikipedia.org/wiki/Isotopes_of_nitrogen\" rel=\"nofollow noreferrer\">https://en.m.wikipedia.org/wiki/Isotopes_of_nitrogen</a></p>\n<p>So, they're starting with the experimental manipulation and then showing how their manipulated <span class=\"math-container\">$\\ce{^{15}N}$</span> follows cell divisions.</p>\n<p>Imagine you wanted to follow some water, so you add a dye to it and see where the dyed water goes. That's fairly easy, and you can probably even spot by eye places where the dye is diluted to 1% the concentration you added. Alternatively, you could dye everything in the system, and then add some pure water and follow that through. Some areas will then be diluted with that pure water and have just 99% of the original concentration of dye. However, it's a lot harder to tell the difference between "lots of dye vs slightly less due" than it is "very little dye vs background of zero". If you had a bit less sample volume (say, 1% less) you'd easily have the same "change" as your target (say, 98% to 100%), whereas if you're looking for the 1% dye, a volume change of 1% would give you 1.01% to 0.99%.</p>\n<p>You're right, hypothetically you could keep everything in an <span class=\"math-container\">$\\ce{^{15}N}$</span> world after starting with <span class=\"math-container\">$\\ce{^{14}N}$</span>, except you'd have to make sure to supply every nitrogenous reagent chemical needed in the experiment as <span class=\"math-container\">$\\ce{^{15}N}$</span>, and the world isn't perfect and there could be other plausible explanations of how <span class=\"math-container\">$\\ce{^{14}N}$</span> entered the experiment accidentally.</p>\n<p>For the experiment with <span class=\"math-container\">$\\ce{^{15}N}$</span>, it's pretty clear that any substantial <span class=\"math-container\">$\\ce{^{15}N}$</span> came from the original organism.</p>\n", "answer_id": 117991, "answer_text": "The vast majority of nitrogen is $\\ce{^{14}N}$, see e.g. https://en.m.wikipedia.org/wiki/Isotopes_of_nitrogen (https://en.m.wikipedia.org/wiki/Isotopes_of_nitrogen)\n\n\n\n\nSo, they're starting with the experimental manipulation and then showing how their manipulated $\\ce{^{15}N}$ follows cell divisions.\n\n\n\n\nImagine you wanted to follow some water, so you add a dye to it and see where the dyed water goes. That's fairly easy, and you can probably even spot by eye places where the dye is diluted to 1% the concentration you added. Alternatively, you could dye everything in the system, and then add some pure water and follow that through. Some areas will then be diluted with that pure water and have just 99% of the original concentration of dye. However, it's a lot harder to tell the difference between \"lots of dye vs slightly less due\" than it is \"very little dye vs background of zero\". If you had a bit less sample volume (say, 1% less) you'd easily have the same \"change\" as your target (say, 98% to 100%), whereas if you're looking for the 1% dye, a volume change of 1% would give you 1.01% to 0.99%.\n\n\n\n\nYou're right, hypothetically you could keep everything in an $\\ce{^{15}N}$ world after starting with $\\ce{^{14}N}$, except you'd have to make sure to supply every nitrogenous reagent chemical needed in the experiment as $\\ce{^{15}N}$, and the world isn't perfect and there could be other plausible explanations of how $\\ce{^{14}N}$ entered the experiment accidentally.\n\n\n\n\nFor the experiment with $\\ce{^{15}N}$, it's pretty clear that any substantial $\\ce{^{15}N}$ came from the original organism.", "answer_url": "https://biology.stackexchange.com/a/117991", "author": "Bryan Krause", "author_url": "https://biology.stackexchange.com/users/27148/bryan-krause", "author_user_type": "moderator", "content_license": "CC BY-SA 4.0", "created_at": "2025-09-29T18:25:14+00:00", "is_accepted": false, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:03:16.948131+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/46a41fae37d5c2c243f9abcbf6829a0045f46a51c624fbba2b897c320cdcba71_0.json", "raw_sha256": "e039e310d0106dc61f992ee05bbb0b0b57ded1c5092f97df2c52989edd5eaf68", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/questions/118153;118142;118137;118126;118122;118117;118113;118102;118099;118097;118094;118081;118076;118072;118069;118065;118059;118056;118043;118039;118036;118030;118029;118025;118022;118018;117994;117992;117990;117987;117983;117981;117975;117971;117956;117953;117951;117945;117943;117941;117934;117926;117924;117920;117916;117914;117907;117892;117889;117887;117883;117876;117872;117867;117861;117860;117856;117855;117850;117849;117844;117840;117833;117821;117819;117817;117815;117814;117805;117794;117782;117774;117771;117767;117766;117761;117759;117756;117747;117732;117726;117724;117709;117701;117694;117693;117681;117680;117677;117671;117668;117664;117662;117659;117651;117641;117632;117624;117623;117607/answers?filter=withbody&order=asc&page=1&pagesize=100&site=biology&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_id": 117990, "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Bryan Krause", "profile_url": "https://biology.stackexchange.com/users/27148/bryan-krause", "user_type": "moderator"}, "created_at": "2025-09-29T18:25:14+00:00", "raw_file": "raw/codex_api_v1/e6c4101e2e357aa8c5379bd547ec537e2ae9d3a66d32b72c727e9d2ad82690d6_1790824162028580600_0.json", "raw_sha256": "cba09186cd183cf1116bbe2f874d16b08a8bc537baa01c33e34f5c3821229cc5", "revision_guid": "E994CA32-9A11-48E2-B6FD-6D289F8FD806", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/E994CA32-9A11-48E2-B6FD-6D289F8FD806/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Bryan Krause", "profile_url": "https://biology.stackexchange.com/users/27148/bryan-krause", "user_type": "moderator"}, "created_at": "2025-09-29T18:35:46+00:00", "raw_file": "raw/codex_api_v1/e6c4101e2e357aa8c5379bd547ec537e2ae9d3a66d32b72c727e9d2ad82690d6_1790824162028580600_0.json", "raw_sha256": "cba09186cd183cf1116bbe2f874d16b08a8bc537baa01c33e34f5c3821229cc5", "revision_guid": "453C4C81-3BE3-4FC8-BB22-F413055A48EC", "revision_number": 2, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/453C4C81-3BE3-4FC8-BB22-F413055A48EC/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Bryan Krause", "profile_url": "https://biology.stackexchange.com/users/27148/bryan-krause", "user_type": "moderator"}, "created_at": "2025-09-30T21:25:07+00:00", "raw_file": "raw/codex_api_v1/e6c4101e2e357aa8c5379bd547ec537e2ae9d3a66d32b72c727e9d2ad82690d6_1790824162028580600_0.json", "raw_sha256": "cba09186cd183cf1116bbe2f874d16b08a8bc537baa01c33e34f5c3821229cc5", "revision_guid": "3B2CC543-8C81-41B8-8ACE-C8124F5764FF", "revision_number": 3, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/3B2CC543-8C81-41B8-8ACE-C8124F5764FF/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Shayan", "profile_url": "https://biology.stackexchange.com/users/114723/shayan", "user_type": "registered"}, "created_at": "2025-10-16T03:37:06+00:00", "raw_file": "raw/codex_api_v1/e6c4101e2e357aa8c5379bd547ec537e2ae9d3a66d32b72c727e9d2ad82690d6_1790824162028580600_0.json", "raw_sha256": "cba09186cd183cf1116bbe2f874d16b08a8bc537baa01c33e34f5c3821229cc5", "revision_guid": "815A1F6B-17DF-427A-8B18-545B12FDFCFF", "revision_number": 4, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/815A1F6B-17DF-427A-8B18-545B12FDFCFF/view-source"}], "score": 4, "updated_at": "2025-10-16T03:37:06+00:00"}, {"answer_html": "<p>The experiment was "actually" performed in both directions simultaneously because the order of the switch does not change the fundamental result—it simply provides double the confirmation. Whether you start with bacteria grown in a "heavy" medium and switch them to a "light" one, or start with "light" and switch to "heavy," the biological mechanism remains identical: the DNA strands separate, and each old strand pairs with a new strand built from whatever resources are currently available. In both cases, the first generation of new DNA ends up having an intermediate or "hybrid" density. Therefore, the direction of the experiment doesn't matter for the validity of the theory; doing it both ways merely served as a rigorous check to prove that the "hybrid" result was consistent and not caused by experimental error or contamination.</p>\n<hr />\n<p>Here's an extract from <a href=\"https://books.google.co.in/books?redir_esc=y&id=g4DGSXAqReoC&q=Missouri#v=snippet&q=Missouri&f=false\" rel=\"nofollow noreferrer\">Google books, pg 308</a>. A pic of it is added below.<a href=\"https://i.sstatic.net/eACU4P4v.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.sstatic.net/eACU4P4v.png\" alt=\"Holme's book: The Most Beautiful Experiment in Biology\" /></a></p>\n<hr />\n<p><sup><strong>Image transcript:</strong></sup></p>\n<blockquote>\n<p><sup>[...]Stahl had to leave for Missouri for a job interview. Too eager to wait for Stahl's return, Meselson decided to perform the experiment by himself. Before Stahl's departure Meselson suggested that it would be good to run the experiment in two directions - <strong>one beginning in heavy medium and switched to normal, the other beginning in normal and switched to heavy.</strong> Stahl cautioned him not to try to do both at once, because there was <strong>too much risk that he would mix up the samples.</strong></sup></p>\n<p><sup>After Stahl had gone, Meselson decided that he could color-code the tubes in which he placed the samples and carry out a double experiment without confusion. To be absolutely thorough, he may even have added one or two control experiments in which he switched cul-tures from one heavy to another heavy medium, and from one light to another light medium.[...]</sup></p>\n</blockquote>\n", "answer_id": 118024, "answer_text": "The experiment was \"actually\" performed in both directions simultaneously because the order of the switch does not change the fundamental result—it simply provides double the confirmation. Whether you start with bacteria grown in a \"heavy\" medium and switch them to a \"light\" one, or start with \"light\" and switch to \"heavy,\" the biological mechanism remains identical: the DNA strands separate, and each old strand pairs with a new strand built from whatever resources are currently available. In both cases, the first generation of new DNA ends up having an intermediate or \"hybrid\" density. Therefore, the direction of the experiment doesn't matter for the validity of the theory; doing it both ways merely served as a rigorous check to prove that the \"hybrid\" result was consistent and not caused by experimental error or contamination.\n\n\n\n\n\n\n\nHere's an extract from Google books, pg 308 (https://books.google.co.in/books?redir_esc=y&id=g4DGSXAqReoC&q=Missouri#v=snippet&q=Missouri&f=false). A pic of it is added below.[image: Holme's book: The Most Beautiful Experiment in Biology; source: https://i.sstatic.net/eACU4P4v.png] (https://i.sstatic.net/eACU4P4v.png)\n\n\n\n\n\n\n\nImage transcript:\n\n\n\n\n\n\n\n[...]Stahl had to leave for Missouri for a job interview. Too eager to wait for Stahl's return, Meselson decided to perform the experiment by himself. Before Stahl's departure Meselson suggested that it would be good to run the experiment in two directions - one beginning in heavy medium and switched to normal, the other beginning in normal and switched to heavy. Stahl cautioned him not to try to do both at once, because there was too much risk that he would mix up the samples.\n\n\n\n\nAfter Stahl had gone, Meselson decided that he could color-code the tubes in which he placed the samples and carry out a double experiment without confusion. To be absolutely thorough, he may even have added one or two control experiments in which he switched cul-tures from one heavy to another heavy medium, and from one light to another light medium.[...]", "answer_url": "https://biology.stackexchange.com/a/118024", "author": "Shayan", "author_url": "https://biology.stackexchange.com/users/114723/shayan", "author_user_type": "registered", "content_license": "CC BY-SA 4.0", "created_at": "2025-10-16T04:51:37+00:00", "is_accepted": true, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:03:16.948131+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/46a41fae37d5c2c243f9abcbf6829a0045f46a51c624fbba2b897c320cdcba71_0.json", "raw_sha256": "e039e310d0106dc61f992ee05bbb0b0b57ded1c5092f97df2c52989edd5eaf68", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/questions/118153;118142;118137;118126;118122;118117;118113;118102;118099;118097;118094;118081;118076;118072;118069;118065;118059;118056;118043;118039;118036;118030;118029;118025;118022;118018;117994;117992;117990;117987;117983;117981;117975;117971;117956;117953;117951;117945;117943;117941;117934;117926;117924;117920;117916;117914;117907;117892;117889;117887;117883;117876;117872;117867;117861;117860;117856;117855;117850;117849;117844;117840;117833;117821;117819;117817;117815;117814;117805;117794;117782;117774;117771;117767;117766;117761;117759;117756;117747;117732;117726;117724;117709;117701;117694;117693;117681;117680;117677;117671;117668;117664;117662;117659;117651;117641;117632;117624;117623;117607/answers?filter=withbody&order=asc&page=1&pagesize=100&site=biology&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_id": 117990, "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Shayan", "profile_url": "https://biology.stackexchange.com/users/114723/shayan", "user_type": "registered"}, "created_at": "2025-10-16T04:51:37+00:00", "raw_file": "raw/codex_api_v1/e6c4101e2e357aa8c5379bd547ec537e2ae9d3a66d32b72c727e9d2ad82690d6_1790824162028580600_0.json", "raw_sha256": "cba09186cd183cf1116bbe2f874d16b08a8bc537baa01c33e34f5c3821229cc5", "revision_guid": "F1D87F61-B116-4276-974C-9837309AA265", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/F1D87F61-B116-4276-974C-9837309AA265/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Shayan", "profile_url": "https://biology.stackexchange.com/users/114723/shayan", "user_type": "registered"}, "created_at": "2025-10-16T06:09:41+00:00", "raw_file": "raw/codex_api_v1/e6c4101e2e357aa8c5379bd547ec537e2ae9d3a66d32b72c727e9d2ad82690d6_1790824162028580600_0.json", "raw_sha256": "cba09186cd183cf1116bbe2f874d16b08a8bc537baa01c33e34f5c3821229cc5", "revision_guid": "EE16228B-D9CC-4B07-9B15-009B579AF628", "revision_number": 2, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/EE16228B-D9CC-4B07-9B15-009B579AF628/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Shayan", "profile_url": "https://biology.stackexchange.com/users/114723/shayan", "user_type": "registered"}, "created_at": "2025-10-16T06:17:44+00:00", "raw_file": "raw/codex_api_v1/e6c4101e2e357aa8c5379bd547ec537e2ae9d3a66d32b72c727e9d2ad82690d6_1790824162028580600_0.json", "raw_sha256": "cba09186cd183cf1116bbe2f874d16b08a8bc537baa01c33e34f5c3821229cc5", "revision_guid": "F9415163-B512-4B1D-894F-4C4E8CCA200C", "revision_number": 3, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/F9415163-B512-4B1D-894F-4C4E8CCA200C/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Shayan", "profile_url": "https://biology.stackexchange.com/users/114723/shayan", "user_type": "registered"}, "created_at": "2025-10-19T08:04:38+00:00", "raw_file": "raw/codex_api_v1/c1f1c77b4be84acc978369dace8896d84167a5ca52eb6711a00d4b338d7f0104_1790824159864978900_0.json", "raw_sha256": "5798821fb87997611f2dd8389abcef2303f9edc567f4cd87a06a697319e695cd", "revision_guid": "7EA90BD4-AAC3-4F80-A507-9C8A0FD0B3C0", "revision_number": 4, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/7EA90BD4-AAC3-4F80-A507-9C8A0FD0B3C0/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Shayan", "profile_url": "https://biology.stackexchange.com/users/114723/shayan", "user_type": "registered"}, "created_at": "2026-01-13T14:50:54+00:00", "raw_file": "raw/codex_api_v1/24d8c4344fb56e0a47a9b0522e7fa13631e62cee2987c8bebddae0c2fd26f9ef_1790824157688070000_0.json", "raw_sha256": "4317829c6b2c1d1874a8b88f2daa4b8fa8bda8b06cf0c252f9adce0558f8183c", "revision_guid": "F74C5F55-56D7-4876-A684-590AC6C13B78", "revision_number": 5, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/F74C5F55-56D7-4876-A684-590AC6C13B78/view-source"}], "score": -1, "updated_at": "2026-01-13T14:50:54+00:00"}], "ground_truth": "community signals only; no scientific truth label", "product": "ranking", "question": "In Meselson and Stahl's experiment, why do we start with bacteria having $\\ce{^{15}N}$ incorporated into its DNA? I think if we start with $\\ce{^{14}N}$ then we would get light band first, hybrid in the next and hybrid and heavy from the next generation onwards. It should work fine, isn't it?[image: Meselson and Stahl experiment; source: https://i.sstatic.net/vuVq2Oo7.jpg] (https://i.sstatic.net/vuVq2Oo7.jpg) Image source (https://www.mun.ca/biology/scarr/Meselson_StahL_experiment.html)", "record_id": "Scientific-Answer-Ranking:biology:117990", "scores": [4, -1], "split": "test", "thread": {"accepted_answer_id": 118024, "answers": [{"answer_html": "<p>The vast majority of nitrogen is <span class=\"math-container\">$\\ce{^{14}N}$</span>, see e.g. <a href=\"https://en.m.wikipedia.org/wiki/Isotopes_of_nitrogen\" rel=\"nofollow noreferrer\">https://en.m.wikipedia.org/wiki/Isotopes_of_nitrogen</a></p>\n<p>So, they're starting with the experimental manipulation and then showing how their manipulated <span class=\"math-container\">$\\ce{^{15}N}$</span> follows cell divisions.</p>\n<p>Imagine you wanted to follow some water, so you add a dye to it and see where the dyed water goes. That's fairly easy, and you can probably even spot by eye places where the dye is diluted to 1% the concentration you added. Alternatively, you could dye everything in the system, and then add some pure water and follow that through. Some areas will then be diluted with that pure water and have just 99% of the original concentration of dye. However, it's a lot harder to tell the difference between "lots of dye vs slightly less due" than it is "very little dye vs background of zero". If you had a bit less sample volume (say, 1% less) you'd easily have the same "change" as your target (say, 98% to 100%), whereas if you're looking for the 1% dye, a volume change of 1% would give you 1.01% to 0.99%.</p>\n<p>You're right, hypothetically you could keep everything in an <span class=\"math-container\">$\\ce{^{15}N}$</span> world after starting with <span class=\"math-container\">$\\ce{^{14}N}$</span>, except you'd have to make sure to supply every nitrogenous reagent chemical needed in the experiment as <span class=\"math-container\">$\\ce{^{15}N}$</span>, and the world isn't perfect and there could be other plausible explanations of how <span class=\"math-container\">$\\ce{^{14}N}$</span> entered the experiment accidentally.</p>\n<p>For the experiment with <span class=\"math-container\">$\\ce{^{15}N}$</span>, it's pretty clear that any substantial <span class=\"math-container\">$\\ce{^{15}N}$</span> came from the original organism.</p>\n", "answer_id": 117991, "answer_text": "The vast majority of nitrogen is $\\ce{^{14}N}$, see e.g. https://en.m.wikipedia.org/wiki/Isotopes_of_nitrogen (https://en.m.wikipedia.org/wiki/Isotopes_of_nitrogen)\n\n\n\n\nSo, they're starting with the experimental manipulation and then showing how their manipulated $\\ce{^{15}N}$ follows cell divisions.\n\n\n\n\nImagine you wanted to follow some water, so you add a dye to it and see where the dyed water goes. That's fairly easy, and you can probably even spot by eye places where the dye is diluted to 1% the concentration you added. Alternatively, you could dye everything in the system, and then add some pure water and follow that through. Some areas will then be diluted with that pure water and have just 99% of the original concentration of dye. However, it's a lot harder to tell the difference between \"lots of dye vs slightly less due\" than it is \"very little dye vs background of zero\". If you had a bit less sample volume (say, 1% less) you'd easily have the same \"change\" as your target (say, 98% to 100%), whereas if you're looking for the 1% dye, a volume change of 1% would give you 1.01% to 0.99%.\n\n\n\n\nYou're right, hypothetically you could keep everything in an $\\ce{^{15}N}$ world after starting with $\\ce{^{14}N}$, except you'd have to make sure to supply every nitrogenous reagent chemical needed in the experiment as $\\ce{^{15}N}$, and the world isn't perfect and there could be other plausible explanations of how $\\ce{^{14}N}$ entered the experiment accidentally.\n\n\n\n\nFor the experiment with $\\ce{^{15}N}$, it's pretty clear that any substantial $\\ce{^{15}N}$ came from the original organism.", "answer_url": "https://biology.stackexchange.com/a/117991", "author": "Bryan Krause", "author_url": "https://biology.stackexchange.com/users/27148/bryan-krause", "author_user_type": "moderator", "content_license": "CC BY-SA 4.0", "created_at": "2025-09-29T18:25:14+00:00", "is_accepted": false, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:03:16.948131+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/46a41fae37d5c2c243f9abcbf6829a0045f46a51c624fbba2b897c320cdcba71_0.json", "raw_sha256": "e039e310d0106dc61f992ee05bbb0b0b57ded1c5092f97df2c52989edd5eaf68", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/questions/118153;118142;118137;118126;118122;118117;118113;118102;118099;118097;118094;118081;118076;118072;118069;118065;118059;118056;118043;118039;118036;118030;118029;118025;118022;118018;117994;117992;117990;117987;117983;117981;117975;117971;117956;117953;117951;117945;117943;117941;117934;117926;117924;117920;117916;117914;117907;117892;117889;117887;117883;117876;117872;117867;117861;117860;117856;117855;117850;117849;117844;117840;117833;117821;117819;117817;117815;117814;117805;117794;117782;117774;117771;117767;117766;117761;117759;117756;117747;117732;117726;117724;117709;117701;117694;117693;117681;117680;117677;117671;117668;117664;117662;117659;117651;117641;117632;117624;117623;117607/answers?filter=withbody&order=asc&page=1&pagesize=100&site=biology&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_id": 117990, "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Bryan Krause", "profile_url": "https://biology.stackexchange.com/users/27148/bryan-krause", "user_type": "moderator"}, "created_at": "2025-09-29T18:25:14+00:00", "raw_file": "raw/codex_api_v1/e6c4101e2e357aa8c5379bd547ec537e2ae9d3a66d32b72c727e9d2ad82690d6_1790824162028580600_0.json", "raw_sha256": "cba09186cd183cf1116bbe2f874d16b08a8bc537baa01c33e34f5c3821229cc5", "revision_guid": "E994CA32-9A11-48E2-B6FD-6D289F8FD806", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/E994CA32-9A11-48E2-B6FD-6D289F8FD806/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Bryan Krause", "profile_url": "https://biology.stackexchange.com/users/27148/bryan-krause", "user_type": "moderator"}, "created_at": "2025-09-29T18:35:46+00:00", "raw_file": "raw/codex_api_v1/e6c4101e2e357aa8c5379bd547ec537e2ae9d3a66d32b72c727e9d2ad82690d6_1790824162028580600_0.json", "raw_sha256": "cba09186cd183cf1116bbe2f874d16b08a8bc537baa01c33e34f5c3821229cc5", "revision_guid": "453C4C81-3BE3-4FC8-BB22-F413055A48EC", "revision_number": 2, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/453C4C81-3BE3-4FC8-BB22-F413055A48EC/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Bryan Krause", "profile_url": "https://biology.stackexchange.com/users/27148/bryan-krause", "user_type": "moderator"}, "created_at": "2025-09-30T21:25:07+00:00", "raw_file": "raw/codex_api_v1/e6c4101e2e357aa8c5379bd547ec537e2ae9d3a66d32b72c727e9d2ad82690d6_1790824162028580600_0.json", "raw_sha256": "cba09186cd183cf1116bbe2f874d16b08a8bc537baa01c33e34f5c3821229cc5", "revision_guid": "3B2CC543-8C81-41B8-8ACE-C8124F5764FF", "revision_number": 3, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/3B2CC543-8C81-41B8-8ACE-C8124F5764FF/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Shayan", "profile_url": "https://biology.stackexchange.com/users/114723/shayan", "user_type": "registered"}, "created_at": "2025-10-16T03:37:06+00:00", "raw_file": "raw/codex_api_v1/e6c4101e2e357aa8c5379bd547ec537e2ae9d3a66d32b72c727e9d2ad82690d6_1790824162028580600_0.json", "raw_sha256": "cba09186cd183cf1116bbe2f874d16b08a8bc537baa01c33e34f5c3821229cc5", "revision_guid": "815A1F6B-17DF-427A-8B18-545B12FDFCFF", "revision_number": 4, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/815A1F6B-17DF-427A-8B18-545B12FDFCFF/view-source"}], "score": 4, "updated_at": "2025-10-16T03:37:06+00:00"}, {"answer_html": "<p>The experiment was "actually" performed in both directions simultaneously because the order of the switch does not change the fundamental result—it simply provides double the confirmation. Whether you start with bacteria grown in a "heavy" medium and switch them to a "light" one, or start with "light" and switch to "heavy," the biological mechanism remains identical: the DNA strands separate, and each old strand pairs with a new strand built from whatever resources are currently available. In both cases, the first generation of new DNA ends up having an intermediate or "hybrid" density. Therefore, the direction of the experiment doesn't matter for the validity of the theory; doing it both ways merely served as a rigorous check to prove that the "hybrid" result was consistent and not caused by experimental error or contamination.</p>\n<hr />\n<p>Here's an extract from <a href=\"https://books.google.co.in/books?redir_esc=y&id=g4DGSXAqReoC&q=Missouri#v=snippet&q=Missouri&f=false\" rel=\"nofollow noreferrer\">Google books, pg 308</a>. A pic of it is added below.<a href=\"https://i.sstatic.net/eACU4P4v.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.sstatic.net/eACU4P4v.png\" alt=\"Holme's book: The Most Beautiful Experiment in Biology\" /></a></p>\n<hr />\n<p><sup><strong>Image transcript:</strong></sup></p>\n<blockquote>\n<p><sup>[...]Stahl had to leave for Missouri for a job interview. Too eager to wait for Stahl's return, Meselson decided to perform the experiment by himself. Before Stahl's departure Meselson suggested that it would be good to run the experiment in two directions - <strong>one beginning in heavy medium and switched to normal, the other beginning in normal and switched to heavy.</strong> Stahl cautioned him not to try to do both at once, because there was <strong>too much risk that he would mix up the samples.</strong></sup></p>\n<p><sup>After Stahl had gone, Meselson decided that he could color-code the tubes in which he placed the samples and carry out a double experiment without confusion. To be absolutely thorough, he may even have added one or two control experiments in which he switched cul-tures from one heavy to another heavy medium, and from one light to another light medium.[...]</sup></p>\n</blockquote>\n", "answer_id": 118024, "answer_text": "The experiment was \"actually\" performed in both directions simultaneously because the order of the switch does not change the fundamental result—it simply provides double the confirmation. Whether you start with bacteria grown in a \"heavy\" medium and switch them to a \"light\" one, or start with \"light\" and switch to \"heavy,\" the biological mechanism remains identical: the DNA strands separate, and each old strand pairs with a new strand built from whatever resources are currently available. In both cases, the first generation of new DNA ends up having an intermediate or \"hybrid\" density. Therefore, the direction of the experiment doesn't matter for the validity of the theory; doing it both ways merely served as a rigorous check to prove that the \"hybrid\" result was consistent and not caused by experimental error or contamination.\n\n\n\n\n\n\n\nHere's an extract from Google books, pg 308 (https://books.google.co.in/books?redir_esc=y&id=g4DGSXAqReoC&q=Missouri#v=snippet&q=Missouri&f=false). A pic of it is added below.[image: Holme's book: The Most Beautiful Experiment in Biology; source: https://i.sstatic.net/eACU4P4v.png] (https://i.sstatic.net/eACU4P4v.png)\n\n\n\n\n\n\n\nImage transcript:\n\n\n\n\n\n\n\n[...]Stahl had to leave for Missouri for a job interview. Too eager to wait for Stahl's return, Meselson decided to perform the experiment by himself. Before Stahl's departure Meselson suggested that it would be good to run the experiment in two directions - one beginning in heavy medium and switched to normal, the other beginning in normal and switched to heavy. Stahl cautioned him not to try to do both at once, because there was too much risk that he would mix up the samples.\n\n\n\n\nAfter Stahl had gone, Meselson decided that he could color-code the tubes in which he placed the samples and carry out a double experiment without confusion. To be absolutely thorough, he may even have added one or two control experiments in which he switched cul-tures from one heavy to another heavy medium, and from one light to another light medium.[...]", "answer_url": "https://biology.stackexchange.com/a/118024", "author": "Shayan", "author_url": "https://biology.stackexchange.com/users/114723/shayan", "author_user_type": "registered", "content_license": "CC BY-SA 4.0", "created_at": "2025-10-16T04:51:37+00:00", "is_accepted": true, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:03:16.948131+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/46a41fae37d5c2c243f9abcbf6829a0045f46a51c624fbba2b897c320cdcba71_0.json", "raw_sha256": "e039e310d0106dc61f992ee05bbb0b0b57ded1c5092f97df2c52989edd5eaf68", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/questions/118153;118142;118137;118126;118122;118117;118113;118102;118099;118097;118094;118081;118076;118072;118069;118065;118059;118056;118043;118039;118036;118030;118029;118025;118022;118018;117994;117992;117990;117987;117983;117981;117975;117971;117956;117953;117951;117945;117943;117941;117934;117926;117924;117920;117916;117914;117907;117892;117889;117887;117883;117876;117872;117867;117861;117860;117856;117855;117850;117849;117844;117840;117833;117821;117819;117817;117815;117814;117805;117794;117782;117774;117771;117767;117766;117761;117759;117756;117747;117732;117726;117724;117709;117701;117694;117693;117681;117680;117677;117671;117668;117664;117662;117659;117651;117641;117632;117624;117623;117607/answers?filter=withbody&order=asc&page=1&pagesize=100&site=biology&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_id": 117990, "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Shayan", "profile_url": "https://biology.stackexchange.com/users/114723/shayan", "user_type": "registered"}, "created_at": "2025-10-16T04:51:37+00:00", "raw_file": "raw/codex_api_v1/e6c4101e2e357aa8c5379bd547ec537e2ae9d3a66d32b72c727e9d2ad82690d6_1790824162028580600_0.json", "raw_sha256": "cba09186cd183cf1116bbe2f874d16b08a8bc537baa01c33e34f5c3821229cc5", "revision_guid": "F1D87F61-B116-4276-974C-9837309AA265", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/F1D87F61-B116-4276-974C-9837309AA265/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Shayan", "profile_url": "https://biology.stackexchange.com/users/114723/shayan", "user_type": "registered"}, "created_at": "2025-10-16T06:09:41+00:00", "raw_file": "raw/codex_api_v1/e6c4101e2e357aa8c5379bd547ec537e2ae9d3a66d32b72c727e9d2ad82690d6_1790824162028580600_0.json", "raw_sha256": "cba09186cd183cf1116bbe2f874d16b08a8bc537baa01c33e34f5c3821229cc5", "revision_guid": "EE16228B-D9CC-4B07-9B15-009B579AF628", "revision_number": 2, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/EE16228B-D9CC-4B07-9B15-009B579AF628/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Shayan", "profile_url": "https://biology.stackexchange.com/users/114723/shayan", "user_type": "registered"}, "created_at": "2025-10-16T06:17:44+00:00", "raw_file": "raw/codex_api_v1/e6c4101e2e357aa8c5379bd547ec537e2ae9d3a66d32b72c727e9d2ad82690d6_1790824162028580600_0.json", "raw_sha256": "cba09186cd183cf1116bbe2f874d16b08a8bc537baa01c33e34f5c3821229cc5", "revision_guid": "F9415163-B512-4B1D-894F-4C4E8CCA200C", "revision_number": 3, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/F9415163-B512-4B1D-894F-4C4E8CCA200C/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Shayan", "profile_url": "https://biology.stackexchange.com/users/114723/shayan", "user_type": "registered"}, "created_at": "2025-10-19T08:04:38+00:00", "raw_file": "raw/codex_api_v1/c1f1c77b4be84acc978369dace8896d84167a5ca52eb6711a00d4b338d7f0104_1790824159864978900_0.json", "raw_sha256": "5798821fb87997611f2dd8389abcef2303f9edc567f4cd87a06a697319e695cd", "revision_guid": "7EA90BD4-AAC3-4F80-A507-9C8A0FD0B3C0", "revision_number": 4, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/7EA90BD4-AAC3-4F80-A507-9C8A0FD0B3C0/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Shayan", "profile_url": "https://biology.stackexchange.com/users/114723/shayan", "user_type": "registered"}, "created_at": "2026-01-13T14:50:54+00:00", "raw_file": "raw/codex_api_v1/24d8c4344fb56e0a47a9b0522e7fa13631e62cee2987c8bebddae0c2fd26f9ef_1790824157688070000_0.json", "raw_sha256": "4317829c6b2c1d1874a8b88f2daa4b8fa8bda8b06cf0c252f9adce0558f8183c", "revision_guid": "F74C5F55-56D7-4876-A684-590AC6C13B78", "revision_number": 5, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/F74C5F55-56D7-4876-A684-590AC6C13B78/view-source"}], "score": -1, "updated_at": "2026-01-13T14:50:54+00:00"}], "domain": "biology", "external_links": ["https://books.google.co.in/books?redir_esc=y&id=g4DGSXAqReoC&q=Missouri#v=snippet&q=Missouri&f=false", "https://en.m.wikipedia.org/wiki/Isotopes_of_nitrogen", "https://i.sstatic.net/eACU4P4v.png", "https://i.sstatic.net/vuVq2Oo7.jpg", "https://www.mun.ca/biology/scarr/Meselson_StahL_experiment.html"], "medical_sensitive": false, "patient_specific": false, "provenance": {"attribution_required": true, "collected_at": "2026-10-01T03:03:01.208074+00:00", "license": "CC BY-SA 4.0", "license_url": "https://creativecommons.org/licenses/by-sa/4.0/", "raw_file": "raw/codex_api_v1/f1b387b48f36041f506f18fa9796531023c7eae1e796ec622ad56833c02bea98_0.json", "raw_sha256": "3f8214c87c0fe16dd016324597332ca392e0ba98600877cc746483ef492ce03d", "source_api": "Stack Exchange API 2.3", "source_url": "https://api.stackexchange.com/2.3/search/advanced?answers=1&filter=withbody&order=desc&page=2&pagesize=100&site=biology&sort=creation", "transformation": "API HTML retained; mechanical HTML-to-text; no LLM rewriting"}, "question_author": "Shayan", "question_author_url": "https://biology.stackexchange.com/users/114723/shayan", "question_author_user_type": "registered", "question_created_at": "2025-09-29T16:10:54+00:00", "question_html": "<p>In Meselson and Stahl's experiment, why do we start with bacteria having <span class=\"math-container\">$\\ce{^{15}N}$</span> incorporated into its DNA? I think if we start with <span class=\"math-container\">$\\ce{^{14}N}$</span> then we would get light band first, hybrid in the next and hybrid and heavy from the next generation onwards. It should work fine, isn't it?<a href=\"https://i.sstatic.net/vuVq2Oo7.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.sstatic.net/vuVq2Oo7.jpg\" alt=\"Meselson and Stahl experiment\" /></a> <a href=\"https://www.mun.ca/biology/scarr/Meselson_StahL_experiment.html\" rel=\"nofollow noreferrer\">Image source</a></p>\n", "question_id": 117990, "question_license": "CC BY-SA 4.0", "question_score": 4, "question_text": "In Meselson and Stahl's experiment, why do we start with bacteria having $\\ce{^{15}N}$ incorporated into its DNA? I think if we start with $\\ce{^{14}N}$ then we would get light band first, hybrid in the next and hybrid and heavy from the next generation onwards. It should work fine, isn't it?[image: Meselson and Stahl experiment; source: https://i.sstatic.net/vuVq2Oo7.jpg] (https://i.sstatic.net/vuVq2Oo7.jpg) Image source (https://www.mun.ca/biology/scarr/Meselson_StahL_experiment.html)", "revision_attribution": [{"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Shayan", "profile_url": "https://biology.stackexchange.com/users/114723/shayan", "user_type": "registered"}, "created_at": "2025-09-29T16:10:54+00:00", "raw_file": "raw/codex_api_v1/e6c4101e2e357aa8c5379bd547ec537e2ae9d3a66d32b72c727e9d2ad82690d6_1790824162028580600_0.json", "raw_sha256": "cba09186cd183cf1116bbe2f874d16b08a8bc537baa01c33e34f5c3821229cc5", "revision_guid": "0618FB11-12EF-4A73-BC04-5CFE3B943C44", "revision_number": 1, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/0618FB11-12EF-4A73-BC04-5CFE3B943C44/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Shayan", "profile_url": "https://biology.stackexchange.com/users/114723/shayan", "user_type": "registered"}, "created_at": "2025-09-29T17:13:40+00:00", "raw_file": "raw/codex_api_v1/e6c4101e2e357aa8c5379bd547ec537e2ae9d3a66d32b72c727e9d2ad82690d6_1790824162028580600_0.json", "raw_sha256": "cba09186cd183cf1116bbe2f874d16b08a8bc537baa01c33e34f5c3821229cc5", "revision_guid": "24B29716-9C7C-4D69-8D85-A449B5CE28D8", "revision_number": 2, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/24B29716-9C7C-4D69-8D85-A449B5CE28D8/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Shayan", "profile_url": "https://biology.stackexchange.com/users/114723/shayan", "user_type": "registered"}, "created_at": "2025-09-30T13:17:34+00:00", "raw_file": "raw/codex_api_v1/e6c4101e2e357aa8c5379bd547ec537e2ae9d3a66d32b72c727e9d2ad82690d6_1790824162028580600_0.json", "raw_sha256": "cba09186cd183cf1116bbe2f874d16b08a8bc537baa01c33e34f5c3821229cc5", "revision_guid": "BBE9B6D5-8133-4A15-8BC2-8DDAA329AD85", "revision_number": 3, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/BBE9B6D5-8133-4A15-8BC2-8DDAA329AD85/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Shayan", "profile_url": "https://biology.stackexchange.com/users/114723/shayan", "user_type": "registered"}, "created_at": "2025-10-16T02:41:12+00:00", "raw_file": "raw/codex_api_v1/e6c4101e2e357aa8c5379bd547ec537e2ae9d3a66d32b72c727e9d2ad82690d6_1790824162028580600_0.json", "raw_sha256": "cba09186cd183cf1116bbe2f874d16b08a8bc537baa01c33e34f5c3821229cc5", "revision_guid": "D0367674-BA27-48CA-A3F2-5558BFB7DE9E", "revision_number": 4, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/D0367674-BA27-48CA-A3F2-5558BFB7DE9E/view-source"}, {"content_license": "CC BY-SA 4.0", "contributor": {"display_name": "Shayan", "profile_url": "https://biology.stackexchange.com/users/114723/shayan", "user_type": "registered"}, "created_at": "2025-12-27T18:32:11+00:00", "raw_file": "raw/codex_api_v1/24d8c4344fb56e0a47a9b0522e7fa13631e62cee2987c8bebddae0c2fd26f9ef_1790824157688070000_0.json", "raw_sha256": "4317829c6b2c1d1874a8b88f2daa4b8fa8bda8b06cf0c252f9adce0558f8183c", "revision_guid": "55602E3D-3D72-4021-B2AF-12ADD4EBEACD", "revision_number": 5, "revision_type": "single_user", "revision_url": "https://biology.stackexchange.com/revisions/55602E3D-3D72-4021-B2AF-12ADD4EBEACD/view-source"}], "source_site": "biology", "source_url": "https://biology.stackexchange.com/questions/117990/use-of-n-15-in-meselson-and-stahl-experiment", "split": "test", "split_group": "a57f57c46250c0d0ff15c0b1f14644ee9ff3241fce1bebc62ee9475b0c5d4ead", "tags": ["dna-replication"], "thread_id": "biology:117990", "title": "Use of N-15 in Meselson and Stahl experiment"}} | |