Saturday, August 14, 2010

Availability Bias

A Trick Question You Might Want To Try With Your Friends

Let me ask you a question. Among English 6-letter words, which of the following is more probable?
  • Find a word whose fifth letter is ‘n’.
  • Find a word ending with ‘ing’.

Tuesday, August 10, 2010

Regression towards the Mean

A result which falls far from the mean tends to be closer to the mean during the next attempt. Failing something consecutively does not mean that the next attempt will not succeed. Attempts and successes are not linearly related.

Future is unpredictable, but there is one good news. If you are good (i.e., the mean is good enough), you will finally succeed (i.e., reach the mean). Do not give in, even if you have failed (i.e., fall off the mean) consecutively.

“Genius does not guarantee success, but it is seductive to assume that success must come from genius.”

The logic behind the “regression towards the mean” theorem is as follows. Suppose your average test score is 50. Now, let’s take a test. Suppose that you’ve got 40. If your next test scores less than 40, which is further away from the mean, your average won’t be 50. It has to be lower than 50 which contradicts to what we assume at the beginning.


Source: The Drunkard's Walk: How Randomness Rules Our Lives by Leonard Mlodinow, Chapter 1 [Read the Book Review] [Read the Previous Part] [Read the Next Part].

Sunday, August 8, 2010

C++ and OTcl Linkage: OTcl Commands -- Invocation process

Note: The content in this series is extracted from the book, Introduction to Network Simulator NS2. You may have to read chapter 3 of the book for better understanding.

Introduction
This post is the second post in the series on C++ and OTcl Linkage:

   1. Why Two Languages?
   2. Binding C++ and OTcl classes [Main steps, The mechanism].
   3. Variable binding
   4. OTcl command: Invoking C++ statements from the OTcl domain [ Getting Started, Invocation process ]
   5. Eval and result: Invoking OTcl statements from the C++ domain
   6. Object binding and object construction process.

In the previous post, I blogged about OTcl command. I took you to see how to create a OTcl command in C++ and invoke the command from the OTcl domain. how C++ and OTcl classes are bound together. In this post, I will explain the key steps for OTcl command invocation.

Saturday, July 17, 2010

Are we a better guesser than a mouse?

It is compelling to answer ‘yes’. Unfortunately, the answer is ‘not always’. To see why, let’s setup an experiment where red and green cards are shown to a test subject. The job of the subject is to observe a sequence of cards and to guess the color of the next cards. Suppose that we use a certain sequence where 75% of the cards are green and 25% are red cards. The subject might choose to use one of the following 2 strategies for guessing:

(i) Probability based guessing: Observe and compute probability of cards being green and red. Then always choose the color with higher probability. In the above example, the subject will always choose green. If we let the subject keeps guessing, the correct probability will approach 75%. But it can never be better than 75%. This is what most non-human animals such as mouses would do.

Monday, July 12, 2010

C++ and OTcl Linkage: OTcl Commands — Getting Started

Note: The content in this series is extracted from the book, Introduction to Network Simulator NS2. You may have to read chapter 3 of the book for better understanding.
OTcl Command -- Getting Started

View more presentations from Teerawat Issariyakul.

Introduction

This post is the second post in the series on C++ and OTcl Linkage:

   1. Why Two Languages?
   2. Binding C++ and OTcl classes [Main steps, The mechanism].
   3. Variable binding
   4. OTcl command: Invoking C++ statements from the OTcl domain [ Getting Started, Make it more Interesting ]
   5. Eval and result: Invoking OTcl statements from the C++ domain
   6. Object binding and object construction process.

In the previous post, I blogged about how C++ and OTcl classes are bound together. In this post, I will explain how to bind C++ and OTcl class variable together.
=======================================================
T. Issaraiyakul and E. Hossain, “Introduction to Network Simulator NS2”, Springer 2009. Buy it now from

You may also find lecture notes and other resource at the following website: http://www.ece.ubc.ca/~teerawat/NS2.htm

Thursday, July 8, 2010

Segmentation Fault: A Common Error in NS2

Introduction

One of the most common error you might have found when running NS2 is "Segmentation Fault". This is just a type of runtime error. If you run, the same program in Win32 console application, Windows will show a run-time error message and terminate the program. So don't be intimidated by it. 

Monday, July 5, 2010

C++ and OTcl Linkage: Binding variables

Note: The content in this series is extracted from the book, Introduction to Network Simulator NS2. You may have to read chapter 3 of the book for better understanding.

Introduction

This post is the second post in the series on C++ and OTcl Linkage:

   1. Why Two Languages?
   2. Binding C++ and OTcl classes [Main steps, The mechanism].
   3. Variable binding
   4. OTcl command: Invoking C++ statements from the OTcl domain
   5. Eval and result: Invoking OTcl statements from the C++ domain
   6. Object binding and object construction process.

In the previous post, I blogged about how C++ and OTcl classes are bound together. In this post, I will explain how to bind C++ and OTcl class variable together.
NS2: Binding C++ and OTcl variables


View more presentations from Teerawat Issariyakul.

=======================================================
T. Issaraiyakul and E. Hossain, “Introduction to Network Simulator NS2”, Springer 2009. 
You may also find lecture notes and other resource at the following website: http://www.ece.ubc.ca/~teerawat/NS2.htm