测试文档

· 更新于
Published on

代码测试

二分查找 binsearch

ts
// [l, r)
function search(nums: number[], target: number): number {
  let l = 0
  let r = nums.length
  while (l < r) {
    const c = (l + r) >> 1
    if (nums[c] > target)
      r = c

    else if (nums[c] < target)
      l = c + 1

    else
      return c
  }
  return -1
}
// [l, r)
function search(nums: number[], target: number): number {
  let l = 0
  let r = nums.length
  while (l < r) {
    const c = (l + r) >> 1
    if (nums[c] > target)
      r = c

    else if (nums[c] < target)
      l = c + 1

    else
      return c
  }
  return -1
}

2 级标题

3 级标题

4 级标题

有序列表

  1. First item
  2. Second item
  3. Third item
  4. Fourth item

无序列表

  • First item
  • Second item
  • Third item
  • Fourth item

katex 测试

正态分布的概率密度函数均值为 μ\mu 方差为 σ2\sigma^2 (或标准差 σ\sigma ),是高斯函数的一个实例:

f(x;μ,σ)=1σ2πexp((xμ)22σ2)f(x;\mu,\sigma)=\frac{1}{\sigma\sqrt{2\pi}} \exp \left( -\frac{(x- \mu)^2}{2\sigma^2} \right)

如果一个随机变量 XX 服从这个分布,我们写作 XN(μ,σ2)X \sim N(\mu, \sigma^2) 。如果 μ=0\mu =0 并且 σ=1\sigma =1 ,这个分布被称为标准正态分布,这个分布能够简化为

f(x)=12πexp(x22)f(x) = \frac{1}{\sqrt{2\pi}} \exp\left(-\frac{x^2}{2} \right)

累积分布函数是指随机变量 XX 小于或等于 xx 的概率,用概率密度函数表示为

F(x;μ,σ)=1σ2πxexp((tμ)22σ2 )dtF(x;\mu,\sigma)=\frac{1}{\sigma\sqrt{2\pi}}\int_{-\infty}^x \exp \left( -\frac{(t - \mu)^2}{2\sigma^2}\ \right) dt

正态分布的累积分布函数能够由一个叫做误差函数的特殊函数表示:

Φ(z)=12[1+erf(zμσ2)]\Phi (z)={\frac 12}\left[1+\operatorname {erf}\left({\frac {z-\mu }{\sigma {\sqrt 2}}}\right)\right]

Valaxy v0.17.2 驱动 | 主题 - Sakura v0.0.7