\( \eta(s) = (1-2^{1-s}) \zeta(s) \)
general form, for \( p \in \mathbb{N} \)
\( \zeta(s) = \dfrac{1}{1^s} + \dfrac{1}{2^s} + \dfrac{1}{3^s} + ... \)
\( \dfrac{p}{p^s} \zeta(s) = \dfrac{p}{p^s} + \dfrac{p}{{(2p)}^s} + \dfrac{p}{{(3p)}^s} + ... \)
for \( p=3 \)
\( \zeta(s) - \dfrac{p}{p^s} \zeta(s) = \dfrac{1}{1^s} + \dfrac{1}{2^s} - \dfrac{2}{3^s} + \dfrac{1}{4^s} + \dfrac{1}{5^s} - \dfrac{2}{6^s}... = \rho(s)\)
\( (1 - p^{1-s}) \zeta(s) = \rho(s) \)
\( \zeta(s) = \dfrac{1}{1-p^{1-s}} \rho(s) \)
\( \rho(s,p) = (1 - p^{1-s}) \zeta(s) \)
\( \rho(s,q) = (1 - q^{1-s}) \zeta(s) \)
\( \rho(s,p) - \rho(s,q) = (q^{1-s} - p^{1-s}) \zeta(s) \)
for \( p=7, q=11 \)
\( \rho(s,7) - \rho(s,11) = - \dfrac{7}{7^s} + \dfrac{11}{11^s} - \dfrac{7}{14^s} - \dfrac{7}{21^s} + \dfrac{11}{22^s} - \dfrac{7}{28^s} + \dfrac{11}{33^s}... + \dfrac{4}{77^s}...\)
\( \rho(z,p) - \rho(z,q) = (q^{1-z} - p^{1-z}) \zeta(z) \)
and for \( s=1, p=3 \)
\( \rho(1,3) = \dfrac{1}{1} + \dfrac{1}{2} - \dfrac{2}{3} + \dfrac{1}{4} + \dfrac{1}{5} - \dfrac{2}{6}... = ln(3) \)
\( \rho(1,p) = ln(p) \)
3/05/2020
4/25/2019
所得稅法規定「中華民國境內居住之個人」之判定
update: 2025.03.20 基本所得額在750萬元以下者,可扣除750萬元,沒有繳納基本稅額之問題;基本所得額超過750萬元者,先扣除750萬元後,再就其餘額按20%稅率計算基本稅額。
基本稅額=(基本所得額-750萬) × 20%
3/13/2019
投資理財淺談
道理基本上 很簡單 就是 多賺錢 多存錢 不要亂花錢 你自然就會變有錢
一般來說 所謂的有錢 一種是看淨資產 另一種是看可用來做投資的淨資產 (自住的房子的價值要先扣掉)
一般小額花費的標準是 萬分之一的消費額度(每日) 不太需要考慮... 萬分之 365 約等於 3.65%... 所以以正常的投資報酬率 就能夠支付
所以有一百萬美金的可投資資產 就大約是一百元美金 約台幣三千元 以這種花錢速度 應該一輩子也花不完
另外 以投資的角度 如果能及早投資在適當的標的 以美國標普500 長期投報率約 6.6%(扣掉通膨) 而言 你從25歲工作40年 65歲退休 預期壽命為85歲
那你從工作開始 每月存台幣一萬元 你退休的時候 平均每月可以有 \(1.066^{40} + 1.066^{20} = 16.48\) 萬元可以花
如果你從一開始只存20年到45歲 後面都不存 每月也有 \(1.066^{40} = 12.89\) 萬元可以花
你存不了一萬 每月存個五千 退休也是有 6~8萬... 所以真的不難
如果你的父母有先見之明 從生下你就每月幫你存台幣一萬元 存20年... 每月就有 \(1.066^{65} = 63.71\)萬元... 存二千就夠了 每月也有12萬
懂得投資理財 比甚麼都重要
一般來說 所謂的有錢 一種是看淨資產 另一種是看可用來做投資的淨資產 (自住的房子的價值要先扣掉)
一般小額花費的標準是 萬分之一的消費額度(每日) 不太需要考慮... 萬分之 365 約等於 3.65%... 所以以正常的投資報酬率 就能夠支付
所以有一百萬美金的可投資資產 就大約是一百元美金 約台幣三千元 以這種花錢速度 應該一輩子也花不完
另外 以投資的角度 如果能及早投資在適當的標的 以美國標普500 長期投報率約 6.6%(扣掉通膨) 而言 你從25歲工作40年 65歲退休 預期壽命為85歲
那你從工作開始 每月存台幣一萬元 你退休的時候 平均每月可以有 \(1.066^{40} + 1.066^{20} = 16.48\) 萬元可以花
如果你從一開始只存20年到45歲 後面都不存 每月也有 \(1.066^{40} = 12.89\) 萬元可以花
你存不了一萬 每月存個五千 退休也是有 6~8萬... 所以真的不難
如果你的父母有先見之明 從生下你就每月幫你存台幣一萬元 存20年... 每月就有 \(1.066^{65} = 63.71\)萬元... 存二千就夠了 每月也有12萬
懂得投資理財 比甚麼都重要
2/27/2019
Leveraged Portfolio Simulation
Data: $SPY from 1-19-2007
Adjusted by daily closing prices
Starting capital is $10,000.
Neglecting dividends and the borrowing cost.
The blue line is the baseline.
Adjusted by daily closing prices
Starting capital is $10,000.
Neglecting dividends and the borrowing cost.
The blue line is the baseline.
1/22/2019
Ultra fund DIY - Constant Leverage Ratio
If we want to create a leveraged portfolio tracking an index, we need to know how to maintain a constant leverage ratio. The concept is pretty simple.
From the formula $\frac{\delta}{(1+\delta)}(L-1)$, we can also see that when $L>1$, it's similar to a trend following strategy. Because when the index goes up, we will increase our shares. When the index goes down, we will decrease our shares.
Say if we want to maintain a leverage ratio, $L = 2$. If the index $I$ moves $\delta$ percent. Our portfolio $\pi$ will move $2\delta$ percent.
Assuming the borrowing cost is zero. Our initial capital is $C$.
So at the beginning, our asset is $2C$ and our liability is $C$, the net is $2C-C=C$.
When the index moves $\delta$ percent, then
Asset: $2C*(1+\delta)$
Liability: $C$
Net: $C*(1+2\delta)$
Leverage Ratio: $(2+2\delta)/(1+2\delta) \neq 2$
The leverage ratio is changed due to the index has moved $\delta$ percent. So we have to adjust our shares to re-balance the leverage ratio to 2.
If our original shares is $S$, the new share price is $2C*(1+\delta)/S$.
Our new net value of the portfolio is $C*(1+2\delta)$, the new shares $T$ is
$T = 2C*(1+2\delta) / (2C*(1+\delta)/S) = (1+2\delta)/(1+\delta)*S = (1+\delta/(1+\delta))*S$
So the percentage of the adjustment is $\delta/(1+\delta)$, when the index moves $\delta$ percent.
If the leverage ratio is $L$, the adjustment is $\dfrac{\delta}{(1+\delta)}(L-1)$.
Let's do some simple calculation for $L=2$
If the index moves up or down 1~5%, the adjustment is listed in the following table.
If the index moves up or down 1~5%, the adjustment is listed in the following table.
| L=2 | 1% | 2% | 3% | 4% | 5% | |
| down | -1.01% | -2.04% | -3.09% | -4.17% | -5.26% | |
| up | 0.99% | 1.96% | 2.91% | 3.85% | 4.76% |
11/30/2017
Normalized Least Mean Square
$\vec{a}:\text{the unknown vector of the system parameters}$
$\vec{x}:\text{the vector of the input signal }$
$y:\text{the output signal }$
$y=\vec{a}\cdot\vec{x}$
$\vec{a}^{\prime}:\text{the vector of the prior estimated parameters}$
$\text{the estimated output}: y^{\prime}=\vec{a}^{\prime}\cdot\vec{x}$
$\text{error}:e=y-y^{\prime}$
$\vec{a}^*:\text{the vector of the posterior estimated parameters}$
$\text{assuming } y=\vec{a}^*\cdot\vec{x} \text{ and } \vec{a}^*=\vec{a}^{\prime}+\mu\vec{x}$
$e=(\vec{a}^{\prime}+\mu\vec{x})\cdot\vec{x} - \vec{a}^{\prime}\cdot\vec{x}$
$\vec{x}:\text{the vector of the input signal }$
$y:\text{the output signal }$
$y=\vec{a}\cdot\vec{x}$
$\text{the estimated output}: y^{\prime}=\vec{a}^{\prime}\cdot\vec{x}$
$\vec{a}^*:\text{the vector of the posterior estimated parameters}$
$\text{assuming } y=\vec{a}^*\cdot\vec{x} \text{ and } \vec{a}^*=\vec{a}^{\prime}+\mu\vec{x}$
$e=(\vec{a}^{\prime}+\mu\vec{x})\cdot\vec{x} - \vec{a}^{\prime}\cdot\vec{x}$
$e=\mu\vec{x}\cdot\vec{x}=\mu{\lVert\vec{x}\rVert}^2$
$\mu=\dfrac{e}{{\lVert\vec{x}\rVert}^2}$
$\vec{a}^*=\vec{a}^{\prime}+\dfrac{e}{{\lVert\vec{x}\rVert}^2}\vec{x}$
6/22/2017
Technology and Business Skills
$Result = {Technology} ^ {Business Skills}$
| Technology | Business Skills | Result |
|---|---|---|
0
|
*
|
0
|
1
|
0
|
1
|
1
|
1
|
1
|
1
|
2
|
1
|
2
|
0
|
1
|
2
|
1
|
2
|
2
|
2
|
4
|
2
|
3
|
8
|
4/28/2017
Estimation - Kalman Filter II
From the point of view of the measurement, we can make a prediction of the measurement ${\textbf{z}_1}'$ from ${\textbf{x}_1}'$, and we can get $({\textbf{z}_1}', \textbf{H}_1{\textbf{P}_1}'\textbf{H}_1^T)$.
The measurement is $(\textbf{z}_1, \textbf{R}_1)$, the estimate is
$\textbf{z}_1^* = (\textbf{I}-\textbf{G}_1){\textbf{z}_1}'+\textbf{G}_1\textbf{z}_1$
a good estimate comes with
$\textbf{G}_1=\textbf{H}_1{\textbf{P}_1}'\textbf{H}_1^T(\textbf{H}_1{\textbf{P}_1}'\textbf{H}_1^T+\textbf{R}_1)^{-1} = \textbf{H}_1\textbf{K}_1$
$\textbf{z}_1^* = (\textbf{I}-\textbf{H}_1\textbf{K}_1)\textbf{H}_1{\textbf{x}_1}'+\textbf{H}_1\textbf{K}_1\textbf{z}_1$
$ = \textbf{H}_1(\textbf{I}-\textbf{K}_1\textbf{H}_1){\textbf{x}_1}'+\textbf{H}_1\textbf{K}_1\textbf{z}_1$
The measurement is $(\textbf{z}_1, \textbf{R}_1)$, the estimate is
$\textbf{z}_1^* = (\textbf{I}-\textbf{G}_1){\textbf{z}_1}'+\textbf{G}_1\textbf{z}_1$
a good estimate comes with
$\textbf{G}_1=\textbf{H}_1{\textbf{P}_1}'\textbf{H}_1^T(\textbf{H}_1{\textbf{P}_1}'\textbf{H}_1^T+\textbf{R}_1)^{-1} = \textbf{H}_1\textbf{K}_1$
$\textbf{z}_1^* = (\textbf{I}-\textbf{H}_1\textbf{K}_1)\textbf{H}_1{\textbf{x}_1}'+\textbf{H}_1\textbf{K}_1\textbf{z}_1$
$ = \textbf{H}_1(\textbf{I}-\textbf{K}_1\textbf{H}_1){\textbf{x}_1}'+\textbf{H}_1\textbf{K}_1\textbf{z}_1$
$\textbf{H}_1\textbf{x}_1^* = \textbf{H}_1(\textbf{I}-\textbf{K}_1\textbf{H}_1){\textbf{x}_1}'+\textbf{H}_1\textbf{K}_1\textbf{z}_1$
so $\textbf{K}_1$ can give a good estimate for $\textbf{z}_1^*$, it seems also imply that
$(\textbf{I}-\textbf{K}_1\textbf{H}_1){\textbf{x}_1}'+\textbf{K}_1\textbf{z}_1$ can give a good estimate for $\textbf{x}_1^*$.
Labels:
estimation
,
Kalman Filter
,
measurement
,
sensor fusion
Estimation - Probability Distribution
Here is the chart of the probability distribution of a 1D example on the (prediction, measurement, estimate) for the normal distribution case.
As we can see, both the measurement and the prediction are unbiased, but have different probability distributions. By adjusting the weight, we can find a better unbiased estimation.
4/27/2017
Estimation - Kalman Filter
Some ideas about the Kalman filter.
Say we have a dynamic system that has the internal state $\textbf{x}$ and the control input $\textbf{u}$. Although we don't know the internal state $\textbf{x}$, we can observe it and have the measurement $\textbf{z}$.
Then how can we estimate the internal state $\textbf{x}$?
At first, we may have an initial estimated state and the covariance $(\textbf{x}_0^*, \textbf{P}_0^*)$. So we use this to make a prediction based on the dynamics of the system, then we get $({\textbf{x}_1}', {\textbf{P}_1}')$.
At the time $t_1$, we also do a measurement and get $(\textbf{z}_1, \textbf{R}_1)$.
So we use the prediction and the measurement to have an estimation of the internal state at time $t_1$, which is $({\textbf{x}_1^*}, {\textbf{P}_1^*})$.
From the previous examples, we know that finding the weight to make an unbiased estimation is the key such that we can have a minimum of the covariance or variance of the estimation.
The Kalman gain $\textbf{K}$ in the Kalman filter invented by Rudolf E. Kalman can give us a good estimation of the internal state $\textbf{x}$ for a linear system.
We can image $\textbf{K}_1$ is a function of ${\textbf{P}_1}'$ and $\textbf{R}_1$.
By following the wiki:Kalman filter's naming convention,
$\textbf{K}_1={\textbf{P}_1}'\textbf{H}_1^T(\textbf{H}_1{\textbf{P}_1}'\textbf{H}_1^T+\textbf{R}_1)^{-1}$
Such that the $({\textbf{x}_1^*}, {\textbf{P}_1^*})$ is
$\textbf{x}_1^*=(\textbf{I}-\textbf{K}_1\textbf{H}_1){\textbf{x}_1}'+\textbf{K}_1\textbf{z}_1$
$\textbf{P}_1^*=(\textbf{I}-\textbf{K}_1\textbf{H}_1){\textbf{P}_1}'$
So for the estimation of the internal state $\textbf{x}$ at the time $t$:
1. use $({\textbf{x}_{t-1}^*}, {\textbf{P}_{t-1}^*})$ to get a prediction $({\textbf{x}_t}', {\textbf{P}_t}')$.
2. take a measurement at the time $t$ and get $(\textbf{z}_t, \textbf{R}_t)$.
3. calculate $\textbf{K}_t$
4. use $\textbf{K}_t$ to get $({\textbf{x}_t^*}, {\textbf{P}_t^*})$.
The following diagram shows a simple flow chart of the process.
Say we have a dynamic system that has the internal state $\textbf{x}$ and the control input $\textbf{u}$. Although we don't know the internal state $\textbf{x}$, we can observe it and have the measurement $\textbf{z}$.
Then how can we estimate the internal state $\textbf{x}$?
At first, we may have an initial estimated state and the covariance $(\textbf{x}_0^*, \textbf{P}_0^*)$. So we use this to make a prediction based on the dynamics of the system, then we get $({\textbf{x}_1}', {\textbf{P}_1}')$.
At the time $t_1$, we also do a measurement and get $(\textbf{z}_1, \textbf{R}_1)$.
So we use the prediction and the measurement to have an estimation of the internal state at time $t_1$, which is $({\textbf{x}_1^*}, {\textbf{P}_1^*})$.
From the previous examples, we know that finding the weight to make an unbiased estimation is the key such that we can have a minimum of the covariance or variance of the estimation.
The Kalman gain $\textbf{K}$ in the Kalman filter invented by Rudolf E. Kalman can give us a good estimation of the internal state $\textbf{x}$ for a linear system.
We can image $\textbf{K}_1$ is a function of ${\textbf{P}_1}'$ and $\textbf{R}_1$.
By following the wiki:Kalman filter's naming convention,
$\textbf{K}_1={\textbf{P}_1}'\textbf{H}_1^T(\textbf{H}_1{\textbf{P}_1}'\textbf{H}_1^T+\textbf{R}_1)^{-1}$
Such that the $({\textbf{x}_1^*}, {\textbf{P}_1^*})$ is
$\textbf{x}_1^*=(\textbf{I}-\textbf{K}_1\textbf{H}_1){\textbf{x}_1}'+\textbf{K}_1\textbf{z}_1$
$\textbf{P}_1^*=(\textbf{I}-\textbf{K}_1\textbf{H}_1){\textbf{P}_1}'$
So for the estimation of the internal state $\textbf{x}$ at the time $t$:
1. use $({\textbf{x}_{t-1}^*}, {\textbf{P}_{t-1}^*})$ to get a prediction $({\textbf{x}_t}', {\textbf{P}_t}')$.
2. take a measurement at the time $t$ and get $(\textbf{z}_t, \textbf{R}_t)$.
3. calculate $\textbf{K}_t$
4. use $\textbf{K}_t$ to get $({\textbf{x}_t^*}, {\textbf{P}_t^*})$.
The following diagram shows a simple flow chart of the process.
4/26/2017
Estimation - Data Fusion
From the previous example, we know if we want to merge two data, we also need the standard deviation or variance of the data in order to make a better estimation. By following the tradition, we will use variance for the following derivations.
Say the data fusion process is defined as: $d_f = \mathcal{F}(d_1,d_2)$, $d_i = (x_i,\sigma_i^2)$
To have a good estimate means to have an unbiased $x_f$ with minimizing the $\sigma_f^2$ at the same time.
Say $x_f = \alpha_1x_1+\alpha_2x_2$, and $\alpha_1+\alpha_2=1$
Then $\sigma_f^2 = \alpha_1^2\sigma_1^2+\alpha_2^2\sigma_2^2+2\alpha_1\alpha_2\mathcal{C}(d_1,d_2)$, $\mathcal{C}(d_1,d_2)$ is the covariance of the data.
If both data are uncorrelated, $\sigma_f^2 = \alpha_1^2\sigma_1^2+\alpha_2^2\sigma_2^2$
With the uncorrelated case, let $\alpha_2=1-\alpha_1$, and
$ \frac{\partial}{\partial \alpha_1} \sigma_f^2 = 2\alpha_1\sigma_1^2+(2\alpha_1-2)\sigma_2^2=0$
then $\alpha_1 = \sigma_2^2/(\sigma_1^2+\sigma_2^2) $, $\alpha_2 = \sigma_1^2/(\sigma_1^2+\sigma_2^2) $
Say the data fusion process is defined as: $d_f = \mathcal{F}(d_1,d_2)$, $d_i = (x_i,\sigma_i^2)$
To have a good estimate means to have an unbiased $x_f$ with minimizing the $\sigma_f^2$ at the same time.
Say $x_f = \alpha_1x_1+\alpha_2x_2$, and $\alpha_1+\alpha_2=1$
Then $\sigma_f^2 = \alpha_1^2\sigma_1^2+\alpha_2^2\sigma_2^2+2\alpha_1\alpha_2\mathcal{C}(d_1,d_2)$, $\mathcal{C}(d_1,d_2)$ is the covariance of the data.
If both data are uncorrelated, $\sigma_f^2 = \alpha_1^2\sigma_1^2+\alpha_2^2\sigma_2^2$
With the uncorrelated case, let $\alpha_2=1-\alpha_1$, and
$ \frac{\partial}{\partial \alpha_1} \sigma_f^2 = 2\alpha_1\sigma_1^2+(2\alpha_1-2)\sigma_2^2=0$
then $\alpha_1 = \sigma_2^2/(\sigma_1^2+\sigma_2^2) $, $\alpha_2 = \sigma_1^2/(\sigma_1^2+\sigma_2^2) $
4/25/2017
Estimation - Measurement
Let's say we want to measure the resistance of a resistor with an ohmmeter. The measured value is $z$ with a standard deviation $\sigma$. Assuming the resistance is $x$.
The measurement is like $z=x+v$ and $v$ is the measurement noise with mean $0$ and standard deviation $\sigma$.
If we only take one measurement, we get an estimation $z_1$ for the $x$. The standard deviation of the error is $\sigma$.
If we take two measurements, we get $z_1,z_2$. We can use $(z_1+z_2)/2$ as the estimation for the $x$. Then what's the standard deviation of the error?
If two measurements are independent and uncorrelated, the standard deviation would be $\sqrt{1/2}\sigma$.
Then how about we use different weights, say $(z_1+2*z_2)/3$. Then what's the standard deviation of the error in this case? It would be $\sqrt{5/9}\sigma$, and it's greater than $\sqrt{1/2}\sigma$.
We can prove that the weight $(1/2,1/2)$ can give the minimum standard deviation of the error.
Now say we have already make two measurements and get the estimate $(z_1+z_2)/2$.
We want to do another measurement and get $z_3$. Then how are we going to merge the data?
We know the previous two measurement give us the data $((z_1+z_2)/2,\sqrt{1/2}\sigma)$ and the new information is $(z_3,\sigma)$. If we want to merge these two data and minimize the standard deviation of the error, the weight would be $2/3$ for the first data and $1/3$ for the new data.
The result would be like $((z_1+z_2+z_3)/3,\sqrt{1/3}\sigma)$.
As we can see for estimation, the information of the standard deviation of the error of the previous estimate is quite useful in this case. Of course, in this simple example, we can also keep the number of measurements and find the new weights used in the new estimation.
The measurement is like $z=x+v$ and $v$ is the measurement noise with mean $0$ and standard deviation $\sigma$.
If we only take one measurement, we get an estimation $z_1$ for the $x$. The standard deviation of the error is $\sigma$.
If we take two measurements, we get $z_1,z_2$. We can use $(z_1+z_2)/2$ as the estimation for the $x$. Then what's the standard deviation of the error?
If two measurements are independent and uncorrelated, the standard deviation would be $\sqrt{1/2}\sigma$.
Then how about we use different weights, say $(z_1+2*z_2)/3$. Then what's the standard deviation of the error in this case? It would be $\sqrt{5/9}\sigma$, and it's greater than $\sqrt{1/2}\sigma$.
We can prove that the weight $(1/2,1/2)$ can give the minimum standard deviation of the error.
Now say we have already make two measurements and get the estimate $(z_1+z_2)/2$.
We want to do another measurement and get $z_3$. Then how are we going to merge the data?
We know the previous two measurement give us the data $((z_1+z_2)/2,\sqrt{1/2}\sigma)$ and the new information is $(z_3,\sigma)$. If we want to merge these two data and minimize the standard deviation of the error, the weight would be $2/3$ for the first data and $1/3$ for the new data.
The result would be like $((z_1+z_2+z_3)/3,\sqrt{1/3}\sigma)$.
As we can see for estimation, the information of the standard deviation of the error of the previous estimate is quite useful in this case. Of course, in this simple example, we can also keep the number of measurements and find the new weights used in the new estimation.
4/06/2017
如何準備 TOEFL GRE (聽力與閱讀能力)
聽力
在初期 建議可以上美國的購物網站 找有直播的練習聽力 例如 QVC 因為這些英語都算標準 而且一直重複一個話題
進步到一定的程度以後 就可以試試新聞 CNN 財經網站 Bloomberg 或其他 教育性的節目 Discovery
當然最後如果能看得懂 電視節目 電影 那就算相當不錯了
閱讀能力
可以找本介紹速讀的書 看看如何增加閱讀的速度
基本的原理 就是 眼球的控制 一開始可以拿一把尺練習 用尺幫助一行一行的閱讀 遮住下方的英文字
閱讀時 眼球由左到右 可以一次讀三到四個英文字 然後 按照節奏 讀完一行 閱讀時 避免眼球左右來回移動
如果可以的話 盡量避免默讀 一般而言 默讀會減緩閱讀的速度
在初期 建議可以上美國的購物網站 找有直播的練習聽力 例如 QVC 因為這些英語都算標準 而且一直重複一個話題
進步到一定的程度以後 就可以試試新聞 CNN 財經網站 Bloomberg 或其他 教育性的節目 Discovery
當然最後如果能看得懂 電視節目 電影 那就算相當不錯了
閱讀能力
可以找本介紹速讀的書 看看如何增加閱讀的速度
基本的原理 就是 眼球的控制 一開始可以拿一把尺練習 用尺幫助一行一行的閱讀 遮住下方的英文字
閱讀時 眼球由左到右 可以一次讀三到四個英文字 然後 按照節奏 讀完一行 閱讀時 避免眼球左右來回移動
如果可以的話 盡量避免默讀 一般而言 默讀會減緩閱讀的速度
7/20/2016
a Simple Weight Loss Program - Calorie Counting Game
basic concept: Nutrition and Calorie Controlled Diet with Fitness Exercises.
------------------------------------------------------------
To lose your weight is just a calorie counting game. If you take in 2000 Cals and spend 2100 Cals a day, you lose your weight. 100 Cals a day may help you lose 11~25 grams a day. It seems not much, but think about it, 10 grams a day is 3.65 kgs or 8 lbs a year.
So if you gain 10 grams a day, you are going to gain 3.65 kgs or 8 lbs a year.
And trying to do exercise to lose your weight is really not easy.
A 180 lbs (81.6 kgs) person walking 1.5 miles(2.4 kms) in 30 minutes consumes about 160 Cals. A 12oz (340g) coke is about 140 Cals, so it makes your exercise 87.5% less efficient.
------------------------------------------------------------
Here is the steps of a simple weight loss program:
1. know your daily basic calorie requirement and cut it down by 100~400 Cals.
2. know the nutrition and the calorie of the foods
3. create a daily diet plan based on the daily required nutrition and calories.
4. do simple fitness exercises daily to strengthen your muscles.
5. take a 30 minutes of walk per day, a couple of swimming per week, or any kind of outdoor exercises which you prefer every week.
------------------------------------------------------------
To lose your weight is just a calorie counting game. If you take in 2000 Cals and spend 2100 Cals a day, you lose your weight. 100 Cals a day may help you lose 11~25 grams a day. It seems not much, but think about it, 10 grams a day is 3.65 kgs or 8 lbs a year.
So if you gain 10 grams a day, you are going to gain 3.65 kgs or 8 lbs a year.
And trying to do exercise to lose your weight is really not easy.
A 180 lbs (81.6 kgs) person walking 1.5 miles(2.4 kms) in 30 minutes consumes about 160 Cals. A 12oz (340g) coke is about 140 Cals, so it makes your exercise 87.5% less efficient.
------------------------------------------------------------
Here is the steps of a simple weight loss program:
1. know your daily basic calorie requirement and cut it down by 100~400 Cals.
2. know the nutrition and the calorie of the foods
3. create a daily diet plan based on the daily required nutrition and calories.
4. do simple fitness exercises daily to strengthen your muscles.
5. take a 30 minutes of walk per day, a couple of swimming per week, or any kind of outdoor exercises which you prefer every week.
------------------------------------------------------------
An example,
My daily basic calorie requirement is about 2000 Cals per day.
My food intake (Cals):
Barilla Linguine: 309 * 2 meals
Tomato Sauce: 62 * 2 meals
Ground Sesame(5g): 30 * 2 meals
Egg(50g): 70
Low fat Yogurt: 300
Low fat Yogurt: 300
Apple(200g): 104
Banana(120g): 108
Cereal(1 serving): 230, choose those with high dietary fiber and Vitamin B12.
Veggies...
Extras: 200 (soft drinks, beers, cookies... not very often)
The total calories is about 1614(base) + 200(extra) Cals.
My exercises:
Stretches...
Sit-ups everyday.
Push-ups everyday.
Chin-ups about twice per week at the park.
Jogging or swimming about twice a week.
The result:
As you can see my basic required calories is 2000 Cals per day, my food intake is only about 1600~1800 Cals. Even without exercise, the net calories is -200 ~ -400 Cals/day. So with some mild exercises, I easily cut my weight about 2.5 kgs in a month from 74.5 to 72 kgs...
-----------------------------------------------------
4/23/2016
Making the Money - the Arbitrageur
Sometimes people want to make money on the trade, but not bring the seller and the buyer together, because the discrepancy of the price between those two parties. Those people who make money on the price inefficiencies are arbitrageurs. They can make almost risk-free profits if they handle those trades correctly.
So what arbitrageurs want is not a well-developed market. In a more general form, the arbitrageur can profit from information inefficiencies. Information could be anything, such as price information and technology information.
So if you know how to make things better or faster with the same amount of money, or make the same product with less money or in a more efficient way. You can make money on it.
Another important thing about arbitrage is keeping the information secretive. Because you don't want to have too many competitors. Competition usually will make your profit lower.
So what arbitrageurs want is not a well-developed market. In a more general form, the arbitrageur can profit from information inefficiencies. Information could be anything, such as price information and technology information.
So if you know how to make things better or faster with the same amount of money, or make the same product with less money or in a more efficient way. You can make money on it.
Another important thing about arbitrage is keeping the information secretive. Because you don't want to have too many competitors. Competition usually will make your profit lower.
Making the Money - the Platform
Another way to bring the sellers and the buyers together is by building a platform, such that the sellers can list their products there and also disclose the preferred selling/retail price on the products. At the same time the buyers can see what the sellers offer, or even bid up the price of the product if the supply is limited.
Usually the platform will charge a certain amount of money on its services, such as referral fees, listing fees, storage fees, or fulfillment fees. It depends on what kind of services they provide or what services are used.
Platforms can be physical stores, virtual Web services, or mixed.
Usually the platform will charge a certain amount of money on its services, such as referral fees, listing fees, storage fees, or fulfillment fees. It depends on what kind of services they provide or what services are used.
Platforms can be physical stores, virtual Web services, or mixed.
Making the Money - the Broker
A business or a trade has at least two roles, the seller and the buyer. Of course, usually the seller who has the goods wants to trade it for money. The buyer would pay the money and want to get the goods in return.
Sometimes the seller doesn't have a good network to know who want to buy his product, or does not know if there is any potential to get a better price with his product.
The buyer would like to get a good product with his money at a better price if possible.
So another role, the broker, is coming to this game. The broker charges a certain amount of fee to help making the trade. Because the broker only makes money after the trade is made successfully. So sometimes, the broker would recommends the seller to lower the price and the buyer to pay more to facilitate the trades... Well, if the seller and the buyer are OK with it, that is absolutely fine.
Sometimes the broker will also help the seller to get more return by raising the price if the broker knows people are willing to pay more to compete for it. At the same time, the broker can make more commissions on the trade.
On the other hand, if the broker knows the market is slow, the broker will recommend the seller to lower the price to get more buyers on the market. Although the broker gets less commission, it's better than nothing.
Usually the main purpose of the broker is to facilitate the trade, they don't hold inventories for the products. Those people who hold inventories for the products are more like re-sellers, retailers, or distributors.
Sometimes the seller doesn't have a good network to know who want to buy his product, or does not know if there is any potential to get a better price with his product.
The buyer would like to get a good product with his money at a better price if possible.
So another role, the broker, is coming to this game. The broker charges a certain amount of fee to help making the trade. Because the broker only makes money after the trade is made successfully. So sometimes, the broker would recommends the seller to lower the price and the buyer to pay more to facilitate the trades... Well, if the seller and the buyer are OK with it, that is absolutely fine.
Sometimes the broker will also help the seller to get more return by raising the price if the broker knows people are willing to pay more to compete for it. At the same time, the broker can make more commissions on the trade.
On the other hand, if the broker knows the market is slow, the broker will recommend the seller to lower the price to get more buyers on the market. Although the broker gets less commission, it's better than nothing.
Usually the main purpose of the broker is to facilitate the trade, they don't hold inventories for the products. Those people who hold inventories for the products are more like re-sellers, retailers, or distributors.
Making the Money - the Business power of Technology
I was trained as an engineer, so basically my mindset is more like learning new technologies to get employed and well-paid by a good company. I am good at problem solving and also reading technical references and datasheets. But I didn't have much sense on making money until I started my career at a software company.
After I got some stock options from the company, I started researching how the options work, how to trade it. Later on, I joined a startup with my friends (college-mates). I got more involved with business related stuffs. I knew better about the difficulties on selling new technologies to people.
I am putting some of the experiences I learned starting with this article...
The money making business is built on a basic model,
Money = Technology ^ Business,
so called the Business power of Technology.
If the Technology is zero, the Business is x, the Money is zero. In this example, the return 0 < 0+x.
If the Technology is one, Business is zero, the Money is one(not a big difference from zero, unless you feel good about it). In this example, the return 1 = 1+0.
If the Technology is one, Business is two, the Money is still one. In this example, the return 1 < 1+2.
"Technology is one" means the technology is about normal, not special, Most people know how to do it and can make it.
If the Technology is two, Business is zero, the Money is one. If you don't know how to sell a product, you almost get nothing in return. In this example, the return 1 < 2+0.
If the Technology is two, Business is one, the Money is two. Two is better than one, but you don't get a good leverage on your hard-working technology. In this example, the return 2 < 2+1.
If the Technology is 2, Business is 2, the Money is 4. This is a lot better than previous examples, although 4=2+2. But you get more potential, and you are on the way to make more money.
If the Technology is 2, Business is 3, the Money is 8. This makes some differences,because 2+3=5 and you get the return of 8.
So a money making business is more like a good join of engineers and businessmen. To make the join, there might be more roles got involved, such as, venture capitalists, angle investors, and accredited investors.
After I got some stock options from the company, I started researching how the options work, how to trade it. Later on, I joined a startup with my friends (college-mates). I got more involved with business related stuffs. I knew better about the difficulties on selling new technologies to people.
I am putting some of the experiences I learned starting with this article...
The money making business is built on a basic model,
Money = Technology ^ Business,
so called the Business power of Technology.
If the Technology is zero, the Business is x, the Money is zero. In this example, the return 0 < 0+x.
If the Technology is one, Business is zero, the Money is one(not a big difference from zero, unless you feel good about it). In this example, the return 1 = 1+0.
If the Technology is one, Business is two, the Money is still one. In this example, the return 1 < 1+2.
"Technology is one" means the technology is about normal, not special, Most people know how to do it and can make it.
If the Technology is two, Business is zero, the Money is one. If you don't know how to sell a product, you almost get nothing in return. In this example, the return 1 < 2+0.
If the Technology is two, Business is one, the Money is two. Two is better than one, but you don't get a good leverage on your hard-working technology. In this example, the return 2 < 2+1.
If the Technology is 2, Business is 2, the Money is 4. This is a lot better than previous examples, although 4=2+2. But you get more potential, and you are on the way to make more money.
So a money making business is more like a good join of engineers and businessmen. To make the join, there might be more roles got involved, such as, venture capitalists, angle investors, and accredited investors.
3/02/2015
Texas Hold'em Poker Probability - Pocket Pair vs. 2 Overcards(suited, connected) cont.
So how large is q, q is the winning rate when there is no 7, but any TJ combinations for the 5 cards on the table.
Let's check the possible 5 card combinations: (assuming pocket pair is 7s7c, player X has TdJd)
Case 1. You make a flush, the combination of the 5 card is
a. five spade (including Ts or Js or both): C(11,4)+C(11,4)-C(10,3)=540
less five spade (including Ts or Js or both, and all higher than 7): C(6,4)+C(6,4)-C(5,3)=20... tie
five spade (8s9sTsJsKs, 8s9sTsJsAs): 2... you get straight flush
b. four spade (including Ts or Js or both) with X, X is not in (7,T,J):
(C(10,3)+C(10,3))*(52-4*3-10)+C(10,2)*(52-4*3-10)= 8,550
four spade (with only Ts) with Tc/Th/Jc/Jh: C(10,3)*4= 480
four spade (with only Js) with Tc/Th/Jc/Jh: C(10,3)*4= 480
four spade (without Ts,Js) with Tc/Th/Jc/Jh: C(10,4)*4=840
c. five club: same as 1.a: 540-20+2=522
d. four club: same as 1.b: 8550+480+480+840=10,350
The sum is 21,762, the probability is about 1.27%.
Case 2. You make a straight, the card is
a. 3456T, 3456J: 4*4*4*4*3+4*4*4*4*3=1,536
straight flush: 3s4s5s6sT, 3s4s5s6sJ, 3c4c5c6cT, 3c4c5c6cJ: 3*4=12
b. 4568T, 4568J: 4*4*4*4*3+4*4*4*4*3=1,536
straight flush: 4s5s6s8sT, 4s5s6s8sJ, 4c5c6c8cT, 4c5c6c8cJ: 3*4=12
c. 5689T, 5689J: 4*4*4*4*3+4*4*4*4*3=1,536
straight flush: 5s6s8s9sT, 5s6s8s9sJ, 5c6c8c9cT, 5c6c8c9cJ: 3*4=12
d. 689Tx, x is not in (Q,5,6,7,8,9,T): 4*4*4*3*(52-4*7-1)=4,416
straight flush: 6s8s9sTsx,6c8c9cTcx: (52-4*7-1)*2=46
689T6, 6*4*4*3=288
straight flush: 6s8s9sTs6,6c8c9cTc6: 3+3=6
689T8, 4*6*4*3=288
straight flush: 6s8s9sTs8,6c8c9cTc8: 3+3=6
689TT, 4*4*4*3=192
straight flush: 6s8s9sTsT, 6c8c9cTcT: 2+2=4
e. 89TJx, x is not in (6,7,8,9,T,J,Q): 4*4*3*3*(52-4*7)=3,456
straight flush: 8s9sTsJsX, 8c9cTcJcX: (52-4*7)*2=48
89TJ8, 6*4*3*3=216
straight flush: 8s9sTsJs8, 8c9cTcJc8: 3+3=6
89TJ9, 4*6*3*3=216
89TJJ, player X gets a full house.
Let's check the possible 5 card combinations: (assuming pocket pair is 7s7c, player X has TdJd)
Case 1. You make a flush, the combination of the 5 card is
a. five spade (including Ts or Js or both): C(11,4)+C(11,4)-C(10,3)=540
less five spade (including Ts or Js or both, and all higher than 7): C(6,4)+C(6,4)-C(5,3)=20... tie
five spade (8s9sTsJsKs, 8s9sTsJsAs): 2... you get straight flush
b. four spade (including Ts or Js or both) with X, X is not in (7,T,J):
(C(10,3)+C(10,3))*(52-4*3-10)+C(10,2)*(52-4*3-10)= 8,550
four spade (with only Ts) with Tc/Th/Jc/Jh: C(10,3)*4= 480
four spade (with only Js) with Tc/Th/Jc/Jh: C(10,3)*4= 480
four spade (without Ts,Js) with Tc/Th/Jc/Jh: C(10,4)*4=840
c. five club: same as 1.a: 540-20+2=522
d. four club: same as 1.b: 8550+480+480+840=10,350
The sum is 21,762, the probability is about 1.27%.
Case 2. You make a straight, the card is
a. 3456T, 3456J: 4*4*4*4*3+4*4*4*4*3=1,536
straight flush: 3s4s5s6sT, 3s4s5s6sJ, 3c4c5c6cT, 3c4c5c6cJ: 3*4=12
b. 4568T, 4568J: 4*4*4*4*3+4*4*4*4*3=1,536
straight flush: 4s5s6s8sT, 4s5s6s8sJ, 4c5c6c8cT, 4c5c6c8cJ: 3*4=12
straight flush: 5s6s8s9sT, 5s6s8s9sJ, 5c6c8c9cT, 5c6c8c9cJ: 3*4=12
straight flush: 6s8s9sTsx,6c8c9cTcx: (52-4*7-1)*2=46
689T6, 6*4*4*3=288
straight flush: 6s8s9sTs6,6c8c9cTc6: 3+3=6
689T8, 4*6*4*3=288
straight flush: 6s8s9sTs8,6c8c9cTc8: 3+3=6
689TT, 4*4*4*3=192
straight flush: 6s8s9sTsT, 6c8c9cTcT: 2+2=4
e. 89TJx, x is not in (6,7,8,9,T,J,Q): 4*4*3*3*(52-4*7)=3,456
straight flush: 8s9sTsJsX, 8c9cTcJcX: (52-4*7)*2=48
89TJ8, 6*4*3*3=216
straight flush: 8s9sTsJs8, 8c9cTcJc8: 3+3=6
89TJ9, 4*6*3*3=216
straight flush: 8s9sTsJs9, 8c9cTcJc9: 3+3=6
89TJT, player X gets a full house.
straight flush: 8s9sTsJsT, 8c9cTcJcT: 2+2=4
straight flush: 8s9sTsJsJ, 8c9cTcJcJ: 2+2=4
The sum is 13,680, the probability is about 0.8%
Combine the result of case 1 and case 2, the value of q is around 2%.
Texas Hold'em Poker Probability - Pocket Pair vs. 2 Overcards(suited, connected)
With continuing our previous discussion, say if you have pocket pair 77(no diamond), the other player X has TJ (suited-diamond). Let's check the probability of player X getting a diamond flush.
The remaining 5 cards has:
1. 3 diamond cards: C(11,3)*C(37,2)=109,890
straight-flush: 4*C(37,2)=2,664
a) 789TJ to TJQKA: 4
2. 4 diamond cards: C(11,4)*C(37,1)=12,210
straight-flush: (7+7+7+8)*C(37,1)=1,073
a) 789TJy, y is not Q: C(7,1)= 7
b) 89TJQy, y is not K: C(7,1)= 7
c) 9TJQKy, y is not A: C(7,1)= 7
d) TJQKAy: C(8,1)= 8
3. 5 diamond cards: C(11,5)=462
straight-flush: 4+21+21+21+28=95
a) A2345TJ to 45678TJ: 4
b) 789TJyz, yz is not Q: C(7,2)= 21
c) 89TJQyz, yz is not K: C(7,2)= 21
d) 9TJQKyz, yz is not A: C(7,2)= 21
e) TJQKAyz: C(8,2)= 28
The probability of flush is about 7.16%, without straight-flush is 6.93%
If we roughly discount the previous winning rate against TJ(unsuited) by 7%, the probability of winning is about 48%.
=====================
Another approach...
The remaining 5 cards has:
1. 3 diamond cards:
a. no 7,T,J: C(10,3)*C(30,2)=52,200
b. with a 7 but no TJ:
7 is diamond: C(10,2)*C(30,2)=19,575
7 is not diamond: C(10,3)*C(30,1)=3,600
c. with a 7 only one T/J:
7 is diamond: C(10,2)*6*C(30,1)=8,100
7 is not diamond: C(10,3)*6=720
straight-flush: 1305+435+90+180+18=2028
a. no 7,T,J: 89Q,9QK,QKA: 3*C(30,2)=1,305
b. with a 7 but no TJ:
7 is diamond: 789: 1*C(30,2)=435
7 is not diamond: 89Q,9QK,QKA: 3*C(30,1)=90
c. with a 7 only one T/J:
7 is diamond: 789: 1*6*C(30,1)=180
7 is not diamond: 89Q,9QK,QKA: 3*6=18
2. 4 diamond cards:
a. no 7,T,J: C(10,4)*C(30,1)=6,300
b. with a 7 but no TJ:
7 is diamond: C(10,3)*C(30,1)=3,600
7 is not diamond: C(10,4)=210
c. with a 7 only one T/J:
7 is diamond: C(10,3)*6=720
straight-flush:
a. no 7,T,J: (6+6+7)*C(30,1)= 570
i) 89TJQy, y is not 7,K: C(6,1)= 6
ii) 9TJQKy, y is not 7,A: C(6,1)= 6
iii) TJQKAy, y is not 7: C(7,1)= 7
b. with a 7 but no TJ:
7 is diamond: (7+1+1+1)*30=300
i) 789TJy, y is not Q: C(7,1)= 7
ii) 89TJQy, y is not K, y is 7: 1
iii) 9TJQKy, y is not A, y is 7: 1
iv) TJQKAy, y is 7: 1
7 is not diamond: (6+6+7)*30=570
i) 89TJQy, y is not 7,K: C(6,1)= 6
ii) 9TJQKy, y is not 7,A: C(6,1)= 6
iii) TJQKAy, y is not 7: C(7,1)= 7
c. with a 7 only one T/J:
7 is diamond: (7+1+1+1)*6=60
i) 789TJy, y is not Q: C(7,1)= 7
ii) 89TJQy, y is not K, y is 7: 1
iii) 9TJQKy, y is not A, y is 7: 1
iv) TJQKAy, y is 7: 1
3. 5 diamond cards:
a. no 7,T,J: C(10,5)=252
b. with a 7 but no TJ:
7 is diamond: C(10,4)=210
straight-flush: 95
The total is 95,487(flush) less 3623(straight flush), the probability is 5.36%. The winning rate is 51.73%-5.36%+q=46.37%+q.
The remaining 5 cards has:
1. 3 diamond cards: C(11,3)*C(37,2)=109,890
straight-flush: 4*C(37,2)=2,664
a) 789TJ to TJQKA: 4
2. 4 diamond cards: C(11,4)*C(37,1)=12,210
straight-flush: (7+7+7+8)*C(37,1)=1,073
a) 789TJy, y is not Q: C(7,1)= 7
b) 89TJQy, y is not K: C(7,1)= 7
c) 9TJQKy, y is not A: C(7,1)= 7
d) TJQKAy: C(8,1)= 8
3. 5 diamond cards: C(11,5)=462
straight-flush: 4+21+21+21+28=95
a) A2345TJ to 45678TJ: 4
b) 789TJyz, yz is not Q: C(7,2)= 21
c) 89TJQyz, yz is not K: C(7,2)= 21
d) 9TJQKyz, yz is not A: C(7,2)= 21
e) TJQKAyz: C(8,2)= 28
The probability of flush is about 7.16%, without straight-flush is 6.93%
If we roughly discount the previous winning rate against TJ(unsuited) by 7%, the probability of winning is about 48%.
=====================
Another approach...
The remaining 5 cards has:
1. 3 diamond cards:
a. no 7,T,J: C(10,3)*C(30,2)=52,200
b. with a 7 but no TJ:
7 is diamond: C(10,2)*C(30,2)=19,575
7 is not diamond: C(10,3)*C(30,1)=3,600
c. with a 7 only one T/J:
7 is diamond: C(10,2)*6*C(30,1)=8,100
7 is not diamond: C(10,3)*6=720
straight-flush: 1305+435+90+180+18=2028
a. no 7,T,J: 89Q,9QK,QKA: 3*C(30,2)=1,305
b. with a 7 but no TJ:
7 is diamond: 789: 1*C(30,2)=435
7 is not diamond: 89Q,9QK,QKA: 3*C(30,1)=90
c. with a 7 only one T/J:
7 is diamond: 789: 1*6*C(30,1)=180
7 is not diamond: 89Q,9QK,QKA: 3*6=18
2. 4 diamond cards:
a. no 7,T,J: C(10,4)*C(30,1)=6,300
b. with a 7 but no TJ:
7 is diamond: C(10,3)*C(30,1)=3,600
7 is not diamond: C(10,4)=210
c. with a 7 only one T/J:
7 is diamond: C(10,3)*6=720
straight-flush:
a. no 7,T,J: (6+6+7)*C(30,1)= 570
i) 89TJQy, y is not 7,K: C(6,1)= 6
ii) 9TJQKy, y is not 7,A: C(6,1)= 6
iii) TJQKAy, y is not 7: C(7,1)= 7
b. with a 7 but no TJ:
7 is diamond: (7+1+1+1)*30=300
i) 789TJy, y is not Q: C(7,1)= 7
ii) 89TJQy, y is not K, y is 7: 1
iii) 9TJQKy, y is not A, y is 7: 1
iv) TJQKAy, y is 7: 1
7 is not diamond: (6+6+7)*30=570
i) 89TJQy, y is not 7,K: C(6,1)= 6
ii) 9TJQKy, y is not 7,A: C(6,1)= 6
iii) TJQKAy, y is not 7: C(7,1)= 7
c. with a 7 only one T/J:
7 is diamond: (7+1+1+1)*6=60
i) 789TJy, y is not Q: C(7,1)= 7
ii) 89TJQy, y is not K, y is 7: 1
iii) 9TJQKy, y is not A, y is 7: 1
iv) TJQKAy, y is 7: 1
3. 5 diamond cards:
a. no 7,T,J: C(10,5)=252
b. with a 7 but no TJ:
7 is diamond: C(10,4)=210
straight-flush: 95
The total is 95,487(flush) less 3623(straight flush), the probability is 5.36%. The winning rate is 51.73%-5.36%+q=46.37%+q.
Subscribe to:
Posts
(
Atom
)

