diff --git a/articles/demo.md b/articles/demo.md index 381dea3..096ae4a 100644 --- a/articles/demo.md +++ b/articles/demo.md @@ -8,41 +8,6 @@ function func(a, b) { } ``` -## [katex](https://katex.org/) - -- [js katex api ](https://katex.org/docs/api) -- [支持格式](https://katex.org/docs/support_table) - -$$ -a^2=b^2+c^2 -$$ - -This is inline katex: - -$ c = \\pm\\sqrt{ a^2 + b^2 } $ - -This is block level katex: - -$$ -c = \\pm\\sqrt{a^2 + b^2} -$$ - -$$ -\\begin{array}{cc} - a & b \\\\ - c & d -\\end{array} -$$ - -$$ -\\begin{array}{cc} -1 & 2 & 3 \\\\ -4 & 5 & 6 \\\\ -7 & 8 & 9 -\\end{array} -$$ - -[maths symbols for latex](https://mirrors.jlu.edu.cn/CTAN/info/symbols/math/maths-symbols.pdf) ## [alert](https://github.com/bent10/marked-extensions/tree/main/packages/alert) - [Enables GFM alerts](https://github.com/orgs/community/discussions/16925) @@ -98,6 +63,165 @@ $$ | Header | Title | Here's this | | Paragraph | Text | And more | +## [katex](https://katex.org/) + +- [js katex api ](https://katex.org/docs/api) +- [支持格式](https://katex.org/docs/support_table) +- [常用数学公式排版KaTex语法总结](https://kissingfire123.github.io/2022/02/18_%E6%95%B0%E5%AD%A6%E5%85%AC%E5%BC%8Fkatex%E5%B8%B8%E7%94%A8%E8%AF%AD%E6%B3%95%E6%80%BB%E7%BB%93/) + +可以使用text来包装字体,这样就不会出现问题了 + +$$ x^{y^z}=(1+{\rm e}^x)^{-2xy^w} $$ + +$$ +a^2=b^2+c^2 +$$ + +This is inline katex: + +$ c = \\pm\\sqrt{ a^2 + b^2 } $ + +This is block level katex: + +$$ +c = \\pm\\sqrt{a^2 + b^2} +$$ + +注意公式内换行,是四个反斜杠 + +$$ +\\begin{array}{cc} + a & b \\\\ + c & d +\\end{array} +$$ + +$$ +\\begin{array}{cc} +1 & 2 & 3 \\\\ +4 & 5 & 6 \\\\ +7 & 8 & 9 +\\end{array} +$$ + +$$ +\begin{matrix} + 1 & x & x^2 \\\\ + 1 & y & y^2 \\\\ + 1 & z & z^2 \\\\ +\end{matrix} +$$ + +$ \begin{matrix} 1 & 2 \\\\ 3 & 4 \\\\ \end{matrix} $ + +$ \begin{pmatrix} 1 & 2 \\\\ 3 & 4 \\\\ \end{pmatrix} $ + +$ \begin{bmatrix} 1 & 2 \\\\ 3 & 4 \\\\ \end{bmatrix} $ + +$ \begin{Bmatrix} 1 & 2 \\\\ 3 & 4 \\\\ \end{Bmatrix} $ + +$ \begin{vmatrix} 1 & 2 \\\\ 3 & 4 \\\\ \end{vmatrix} $ + +$ \begin{Vmatrix} 1 & 2 \\\\ 3 & 4 \\\\ \end{Vmatrix} $ + +$$ +\begin{pmatrix} + 1 & a_1 & a_1^2 & \cdots & a_1^n \\\\ + 1 & a_2 & a_2^2 & \cdots & a_2^n \\\\ + \vdots & \vdots & \vdots & \ddots & \vdots \\\\ + 1 & a_m & a_m^2 & \cdots & a_m^n \\\\ +\end{pmatrix} +$$ + +$$ +\left[ + \begin{array}{cc|c} + 1 & 2 & 3 \\\\ + 4 & 5 & 6 \\\\ + \end{array} +\right] +$$ + + $\text{这是一个行中矩阵的示例}\bigl(\begin{smallmatrix} a & b \\\\ c & d \end{smallmatrix}\bigr)\text{。}$ + +$\lVert \boldsymbol{X}_i - \boldsymbol{S}_j \rVert^2$ + +$$ f(x,y,z) = 3y^2z \left( 3+\frac{7x+5}{1+y^2} \right) $$ + +$$ \left. \frac{{\rm d}u}{{\rm d}x} \right| _{x=0} $$ + +分数 + +$$ \frac{a-1}{b-1} \quad or \quad {a+1 \over b+1} $$ + +$$ \frac 12,\frac 1a,\frac a2 \quad \mid \quad \text{2 letters only:} \quad \frac 12a \\,, k\frac q{r^2} $$ + +$$ \sqrt{2} \quad or \quad \sqrt[n]{3} $$ + +$$ f(x_1,x_2 \ldots x_n) = x_1^2 + x_2^2 + \cdots + x_n^2 $$ + +$$ \vec{a} \cdot \vec{b}=0 $$ + +$$ xy \text{ with arrows:} \quad \overleftarrow{xy} \\; \mid \\; \overleftrightarrow{xy} \\; \mid \\; \overrightarrow{xy} $$ + +$$ \int_0^1 {x^2} \,{\rm d}x $$ + +$$ \lim_{n \to \infty} \frac{1}{n(n+1)} \quad and \quad \lim_{x\leftarrow{\text{示例}}} \frac{1}{n(n+1)} $$ + +$$ \sum_{i=1}^n \frac{1}{i^2} \quad and \quad \prod_{i=1}^n \frac{1}{i^2} \quad and \quad \bigcup_{i=1}^{2} \Bbb{R} $$ + +$$ \verb+\overset{above}{level}+ \qquad \overset{xx}{ABC} \\;\\; \mid \quad \overset{x^2}{\longmapsto}\ \\, \mid \quad \overset{\bullet\circ\circ\bullet}{T} $$ + +$$ \verb+\underset{below}{level}+ \qquad \underset{xx}{ABC} \\;\\; \mid \quad \underset{x^2}{\longmapsto}\ \\, \mid \quad \underset{\bullet\circ\circ\bullet}{T} $$ + +$$ \rm {SrO} + V^{''}_{Sr} \overset{H_2}{\underset{1300 \text{ \textdegree C} }{\Longleftrightarrow}} 2e^{'}+\frac 12O_2(g) + Sr^{\times}_S $$ + +$$ +\begin{array}{cc} + \mathrm{Bad} & \mathrm{Better} \\\\ + \hline \\\\ + \int_0^1 x^2 dx & \int_0^1 x^2 \\,{\rm d}x +\end{array} +$$ + + + +$$ +\begin{aligned} + a=&\left(1+2+3+ \cdots \right. \\\\ + &\cdots+\left. \infty-2+\infty-1+\infty\right) +\end{aligned} +$$ + + + +$$ +A B \quad Vs \quad A\\,B \\\\ +C D \quad Vs \quad C\\;D \\\\ +E F \quad Vs \quad E\space F +$$ + +$$ \mu_0=4\pi\times10^{-7} \ \left.\mathrm{\mathrm{T}\\!\cdot\\!\mathrm{m}}\middle/\mathrm{A}\right.$$ + +$$ 180^\circ=\pi \ \mathrm{rad} $$ + +$$ \mathrm{N_A} = 6.022\times10^{23} \ \mathrm{mol}^{-1}$$ + +$$ +\begin{array}{|rrrrrrrr|}\hline + \verb+#000+ & \color{#000}{text} & & & + \verb+#00F+ & \color{#00F}{text} & & \\\\ + & & \verb+#0F0+ & \color{#0F0}{text} & + & & \verb+#0FF+ & \color{#0FF}{text} \\\\ + \verb+#F00+ & \color{#F00}{text} & & & + \verb+#F0F+ & \color{#F0F}{text} & & \\\\ + & & \verb+#FF0+ & \color{#FF0}{text} & + & & \verb+#FFF+ & \color{#FFF}{text} \\\\ +\hline\end{array} +$$ + +[maths symbols for latex](https://mirrors.jlu.edu.cn/CTAN/info/symbols/math/maths-symbols.pdf) + ## 其他 diff --git a/cpl/language.md b/cpl/language.md index 70ada95..b2ac22b 100644 --- a/cpl/language.md +++ b/cpl/language.md @@ -1,5 +1,8 @@ # 编程语言 +- [位运算](/cpl/tools/bit.md) +- [浮点数与定点数](/cpl/tools/number.md) + 程序执行的过程就是把解决问题的思路翻译成计算机可执行的精确化形式语言的过程,编程语言就是解决问题思路的呈现 计算过程依赖于形式语言,而形式语言的核心就是代数体系,就是定义了数据类型及针对这些类型的运算规则,确保运算的封闭性和自洽性。 @@ -52,4 +55,5 @@ rust语言的安全,就是通过所有权的确定来保证在运行期不会 ### 语法高亮 -- [js版的highlight高亮配置,选中语言,下载后选择es版本的,选择特定语言即可](https://highlightjs.org/download) \ No newline at end of file +- [js版的highlight高亮配置,选中语言,下载后选择es版本的,选择特定语言即可](https://highlightjs.org/download) + diff --git a/cpl/tools/number.md b/cpl/tools/number.md new file mode 100644 index 0000000..5e6a8ee --- /dev/null +++ b/cpl/tools/number.md @@ -0,0 +1,57 @@ +# 数 +> 在计算机中得表示 + +## 定点数 + +约定计算机中小数点的位置,且这个位置固定不变,小数点前、后的数字,分别用二进制表示,然后组合起来就可以把这个数字在计算机中存储起来,这种表示方式叫做「定点」表示法,用这种方法表示的数字叫做「定点数」 + +- 纯整数:例如整数100,小数点其实在最后一位,所以忽略不写 + 1. 纯整数100,由于小数点固定在最低位,假定我们以 1 个字节(8 bit)表示,用定点数表示如 100(D) = 01100100(B) +- 纯小数:例如:0.123,小数点固定在最高位 + 1. 纯小数 0.125,由于小数点固定在最高位,同样以 1 个字节(8 bit)表示,用定点数表示 0.125(D) = 0.00100000(B) +- 整数+小数:例如1.24、10.34,小数点在指定某个位置 + 1. 约定前 5 位表示整数部分,后 3 位表示小数部分 + 2. 数字 1.5 用定点数表示 1.5(D) = 00001 100(B) + 3. 数字 25.125 用定点数表示 25.125(D) = 11001 001(B) + +定点数表示整数还是很好得,表示小数时就有问题了 +- 数值的表示范围有限(小数点越靠左,整个数值范围越小) +- 数值的精度范围有限(小数点越靠右,数值精度越低) + + +## 浮点数 +> float +- [IEEE-754 Floating Point Converter](https://www.h-schmidt.net/FloatConverter/IEEE754.html) +- [IEEE Std 754™-2008 (Revision of IEEE Std 754-1985) IEEE Standard for Floating-Point Arithmetic](http://www.dsc.ufcg.edu.br/~cnum/modulos/Modulo2/IEEE754_2008.pdf) + +浮点数是采用科学计数法来表示一个数字的,它的格式可以写成这样 + +$$ +V = (-1)^S * M * R^E +$$ + +其中各个变量的含义如下 +- S:符号位,取值 0 或 1,决定一个数字的符号,0 表示正,1 表示负 +- M:尾数,用小数表示,例如前面所看到的 8.345 * 10^0,8.345 就是尾数 +- R:基数,表示十进制数 R 就是 10,表示二进制数 R 就是 2 +- E:指数,用整数表示,例如前面看到的 10^-1,-1 即是指数 + +直到1985年,IEEE 组织推出了浮点数标准,就是我们经常听到的 IEEE754 浮点数标准,这个标准统一了浮点数的表示形式,并提供了 2 种浮点格式: +- 单精度浮点数 float:32 位,符号位 S 占 1 bit,指数 E 占 8 bit,尾数 M 占 23 bit +- 双精度浮点数 float:64 位,符号位 S 占 1 bit,指数 E 占 11 bit,尾数 M 占 52 bit + + +## 误差 +浮点数会带来误差,但是这种误差得消除不仅仅是从数的表示上,还可以从其他方法上。 + +### 存在歧义 +一般图形库都会设置距离误差和角度误差,这两个误差有一定的倍差关系,一般情况下不会出现问题。 +如点接近重叠时,一个满足要求,一个不满足要求的情况。通过算法统一误差计算方法,但是会导致算法变慢 +这时就需要折中处理其误差了。 + +特别是处理几何数据时,误差就需要考虑了!之前云旎项目时让我解析STL的数据,我个人认为没有点、边关系,处理起来感觉不靠谱,但是其他同事还是硬处理了, +其实就是把误差当作很小,不受影响的问题。我的想法是在浮点数如何来判断点的关系了,这其实就是精度完全可接受的范围内,重叠点就是另外的情况了。 + +stl中的格式中,每个面片都是各自存储其顶点的,这里直接判断两个顶点相等,不考虑误差。 + + diff --git a/exercises/advanced.mathematics.md b/exercises/advanced.mathematics.md new file mode 100644 index 0000000..d9fc73f --- /dev/null +++ b/exercises/advanced.mathematics.md @@ -0,0 +1,22 @@ +# 高等数学 +> + +## 例题1 2024-5-17 + +> **Note来源** +> 吴康公众号 + +$$ +\text{设}F(x) = sinx \cdot sin2x \cdots sin(2022x), \text{求}F^{2024}(0). \newline +\text{首先,把公式一般化,就是}F(x) = \prod _{\substack{1 \le k \le n}} {sin(kx)}, n \in N^+. \text{求 }F^{n+2}(0) +$$ + +解: + +$$ +\text{引入定理,证略} \newline +sinx = x - \frac{x^3}{6} + o(x^3), x \to 0 \text{带入可以得到} F(x) = \prod _{\substack{1 \le k \le n}} { \[ kx - \frac{kx^3}{6} + o(x^3) \]}, x \to 0 \newline +F(x) \text{的展开式中}x^{n+2}\text{项为} \newline +\sum_{1 \le k \le n}{\[\prod_{1 \le k \le n}\]}(kx)^{-1} \cdot (-6^{-1})(kx)^3=-6^{-1}\lgroup{\sum_{1 \le k \le n}{k^2}}\rgroup n!x^{n+2} = -36^{-1}n(2n+1)(n+1)!(n+2)! +$$ + diff --git a/exercises/index.md b/exercises/index.md index 5fb3c72..3fa2557 100644 --- a/exercises/index.md +++ b/exercises/index.md @@ -1,7 +1,10 @@ # 习题 > 典型和分类学习 - - [数论](/exercises/number.theory.md) -- [夹逼法](/exercises/sequeezing.md) +- [小学数学](/exercises/math.primary.md) +- [初中数学](/exercises/math.secondary.md) +- [高中数学](/exercises/math.high.md) - [二次方程](/exercises/quadratic.equation.md) +- [高等数学](/exercises/advanced.mathematics.md) +- [夹逼法](/exercises/sequeezing.md) diff --git a/exercises/math.high.md b/exercises/math.high.md new file mode 100644 index 0000000..fbcc523 --- /dev/null +++ b/exercises/math.high.md @@ -0,0 +1,2 @@ +# 高中数学 +> diff --git a/exercises/math.primary.md b/exercises/math.primary.md index d80126c..8fd60c9 100644 --- a/exercises/math.primary.md +++ b/exercises/math.primary.md @@ -1,204 +1,2 @@ -# Web - -- [使用过的库](/web/library.md) -- [正则表达式](/cpl/js/regularExpressions.js) -- [webassembly](/web/webAssembly.md) -- [http](/web/http.md) -- [html](/web/html.md) -- [css](/web/css.md) -- [canvas](/cg/canvas.md) -- [小程序开发](/web/mini.md) -- [字体](/web/font.md) -- [框架](/web/framework.md) -- [测试模块](/web/test.md) -- [图像处理](/web/ImageManipulation.md) -- [diff算法原理](/web/diff.md) -- [FRP-Functional Reactive Programming](/cpl/frp.md) -- [web](/web.md) -- [浏览器](/web/browser.md) -- [html](/web/html.md) -- [CSS](/web/css.md) -- [适配屏幕](/web/adapt.screen.md) -- [font](/web/font.md) -- [http](/web/http.md) -- [nginx](/web/nginx.md) -- [javascript](/cpl/web/ECMAScript.md) - - -- [Web Check网站分析,分析各种配置,可参考网站的配置](https://web-check.as93.net/) -- [Draggable objects可拖动的对象网页实现](https://www.redblobgames.com/making-of/draggable/) - - -## WebGL - -### [threejs](https://threejs.org/) - -- [笔记](/cg/threejs/index.md) - -### [BabylonJS](https://www.babylonjs.com/) - -- [笔记](/cg/babylonjs/index.md) - -## library - -### 多语言 -> i18n是国际化的英文为 internationalization,为了方便,通常会简写为 i18n(开头的 i、中间的 18 个字符、末尾的 n) - -分三类信息, -- message,文本的替换 -- date time format,时间日期的格式 -- number,数字格式,货币形式等 - -但难点还是很多的: -- 多语言的没有标准,使用起来就存在各种兼容的问题,如中文有zh,zh_CN等来区分中文, 可参考BCP 47,全称为Best Current Practice for Tags for the Identification of Languages,是一个基于RFC 5646标准的语言标签格式的建议标准。 -- 多语言还是影响视觉设计,开发时就需要考虑这些问题,不同语言的表述会导致字符的长度差异较大 -- 语言的字段是复用还是语义化,都是一个难点,随着需求的变化可能会有很大的影响 -- 符合用户习惯与不同文化的需求 - - -#### **vue** - -把i18n实列对象放入Vue的实例中,通过this.$i18n.locale='zh'来设置对应的语言 - -也可以存储在store或cookie中, - -但对惰性组件,如echarts这类需要重新渲染的,就需要手动处理了,方法有: -- 利用watch监听locale字段是否发现变化,主动调用重新渲染 -- locale变化时直接this.reload强制刷新页面 - -```js -new Vuei81n({ - locale:'', - messages: {}, // $t(path) - numberFormats: {}, // $n() - dateTimeFormats: {}, // $d() -}) -``` - -### 引导库 - -- [driver.js官网](https://driverjs.com/) - - [Driver.js,Powerful, highly customizable vanilla JavaScript engine to drive the user's focus across the page,MIT开源协议](https://github.com/kamranahmedse/driver.js) - -- [Intro.js is a lightweight JavaScript library for creating step-by-step and powerful customer onboarding tours商用授权](https://introjs.com/) - - [github](https://github.com/usablica/intro.js) -- [Bootstrap Tour](https://bootstraptour.com/) - - [github](https://github.com/sorich87/bootstrap-tour) - -### 富文本编辑器 - -- [企业版的开源富文本编辑器The rich text editor behind great content creation experiences](https://github.com/tinymce/) - - [TinyMCE](https://github.com/tinymce/tinymce) - -- [过时的YUI is a free, open source JavaScript and CSS library for building richly interactive web applications. ](https://clarle.github.io/yui3/) - - [github yui3 ](https://github.com/yui/yui3) - -- [The WYSIWYG Editor of tomorrow available today](https://ckeditor.com/) - - [CKEditor 5 is an ultra-modern JavaScript rich-text editor with MVC architecture, a custom data model, and virtual DOM](https://github.com/ckeditor/ckeditor5) - -- [Quill -- Your powerful rich text editor.](https://quilljs.com/) - - [github](https://github.com/quilljs/quill) - -### PDF - -- [PDF-LIB可写可修改](https://pdf-lib.js.org/) 字体必须内嵌,这样文件非常大,拷贝合并pdf时,内嵌字体还没法删除 - - [github](https://github.com/Hopding/pdf-lib) - -- [jspdf只能写 github](https://github.com/parallax/jsPDF) - -### 数学 -- [regression-js是JS库,包含了linear least-squares filting methods对的数据分析方法,支持linear、exponential、logarithmic、power、polynomial几种常见的](https://github.com/Tom-Alexander/regression-js) - -- [ever polate -- Javascript Numerical Inerpolation library](https://github.com/BorisChumichev/everpolate) - -### 颜色库 - -- [Modular, design-conscious color picker widget for JavaScript](https://iro.js.org/) - - [github](https://github.com/jaames/iro.js/) - -### 其他 - -- [Create, read and edit .zip files with Javascript ](https://stuk.github.io/jszip/) - - [github](https://github.com/Stuk/jszip) -```js -jszip.loadAsync(new Blob([buffer])).then(zip=>{ - zip.file('filename').async('ArrayBuffer').then(data=>{ - console.log(data) - }) -}) -``` - -#### 放大镜 -- [loupe.js 2.0 allows you to add photorealistic loupes (magnifier) to images on your webpages. The design is changeable by use of an image editing program. It uses unobtrusive javascript to keep your code clean. ](http://www.netzgesta.de/loupe/) - -##### loupe-js - -实现原理很简单, 就是图像因为窗口被压缩,放大镜的作用就是对原图采样截图图片,算好位置,可直接使用css来截图,不像loupe.js这个库使用的是两张图来截取. - -- [An image magnifier for JavaScript](https://github.com/nishanths/loupe-js) - - [demo](https://nishanths.github.io/loupe-js/?shape=rectangle) - - -### UI -- [bootstrap](https://getbootstrap.com/) - - [fast bootstrap](https://fastbootstrap.com/) - -- [naive ui](https://www.naiveui.com/en-US/os-theme) - -- [Element Plus](https://element-plus.org/en-US/component/button.html) - -- [ Fabric.js is a powerful and simple Javascript HTML5 canvas library ](http://fabricjs.com/) - - [github fabric](https://github.com/fabricjs/fabric.js) - -- [原生HTML5的canvas中所支持的贝塞尔曲线最多只到3阶,bezierMaker.js可以理论支持N阶贝塞尔曲线的生成](https://github.com/Aaaaaaaty/bezierMaker.js) - -- [AlloyImage - 基于HTML5技术的专业图像处理库](https://github.com/AlloyTeam/AlloyImage) - -- [JSCAD](https://jscad.app/) - - [github](https://github.com/jscad) - - [open jscad](https://openjscad.xyz/) - - [CADit.app](https://cadit.app/) - - [A jscad UI playground developed here and meant to be later contributed into jscad](https://github.com/hrgdavor/jscadui) - -## Test - -**TDD** - -测试驱动开发, 在开发功能代码之前,先编写单元测试用例代码,确定需要编写的代码逻辑。TDD是XP(Extreme Programming)的核心实践 - -**BDD** - -行为驱动开发, - -“开发软件系统最困难的部分就是准确说明开发什么” (“The hardest single part of building a software system is deciding precisely what to build” — No Silver Bullet, Fred Brooks) - -BDD(Behavior Driven Development), 提出者 Dan North 强调 BDD 不是关于测试的,它是在应用程序存在之前,写出用例与期望,从而描述应用程序的行为,并且促使在项目中的人们彼此互相沟通 - -测试相关的配置 - -vue创建工程时,有一个[Manually select features](https://lmiller1990.github.io/vue-testing-handbook/zh-CN/setting-up-for-tdd.html#%E5%AE%89%E8%A3%85-vue-cli)中可配置 -- [BDD](https://insights.thoughtworks.cn/when-we-talk-about-bdd/) - -### [Jasmine](https://github.com/jasmine/jasmine) - -TDD(Test Driven Development)测试驱动开发的框架, - -[Behavior-Driven JavaScript docs](https://jasmine.github.io/pages/docs_home.html) -[2.9](https://jasmine.github.io/2.9/introduction) - -### Jest - -### Karma - -npm install --save-dev karma karma-mocha karma-chrome-launcher karma-mocha-reporter karma-webpack mocha mocha-sinon sinon sinon-chai webpack karma-chai chai - -运行 -node .\node_modules\karma\bin\karma start -node .\node_modules\karma\bin\karma init - -- [karma.conf.js配置](https://karma-runner.github.io/5.2/config/configuration-file.html) -- [karma-coverage](https://github.com/karma-runner/karma-coverage)测试覆盖率 - -### [chai](https://github.com/chaijs/chai) - -[document](https://www.chaijs.com/) +# 小学数学 +> diff --git a/exercises/math.secondary.md b/exercises/math.secondary.md new file mode 100644 index 0000000..0e713d1 --- /dev/null +++ b/exercises/math.secondary.md @@ -0,0 +1,50 @@ +# 中学数学 +> + +## 谜题类型 + +### 2024-5-17 +设“可怕新冠”为4位数,“新冠不可怕”为5位数,“进”,“退”为不同的一位素数,相同汉字代表相同的数字,求解谜题: + +$\overline{\text{可怕新冠}} \div \text{退} \times \text{进}!! \times \text{进}!! \times \text{进}!! = \overline{\text{新冠不可怕}}$ + +其中n!!表示双阶乘,或超阶乘,其定义是 +- n为正偶数时,n!!表示从n开始递减的所有正偶数的乘积 +- n为正奇数时,n!!表示从n开始递减的所有正奇数的乘积 +- 3!! = 3 x 1 = 3 +- 5!! = 5 x 3 x 1 = 15 +- 7!! = 7 x 5 x 3 x 1 = 105 + +解: + +$$ +\text{设} x= \overline{\text{可怕}}, y = \overline{\text{新冠}} p = \text{进}, q = \text{退}, t = \text{不}, \text{则} \newline +\{p,q\} \sube \{3,5,7\} \newline +\text{若}p=7, \text{则等式左值} \ge 1000 \div 5!! \times (7!!)^3 > 99999, \text{超过5位数,引出矛盾} \newline +$$ + +现在排除了一种情况,现在就剩下的四种情况讨论一下 + +$$ +\text{设}p=3, \text{则}q=5\text{或}7 \newline +q=5\text{时}, (100x+y) \div 5!! \times (3!!)^3 = (1000y + 100t + x) \implies 9(100x + y) = 5(1000y + 100t + x) \implies 895x = 4991y + 500t \implies 179 \times 5x = 4991y + 500t \newline +\text{观察式子可得出} \implies 179x = 4991y \div 5 + 100t \implies 5 \mid y \implies y \ge 5 \implies \text{式子右边} \ge 4991 * 5 = 24955, \text{引出矛盾} +$$ + +> **Note** +> 这里涉及到模运算,从初中就是一直卡在我头脑中的问题了,不清楚如何引出矛盾的过程的。 + +$$ +q=7\text{时}, (100x+y) \div 7!! \times (3!!)^3 = (1000y + 100t + x) \implies 9(100x + y) = 35(1000y + 100t + x) \implies 865x = 34991y + 3500t \newline +\text{与上同理可得出} \implies 5 \mid y \implies y \ge 5 \implies \text{式子右边} \ge 34991 * 5 = 174955, \text{引出矛盾} +$$ + +此时可得知p=5,剩下两种情况 + +$$ +q=3\text{时}, (100x+y) \div 3!! \times (5!!)^3 = (1000y + 100t + x) \implies 1125(100x + y) = 1000y + 100t + x \implies 112499x + 125y = 100t \text{引出矛盾} \newline +q=7\text{时}, (100x+y) \div 7!! \times (5!!)^3 = (1000y + 100t + x) \implies 225(100x + y) = 7(1000y + 100t + x) \implies 22493x = 6775y + 700t \newline +\implies 271(83x - 25y) = 700t \implies 271 \mid t \implies t = 0 \newline +\implies 83x = 25y \implies x = 25, y = 83. \newline +\text{最后的解就是} 2583 \div 7!! \times 5!! \times 5!! \times 5!! = 83025 +$$ diff --git a/exercises/quadratic.equation.md b/exercises/quadratic.equation.md index b0519ee..fb0145d 100644 --- a/exercises/quadratic.equation.md +++ b/exercises/quadratic.equation.md @@ -4,100 +4,51 @@ 在数学的历史中,不定方程指的是没有给出具体解法的方程,或者解的个数不是有限的,可能是无限多的解。 -而一元二次方程是指最高次项为二次的单变量(一个未知数)方程,形式通常为 - -$$ -ax^2+bx+c=0 -$$ - -,其中 a、b、和c是已知数,而x是未知数。当这种方程的系数a、b、和c是变量而不是具体的数值时,我们称之为不定方程。 - - -### 例题1 -已知A、n为正整数,满足 - $$ -A = (n-7)(n+8) +\text{一元二次方程是指最高次项为二次的单变量(一个未知数)方程,形式通常为} \newline +ax^2+bx+c=0, \text{,其中 a、b、和c是已知数,而x是未知数。当这种方程的系数a、b、和c是变量而不是具体的数值时,我们称之为不定方程。} $$ -且A为完全平方数,那么n有最几个值,n的最小值是多少,n的最大值是多少? +### 例题1 2024-5-16 +$\text{已知A、n为正整数,满足}, A = (n-7)(n+8), \text{且A为完全平方数,那么n有最几个值,n的最小值是多少,n的最大值是多少?}$ 分析:因为n在变化,可以把A缩放在某个区间来解题。使用换元法替换一个变量,这样就更容易理解了。 解: - -设k=n-7,则 - -$$ -A = (n-7)(n+8) \to A = k(k+15) = k^2 + 15k < k^2 + 16k < k^2 + 16k + 4 = (k+8)^2 -$$ - -$\because A=k^2 + 15k $ - -是完全平方数,所 - -$k^2+15$ - -必然在两个完全平方数A和 - -$(k+8)^2$ - -之间。这样就可以一一判断两个等式之间是否成立了。 - -$$ -k^2+15k=(k+1)^2 \to k=\frac{1}{13} -$$ - -$$ -k^2+15k=(k+2)^2 \to k=\frac{4}{11} -$$ - -$$ -k^2+15k=(k+3)^2 \to k=1 \to n=8 \to A=(8-7)(8+8)=1 \cdot 16=16=4^2 -$$ - -$$ -k^2+15k=(k+4)^2 \to k=\frac{16}{7} -$$ - $$ -k^2+15k=(k+5)^2 \to k=5 \to n=12 \to A=(12-7)(12+8)=5 \cdot 20=100=10^2 +\text{设}k=n-7\text{,则} \newline +A = (n-7)(n+8) \to A = k(k+15) = k^2 + 15k < k^2 + 16k < k^2 + 16k + 4 = (k+8)^2 \newline +\because A=k^2 + 15k \text{是完全平方数,所以} k^2+15 \text{必然在两个完全平方数A和} (k+8)^2 \text{之间。} $$ -$$ -k^2+15k=(k+6)^2 \to k=12 \to n=19 \to A=(19-7)(19+8)=12 \cdot 27 =2^2 \cdot 3 \cdot 3 \cdot 3^2=(2 \cdot 3 \cdot 3)^2 = 18^2 -$$ +这样就可以一一判断两个等式之间是否成立了。 $$ +k^2+15k=(k+1)^2 \to k=\frac{1}{13} \newline +k^2+15k=(k+2)^2 \to k=\frac{4}{11} \newline +k^2+15k=(k+3)^2 \to k=1 \to n=8 \to A=(8-7)(8+8)=1 \cdot 16=16=4^2 \newline +k^2+15k=(k+4)^2 \to k=\frac{16}{7} \newline +k^2+15k=(k+5)^2 \to k=5 \to n=12 \to A=(12-7)(12+8)=5 \cdot 20=100=10^2 \newline +k^2+15k=(k+6)^2 \to k=12 \to n=19 \to A=(19-7)(19+8)=12 \cdot 27 =2^2 \cdot 3 \cdot 3 \cdot 3^2=(2 \cdot 3 \cdot 3)^2 = 18^2 \newline k^2+15k=(k+7)^2 \to k=49 \to n=56 \to A=(56-7)(56+8)=49 \cdot 64 =7^2 \cdot 8^2=(7 \cdot 8)^2 = 56^2 $$ 综上所述,n有4个值,最小的是8,最大的是56. -### 例题2 -已知 - -$$ -n^3 + 2n^2 + 8n - 5 -$$ +### 例题2 2024-5-16 -是一个正整数的立方,则正整数的n的值可能是 +$\text{已知} n^3 + 2n^2 + 8n - 5 \text{是一个正整数的立方,则正整数的n的值可能是}$ 解: $$ -n^3 < n^3 + 2n^2 + 8n - 5 < n^3 + 6n^2 + 12n + 8 = (n+2)^3 +n^3 < n^3 + 2n^2 + 8n - 5 < n^3 + 6n^2 + 12n + 8 = (n+2)^3 \newline +\text{可推出} \\\\ +n^3 + 2n^2 + 8n - 5 = (n+1)^3 \to n^2 - 5n + 6 = 0 \to \{因式分解可得n=2或3} $$ -可推出 - $$ -n^3 + 2n^2 + 8n - 5 = (n+1)^3 \to n^2 - 5n + 6 = 0 +\text{把结果待人方程也可以验证} \newline +\therefore 2^3 + 2 \cdot 2^2 + 8 \cdot 2 - 5 = 27 = 3^3 \newline +\therefore 3^3 + 2 \cdot 3^2 + 8 \cdot 3 - 5 = 64 = 4^3 $$ - - -$ \therefore 2^3 + 2 \cdot 2^2 + 8 \cdot 2 - 5 = 27 = 3^3 $ - -$ \therefore 3^3 + 2 \cdot 3^2 + 8 \cdot 3 - 5 = 64 = 4^3 $ - -因式分解可得n=2或3. 把结果待人方程也可以验证。 diff --git a/index.css b/index.css index c0cbacb..c1cbee2 100644 --- a/index.css +++ b/index.css @@ -43,3 +43,6 @@ em { ::-webkit-scrollbar { width: 2px !important; } +.navbar-nav .nav-link.active { + color: var(--bs-primary)!important; +} diff --git a/index.html b/index.html index 86fd9d2..20ca0a7 100644 --- a/index.html +++ b/index.html @@ -30,7 +30,7 @@