Skip to content

Instantly share code, notes, and snippets.

View VincentTam's full-sized avatar
🏀
Rolling around

Vincent Tam VincentTam

🏀
Rolling around
View GitHub Profile
@VincentTam
VincentTam / 231020-bdd.md
Last active October 22, 2023 15:26
vin's discord math notes chap. 2

由於 (1 + 1/n) 是二項式的 n 次方,要了解它的特性(如剛才展示的上下限),需要用上二項式定理。上面不等式最具技巧的一步在於藍色分母從 n! 變成 2⁻¹。 小問題:為何上標有 "-1"? 重點在於 n! = 1 ⋅ 2 ⋅ 3 ⋯ (n - 1) n 中,當 n! 變成 (n + 1)! 時,額外乘上的數字 n + 1 是隨 n 而增長,但 2 變成 2⁺¹ 時,額外乘上的數字永遠是 2,所以當 n「足夠大」(n > 3)時,n! > 2。 取倒數後不等式反轉,於是出現 1/n! < 1/2,然後就可以運用等比數列和公式,為 (1 + 1/n) 給出上限。

上面實驗發現 n 越大,(1 + 1/n) 也越大。即若 m < n,(1 + 1/m) < (1 + 1/n)。這種數列我們叫__嚴格遞增數列__。(「嚴格遞增」比「單調遞增」「嚴格」,只接受「>」,不接受「=」。) 練習:試證 (1 + 1/n) < (1 + 1/(n + 1))⁺¹ 提示:

  1. 如上面般展開 (1 + 1/n),分離最簡單兩項。
  2. 其餘 n - 1 項中,調整分子分母配對,先把 1 / k! 放在左邊。
@VincentTam
VincentTam / mse2192864.mkd
Last active October 4, 2023 18:31
My answer to a deleted question from WayneXMayersX on math.SE

Interpretation of exponentation and permutation

Question

I have $3^3$, can I call it a permutation/permutation with repetition?

As written in here:

@VincentTam
VincentTam / .gitlab-ci.yml
Last active August 26, 2020 11:58 — forked from florentchauveau/.gitlab-ci.yml
GitLab CI yaml file for building docker images
# This is a GitLab CI configuration to build the project as a docker image
# The file is generic enough to be dropped in a project containing a working Dockerfile
# Author: Florent CHAUVEAU <florent.chauveau@gmail.com>
# Mentioned here: https://blog.callr.tech/building-docker-images-with-gitlab-ci-best-practices/
# do not use "latest" here, if you want this to work in the future
image: docker:18
stages:
- build
@VincentTam
VincentTam / .vimrc
Last active April 24, 2020 07:23
My VIMRC for Vim on Ubuntu 14.04 LTS
" 131102: for vundle
" http://www.erikzaadi.com/2012/03/19/auto-installing-vundle-from-your-vimrc/
" Setting up Vundle - the vim plugin bundler
set nocompatible " be iMproved
filetype off " required!
let iCanHazVundle=1
let vundle_readme=expand("~/.vim/bundle/vundle/README.md")
if !filereadable(vundle_readme)
echo "Installing Vundle.."
echo ""
@VincentTam
VincentTam / mse2706068.jl
Created March 24, 2018 14:03
Sum of digits of p^2016 for some prime p
using Primes
plist = primes(1,10000)
sumdigits(n, base=10) = sum(digits(n, base))
for p in plist[1:100]
sdgit = sumdigits(big(p)^2016)
println("$(p), $(log(p)), $(sdgit)")
if sdgit == 2017
break
end
end
figure
title('A connected not path connected set')
hold on
% Plot set A
for i = 1:10
plot([0,1], [0,1/i], "linewidth", 2)
end
% Plot set B
plot([0.5,1],[0,0],'--', "linewidth",2)
Nvec = 10000:10000:1000000; % no of intervals
rrsumvec = zeros(size(Nvec));
for ind = 1:length(Nvec)
N = Nvec(ind);
dx = 5 / N;
x = (1:N) * dx;
fx = sqrt(25 - x.^2);
rrsum(ind) = sum(fx * dx);
end
@VincentTam
VincentTam / swap.py
Last active January 27, 2018 08:31
Echange "pythonique" de deux nombres
# input
a = int(input("Donner la valeur de a: "))
b = int(input("Donner la valeur de b: "))
# avant échange
print("a = ",a)
print("b = ",b)
# échange
a, b = b, a
@VincentTam
VincentTam / .vimrc
Last active April 5, 2017 09:04
My VIMRC for Vim in Git for Windows
" Vundle settings
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=$HOME/vimfiles/bundle/Vundle.vim
"call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
call vundle#begin('$HOME/vimfiles/bundle/')

My answer to a deleted question Interpretation of exponentation and permutation on math.SE

WayneXMayersX asked this question.

Question

I have $3^3$, can I call it a permutation/permutation with repetition?