Skip to main content

First post using stackedit

Welcome to StackEdit! Hey! I’m your first Markdown document in StackEdit1. Don’t delete me, I’m very helpful! I can be recovered anyway in the Utils tab of the Settings dialog.
Documents StackEdit stores your documents in your browser, which means all your documents are automatically saved locally and are accessible offline!
Note:
StackEdit is accessible offline after the application has been loaded for the first time.Your local documents are not shared between different browsers or computers.Clearing your browser’s data may delete all your local documents! Make sure your documents are synchronized with Google Drive or Dropbox (check out the Synchronization section). Create a document The document panel is accessible using the button in the navigation bar. You can create a new document by clicking New document in the document panel.
Switch to another document All your local documents are listed in the document panel. You can switch from one to another by clicking a document in the li…

An interesting card game

Here is a very interesting card game which has been introduced by Prof. Kandori at University of Tokyo.


There are two players, one is Red and one is Black. Each players have four cards in corresponding colors: King (K), Ace (A), 2 and 3.

Each round, both two players simultaneously (i.e, together) select one card from their hand, and determine the winner as the rule in the picture:
- If two cards are two Kings, Red wins.
- If one card is King and other card is not, Black wins.
- Otherwise, if number of two cards are different, Red wins. If number of two cards are identical, Black wins.

At first sight, it is very easy to say that the game is favor on Red.

But it is not true.

Even if both players play randomly, the Black has a bigger chance to win. You can check the simulation at:

http://www.codeskulptor.org/#user39_B0DWPHGSyD_1.py

It is easy to calculate the chance to win of Black is 9/16.

But we can go further.

Take into account the fact that K is very important card in this game, we can analyze:
- For Red, if he picks K, the chance to win is 1/4, and if he does not pick K, the chance is 1/2
- For Black, if he picks K, the chance to win is 3/4, and if not, the chance is 1/2.

Giving this analyzation, Red should pick K with the probability 1/3, and Black should pick K with the probability 3/5.

We simulated this game at:

http://www.codeskulptor.org/#user39_GsS4T2VieN_1.py

Calculate exactly how much the chance to win of Red and Black may interest the readers.


Comments

Popular posts from this blog

Installing tensorflow on Mac OS 10.11

Tensorflow (https://www.tensorflow.org/) is the open source deep learning library from Google (http://www.wired.com/2015/11/google-open-sources-its-artificial-intelligence-engine/).

Installing Tensorflow is not easy on Mac if you follow exactly the installation instruction on the homepage. I have no idea why. I have error then error while trying to install Tensorflow with pip, with virtualenv, or even with Docker.

However, with Anaconda (https://www.continuum.io/downloads), it will be easy. The trick is you should download the wheel file and install it offline other than retrieving it online as suggested by Tensorflow homepage.

So, with anaconda for python2 installed, I did:

# create a new environment with sklearn installed, up to you
# if you want a pure Python, replace scikit-learn by python
conda create -n tensorflow scikit-learn

# activate the new environment
source activate tensorflow

# download the wheel file

curl https://storage.googleapis.com/tensorflow/mac/tensorflow-0.6.0-py2-none-…

Luật doanh nghiệp năm 2005 song ngữ Việt - Anh

Văn bản: Luật doanh nghiệp số 60/2005/QH11, được thông qua tại kỳ họp thứ 8, Quốc hội khóa XI, ngày 29 tháng 11 năm 2005, có hiệu lực từ ngày 1 tháng 7 năm 2006.
Nguồn văn bản tiếng Anh: Bộ tư pháp


Định dạng: PDF
Song ngữ Việt - Anh.
Người biên tập: vinhdq.blogspot.com
Link download: http://adf.ly/6J3a9
Password: bloglangthang.tk