{"id":49993,"date":"2026-12-01T07:34:14","date_gmt":"2026-11-30T23:34:14","guid":{"rendered":"https:\/\/www.qiusir.com\/?p=49993"},"modified":"2026-12-01T07:34:14","modified_gmt":"2026-11-30T23:34:14","slug":"qiutopia%e7%a7%af%e6%9c%a8%e6%82%ac%e6%8c%91","status":"publish","type":"post","link":"https:\/\/www.qiusir.com\/?p=49993","title":{"rendered":"qiutopIA:\u79ef\u6728\u60ac\u6311"},"content":{"rendered":"\r\n<div id=\"qiusir-bs-2026\" style=\"width:100%;max-width:960px;margin:20px auto;font-family:'Times New Roman','Noto Serif SC',serif;color:#000;background:#fff;box-sizing:border-box;\">\r\n  <div style=\"width:100%;height:560px;border:1.2px solid #000;background:#fff;position:relative;box-sizing:border-box;\">\r\n    <canvas id=\"qiusir-bs-c-2026\" style=\"display:block;width:100%;height:100%;\"><\/canvas>\r\n  <\/div>\r\n  <div style=\"margin-top:12px;display:flex;align-items:center;justify-content:center;gap:10px;font-style:italic;font-size:15px;\">\r\n    <span>n =<\/span>\r\n    <input type=\"range\" id=\"qiusir-bs-s-2026\" min=\"1\" max=\"50\" value=\"10\" style=\"width:260px;accent-color:#000;cursor:pointer;\">\r\n    <span id=\"qiusir-bs-v-2026\" style=\"min-width:26px;text-align:center;\">10<\/span>\r\n  <\/div>\r\n<\/div>\r\n\r\n<script>\r\n(function() {\r\n  var root = document.getElementById('qiusir-bs-2026');\r\n  if (!root) { return; }\r\n  var canvas = document.getElementById('qiusir-bs-c-2026');\r\n  var ctx = canvas.getContext('2d');\r\n  var slider = document.getElementById('qiusir-bs-s-2026');\r\n  var valEl = document.getElementById('qiusir-bs-v-2026');\r\n  var N = 10, hoverK = -1, meta = null;\r\n\r\n  function drawArrow(x1, y1, x2, y2, dbl) {\r\n    function head(ax, ay, a) {\r\n      ctx.beginPath(); ctx.moveTo(ax, ay);\r\n      ctx.lineTo(ax - 5.5 * Math.cos(a - 0.52), ay - 5.5 * Math.sin(a - 0.52));\r\n      ctx.lineTo(ax - 5.5 * Math.cos(a + 0.52), ay - 5.5 * Math.sin(a + 0.52));\r\n      ctx.closePath(); ctx.fill();\r\n    }\r\n    var ang = Math.atan2(y2 - y1, x2 - x1);\r\n    ctx.beginPath(); ctx.moveTo(x1, y1); ctx.lineTo(x2, y2); ctx.stroke();\r\n    head(x2, y2, ang);\r\n    if (dbl) { head(x1, y1, ang + Math.PI); }\r\n  }\r\n\r\n  function drawFulcrum(x, y, s) {\r\n    ctx.fillStyle = '#000';\r\n    ctx.beginPath(); ctx.moveTo(x, y);\r\n    ctx.lineTo(x - s * 0.85, y + s * 1.35);\r\n    ctx.lineTo(x + s * 0.85, y + s * 1.35);\r\n    ctx.closePath(); ctx.fill();\r\n  }\r\n\r\n  function drawStackedFracCentered(colCenterX, yCenter, k, isRight, sz) {\r\n    ctx.save();\r\n    ctx.fillStyle = '#000';\r\n    ctx.strokeStyle = '#000';\r\n    ctx.lineWidth = 0.8;\r\n\r\n    ctx.font = 'italic ' + sz + 'px \"Times New Roman\", serif';\r\n    var numW = ctx.measureText('1').width;\r\n    var denW = 0;\r\n\r\n    if (isRight) {\r\n      denW = ctx.measureText(String(2 * k)).width;\r\n    } else if (k === 1) {\r\n      denW = ctx.measureText('2').width;\r\n    } else {\r\n      var baseW = ctx.measureText('2').width;\r\n      ctx.font = 'italic ' + (sz * 0.75) + 'px \"Times New Roman\", serif';\r\n      var supW = ctx.measureText(String(k)).width;\r\n      denW = baseW + supW;\r\n    }\r\n\r\n    var barW = Math.max(numW, denW) + 4;\r\n    var barLeft = colCenterX - barW \/ 2;\r\n\r\n    ctx.font = 'italic ' + sz + 'px \"Times New Roman\", serif';\r\n    ctx.fillText('1', colCenterX - numW \/ 2, yCenter - 2);\r\n\r\n    ctx.beginPath();\r\n    ctx.moveTo(barLeft, yCenter);\r\n    ctx.lineTo(barLeft + barW, yCenter);\r\n    ctx.stroke();\r\n\r\n    var denBaseY = yCenter + sz * 0.88 + 1;\r\n    var denStartX = colCenterX - denW \/ 2;\r\n    if (isRight) {\r\n      ctx.fillText(String(2 * k), denStartX, denBaseY);\r\n    } else if (k === 1) {\r\n      ctx.fillText('2', denStartX, denBaseY);\r\n    } else {\r\n      ctx.fillText('2', denStartX, denBaseY);\r\n      var bw = ctx.measureText('2').width;\r\n      ctx.font = 'italic ' + (sz * 0.75) + 'px \"Times New Roman\", serif';\r\n      ctx.fillText(String(k), denStartX + bw, denBaseY - sz * 0.34);\r\n    }\r\n\r\n    ctx.restore();\r\n    return { left: barLeft, right: barLeft + barW };\r\n  }\r\n\r\n  function render() {\r\n    var box = canvas.parentElement;\r\n    if (!box) { return; }\r\n    var rect = box.getBoundingClientRect();\r\n    var W = rect.width, H = rect.height;\r\n    if (W === 0) { return; }\r\n\r\n    var dpr = window.devicePixelRatio ? window.devicePixelRatio : 1;\r\n    canvas.width = Math.round(W * dpr);\r\n    canvas.height = Math.round(H * dpr);\r\n    ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\r\n    ctx.clearRect(0, 0, W, H);\r\n\r\n    var midX = W \/ 2;\r\n    ctx.strokeStyle = '#000'; ctx.lineWidth = 1.2;\r\n    ctx.beginPath(); ctx.moveTo(midX, 0); ctx.lineTo(midX, H); ctx.stroke();\r\n\r\n    var geo = [], har = [], sG = 0, sH = 0;\r\n    for (var k = N; k >= 1; k--) {\r\n      sG += Math.pow(0.5, k);\r\n      sH += 1 \/ (2 * k);\r\n      geo[k - 1] = { k: k, tip: sG, center: sG - 0.5, level: N - k };\r\n      har[k - 1] = { k: k, tip: sH, center: sH - 0.5, level: N - k };\r\n    }\r\n\r\n    var cG = 0, cH = 0;\r\n    for (var i = 0; i !== N; i++) {\r\n      cG += geo[i].center; geo[i].com = cG \/ (i + 1); geo[i].piv = i === N - 1 ? 0 : geo[i + 1].tip;\r\n      cH += har[i].center; har[i].com = cH \/ (i + 1); har[i].piv = i === N - 1 ? 0 : har[i + 1].tip;\r\n    }\r\n\r\n    var maxX = Math.max(2.35, sH + 0.72), minX = -1.08;\r\n    var padNear = 18, padTip = 46, pxL = (midX - padNear - padTip) \/ (maxX - minX);\r\n    var baseY = H - 30, topY = 66;\r\n    var brickH = Math.min(28, (baseY - topY - 18) \/ N);\r\n    function toY(l) { return baseY - l * brickH; }\r\n    meta = { baseY: baseY, brickH: brickH, N: N };\r\n\r\n    var omitK = N > 10 ? N - 9 : N + 1;\r\n    var ellK = N > 10 ? Math.floor((omitK + N - 1) \/ 2) : -1;\r\n    var fSz = 10.5;\r\n    if (24 > brickH) { fSz = 9.5; }\r\n    if (16 > brickH) { fSz = 8.5; }\r\n\r\n    var minFracHeight = fSz * 2.15;\r\n    var step = Math.max(1, Math.ceil(minFracHeight \/ brickH));\r\n\r\n    var panels = [false, true];\r\n    for (var p = 0; p !== 2; p++) {\r\n      var isRight = panels[p];\r\n      var arr = isRight ? har : geo;\r\n      var offX = isRight ? midX : 0;\r\n      var color = isRight ? '#16a34a' : '#dc2626';\r\n\r\n      function toX(wx) {\r\n        if (isRight) {\r\n          return offX + midX - padNear - (wx - minX) * pxL;\r\n        }\r\n        return offX + padNear + (wx - minX) * pxL;\r\n      }\r\n\r\n      var x0 = toX(0), x1 = toX(1), x2 = toX(2);\r\n\r\n      var fracColCenterX = toX(arr[0].tip) + 22;\r\n      if (isRight) {\r\n        fracColCenterX = toX(arr[0].tip) - 22;\r\n        if (offX + 18 > fracColCenterX) {\r\n          fracColCenterX = offX + 18;\r\n        }\r\n      } else {\r\n        if (fracColCenterX > offX + midX - 18) {\r\n          fracColCenterX = offX + midX - 18;\r\n        }\r\n      }\r\n\r\n      ctx.fillStyle = '#000';\r\n      ctx.font = 'bold 15px \"Noto Serif SC\", \"Times New Roman\", serif';\r\n      var title = isRight ? '\\u8c03\\u548c\\u7ea7\\u6570' : '\\u51e0\\u4f55\\u7ea7\\u6570';\r\n      ctx.fillText(title, offX + (midX - ctx.measureText(title).width) \/ 2, 22);\r\n\r\n      ctx.fillStyle = color;\r\n      ctx.font = 'italic 13px \"Times New Roman\", serif';\r\n      var sumTxt = isRight\r\n        ? 'S_' + N + ' = ' + sH.toFixed(4)\r\n        : 'S_' + N + ' = 1 - 1\/2^' + N + ' = ' + sG.toFixed(5);\r\n      ctx.fillText(sumTxt, offX + (midX - ctx.measureText(sumTxt).width) \/ 2, 43);\r\n\r\n      \/\/ \u523b\u5ea6\u865a\u7ebf 0, 1, 2\r\n      ctx.save(); ctx.setLineDash([3, 3]); ctx.strokeStyle = '#999'; ctx.lineWidth = 0.8;\r\n      var ticks = [x0, x1, x2];\r\n      for (var t = 0; t !== 3; t++) {\r\n        var inBounds = false;\r\n        if (isRight) {\r\n          if (ticks[t] > offX + 12) { inBounds = true; }\r\n        } else {\r\n          if (offX + midX - 12 > ticks[t]) { inBounds = true; }\r\n        }\r\n        if (inBounds) {\r\n          ctx.beginPath(); ctx.moveTo(ticks[t], 54); ctx.lineTo(ticks[t], baseY + 6); ctx.stroke();\r\n          ctx.fillStyle = '#000'; ctx.font = 'italic 12px \"Times New Roman\", serif';\r\n          ctx.fillText(String(t), ticks[t] - 3, baseY + 20);\r\n        }\r\n      }\r\n      ctx.restore();\r\n\r\n      \/\/ \u652f\u6491\u53f0\u9762\u4e0e\u652f\u70b9 0\r\n      ctx.strokeStyle = '#000'; ctx.lineWidth = 1.2;\r\n      ctx.beginPath(); ctx.moveTo(toX(-1.02), baseY); ctx.lineTo(x0, baseY); ctx.lineTo(x0, baseY + 12); ctx.stroke();\r\n      drawFulcrum(x0, baseY + 1, 4.8);\r\n\r\n      \/\/ \u7ed8\u5236\u79ef\u6728\u3001\u51e0\u4f55\u4e2d\u5fc3\u4e0e\u540c\u4e00\u5217\u6807\u51c6 LaTeX \u5806\u53e0\u771f\u5206\u6570\r\n      for (var bi = N - 1; bi >= 0; bi--) {\r\n        var b = arr[bi], yT = toY(b.level + 1), yM = toY(b.level + 0.5);\r\n        var bxTip = toX(b.tip), bxBase = toX(b.tip - 1), bxC = toX(b.center);\r\n        var bxLeft = Math.min(bxTip, bxBase);\r\n        var pTip = bi === N - 1 ? x0 : toX(arr[bi + 1].tip);\r\n\r\n        if (hoverK === b.k) {\r\n          ctx.fillStyle = isRight ? 'rgba(22,163,74,0.1)' : 'rgba(220,38,38,0.1)';\r\n          ctx.fillRect(bxLeft, yT, pxL, brickH);\r\n        }\r\n        ctx.strokeStyle = '#333'; ctx.lineWidth = N > 35 ? 0.55 : 0.8;\r\n        ctx.strokeRect(bxLeft, yT, pxL, brickH);\r\n\r\n        \/\/ \u7a81\u51fa\u663e\u793a\u79ef\u6728\u51e0\u4f55\u4e2d\u5fc3\r\n        ctx.fillStyle = '#000';\r\n        ctx.beginPath();\r\n        ctx.arc(bxC, yM, hoverK === b.k ? 3.2 : (N > 35 ? 1.5 : 2.1), 0, Math.PI * 2);\r\n        ctx.fill();\r\n\r\n        \/\/ \u60ac\u6311\u5e95\u8fb9\u52a0\u7c97\r\n        ctx.strokeStyle = '#000'; ctx.lineWidth = 1.3;\r\n        ctx.beginPath(); ctx.moveTo(pTip, yT + brickH); ctx.lineTo(bxTip, yT + brickH); ctx.stroke();\r\n\r\n        var show = false;\r\n        if (omitK > b.k) {\r\n          if ((b.k - 1) % step === 0) {\r\n            if (omitK - b.k >= step) { show = true; }\r\n          }\r\n          if (step === 1) { show = true; }\r\n        }\r\n        if (b.k === N) { show = true; }\r\n\r\n        if (show) {\r\n          var barBox = drawStackedFracCentered(fracColCenterX, yM, b.k, isRight, fSz);\r\n          if (isRight) {\r\n            if (bxTip - 2 > barBox.right + 3) {\r\n              ctx.save();\r\n              ctx.setLineDash([1.5, 2]);\r\n              ctx.strokeStyle = '#888';\r\n              ctx.lineWidth = 0.6;\r\n              ctx.beginPath();\r\n              ctx.moveTo(bxTip - 2, yM);\r\n              ctx.lineTo(barBox.right + 3, yM);\r\n              ctx.stroke();\r\n              ctx.restore();\r\n            }\r\n          } else {\r\n            if (barBox.left - 3 > bxTip + 2) {\r\n              ctx.save();\r\n              ctx.setLineDash([1.5, 2]);\r\n              ctx.strokeStyle = '#888';\r\n              ctx.lineWidth = 0.6;\r\n              ctx.beginPath();\r\n              ctx.moveTo(bxTip + 2, yM);\r\n              ctx.lineTo(barBox.left - 3, yM);\r\n              ctx.stroke();\r\n              ctx.restore();\r\n            }\r\n          }\r\n        } else if (b.k === ellK) {\r\n          ctx.fillStyle = '#000';\r\n          ctx.beginPath();\r\n          ctx.arc(fracColCenterX, yM - 4, 1.1, 0, Math.PI * 2);\r\n          ctx.arc(fracColCenterX, yM, 1.1, 0, Math.PI * 2);\r\n          ctx.arc(fracColCenterX, yM + 4, 1.1, 0, Math.PI * 2);\r\n          ctx.fill();\r\n        }\r\n      }\r\n\r\n      \/\/ \u79ef\u6728\u4e2d\u5fc3\u8fde\u7ebf\r\n      ctx.save(); ctx.setLineDash([2, 2]); ctx.strokeStyle = '#555'; ctx.lineWidth = 0.9;\r\n      ctx.beginPath();\r\n      for (var ci = N - 1; ci >= 0; ci--) {\r\n        var cx = toX(arr[ci].center), cy = toY(arr[ci].level + 0.5);\r\n        if (ci === N - 1) { ctx.moveTo(cx, cy); } else { ctx.lineTo(cx, cy); }\r\n      }\r\n      ctx.stroke(); ctx.restore();\r\n\r\n      \/\/ \u8054\u5408\u91cd\u5fc3\u5782\u7ebf\u4e0e\u652f\u70b9\u5bf9\u9f50\r\n      var ti = N - 1;\r\n      if (hoverK >= 1) {\r\n        if (N >= hoverK) { ti = hoverK - 1; }\r\n      }\r\n      var act = arr[ti], pivX = toX(act.piv), comX = toX(act.com), conY = toY(act.level);\r\n      ctx.save(); ctx.setLineDash([3, 2]); ctx.strokeStyle = color; ctx.lineWidth = 1;\r\n      ctx.beginPath(); ctx.moveTo(comX, toY(N) - 4); ctx.lineTo(comX, conY); ctx.stroke();\r\n      ctx.restore();\r\n      drawFulcrum(pivX, conY, 3.8);\r\n      ctx.fillStyle = color; ctx.beginPath(); ctx.arc(comX, conY, 2.8, 0, Math.PI * 2); ctx.fill();\r\n\r\n      \/\/ \u5de6\u7ea2\u53f3\u7eff\u60ac\u6311\u5305\u7edc\u66f2\u7ebf\r\n      ctx.strokeStyle = color; ctx.lineWidth = 1.8;\r\n      ctx.beginPath(); ctx.moveTo(x0, baseY);\r\n      for (var m = N - 1; m >= 0; m--) { ctx.lineTo(toX(arr[m].tip), toY(arr[m].level + 0.5)); }\r\n      ctx.lineTo(toX(arr[0].tip), toY(N)); ctx.stroke();\r\n\r\n      \/\/ \u9876\u90e8\u603b\u60ac\u6311\u6807\u5c3a\r\n      var topTip = toX(arr[0].tip), dimY = toY(N) - 8;\r\n      ctx.strokeStyle = ctx.fillStyle = '#000'; ctx.lineWidth = 0.8;\r\n      drawArrow(x0, dimY, topTip, dimY, true);\r\n      ctx.font = 'italic 11px \"Times New Roman\", serif';\r\n      ctx.fillText(arr[0].tip.toFixed(4), (x0 + topTip) \/ 2 - 14, dimY - 4);\r\n\r\n      if (!isRight) {\r\n        \/\/ \u5de6\u4fa7\u6781\u9650\u8fb9\u754c\uff08x = 1\uff09\u4ee5\u7d2b\u8272\u7ec6\u7ebf\u663e\u793a\r\n        ctx.strokeStyle = '#9333ea'; ctx.lineWidth = 1.0;\r\n        ctx.beginPath(); ctx.moveTo(x1, 54); ctx.lineTo(x1, baseY); ctx.stroke();\r\n      } else {\r\n        for (var r = N - 1; r >= 0; r--) {\r\n          if (arr[r].tip >= 1) {\r\n            ctx.fillStyle = color; ctx.beginPath();\r\n            ctx.arc(toX(arr[r].tip), toY(arr[r].level + 0.5), 4, 0, Math.PI * 2); ctx.fill();\r\n            break;\r\n          }\r\n        }\r\n        ctx.save(); ctx.setLineDash([4, 3]); ctx.strokeStyle = ctx.fillStyle = color; ctx.lineWidth = 1.4;\r\n        var eX = Math.max(offX + 20, topTip - 48), eY = Math.max(56, toY(N) - 16);\r\n        drawArrow(topTip, toY(N), eX, eY, false); ctx.restore();\r\n        ctx.fillStyle = color; ctx.font = 'italic bold 14px \"Times New Roman\", serif';\r\n        ctx.fillText('\\u221e', eX - 15, eY + 4);\r\n      }\r\n    }\r\n  }\r\n\r\n  function setN(v) {\r\n    N = Math.max(1, Math.min(50, v));\r\n    slider.value = N; valEl.textContent = N; render();\r\n  }\r\n\r\n  slider.addEventListener('input', function(e) { setN(parseInt(e.target.value, 10)); });\r\n\r\n  canvas.addEventListener('mousemove', function(e) {\r\n    if (!meta) { return; }\r\n    var lvl = Math.floor((meta.baseY - (e.clientY - canvas.getBoundingClientRect().top)) \/ meta.brickH);\r\n    var k = -1;\r\n    if (lvl >= 0) {\r\n      if (meta.N > lvl) { k = meta.N - lvl; }\r\n    }\r\n    if (hoverK !== k) { hoverK = k; render(); }\r\n  });\r\n  canvas.addEventListener('mouseleave', function() { if (hoverK !== -1) { hoverK = -1; render(); } });\r\n\r\n  if (typeof ResizeObserver !== 'undefined') { new ResizeObserver(render).observe(canvas.parentElement); }\r\n  setTimeout(render, 60);\r\n})();\r\n<\/script>\r\n","protected":false},"excerpt":{"rendered":"<p>n = 10<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"image","meta":{"ngg_post_thumbnail":0,"h5ap_radio_sources":[],"footnotes":""},"categories":[6,7],"tags":[443,349,247],"class_list":["post-49993","post","type-post","status-publish","format-image","hentry","category-mpo","category-ict","tag-ai","tag-math","tag-physics","post_format-post-format-image"],"_links":{"self":[{"href":"https:\/\/www.qiusir.com\/index.php?rest_route=\/wp\/v2\/posts\/49993","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qiusir.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qiusir.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qiusir.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qiusir.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=49993"}],"version-history":[{"count":13,"href":"https:\/\/www.qiusir.com\/index.php?rest_route=\/wp\/v2\/posts\/49993\/revisions"}],"predecessor-version":[{"id":50006,"href":"https:\/\/www.qiusir.com\/index.php?rest_route=\/wp\/v2\/posts\/49993\/revisions\/50006"}],"wp:attachment":[{"href":"https:\/\/www.qiusir.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=49993"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qiusir.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=49993"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qiusir.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=49993"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}