วันพุธที่ 4 สิงหาคม พ.ศ. 2553

The second times I solve the same question in probability field .. Long distance calling ...

1st page2nd page

The question I encounter 2 times (first in bachelor degree learning)

Original Question.
"Long distance calling plan A offers flat rate service at 10 cents per minute. Calling plan B charges 99 cents for every call 20 minutes; for calls over 20 minutes, the charge is 99 cents for the first 20 minutes plus 10 cents for every additional minute. (Note that hese plans measure your call duration exactly, without rounding to the next minute or even second. If your long-distance calls have exponential distribution with expected value t minutes, which plan offers a lower expected cost per call?"

from
Probability and Stochastic Processes: A Friendly Introduction for Electrical and Computer Engineers Roy D. Yates , David J. Goodman

Second Meet Question
"Long-distance calling plan A offers rate service at 3 Baht per minute. Calling plan B changes 25 Baht for every call under 20 minutes; for calls over 20 minutes, the charge is 25 Baht for the first 20 minutes plus 3 Baht for every additional minutes (Note that these plans measure your call duration exactly, without rounding to the next minutes or even second.) If your long-distance calls have exponential distribution with expected value beta minutes, which plan offers a lower expected cost per call?"

The seconds times is on those pictures. The question is rather the same. It is changed only the numbers. and call extected value as beta.

In this solution I describe a 3 way to solve expected cost of plan B. E[B]

The First Solution is the cleverest method.
(the lower part of 1st page)

First , we observe the T variable that T is exponential then we find the probability for 0<=t<=20
P[0<=t<=20] = F(20)-F(0) = 1-e^(-20/beta) << Mass1
this is the first mass then the left mass is 1-(1-e^(-20/beta)) = e^(-20/beta) << Mass2

The part I call the clever is that this approach is use the property of Memoryless of exponential distribution
then we can cut out Many calculations.

the memoryless property lead to the equation at bottom of 1st page
the equation is E[B] = (The Mean position of Mass1)*(amount of Mass1) + (The Mean position of Mass2)*(amount of Mass2)
we left only the mean position of Mass2
from the memoryless property we got the mean of Mass2 is far from the starting of Mass2 as 3*beta (same as plan A) then we can conclude that the mean position of Mass2 is 25+beta (see graph 5th)

the left is the foundamental math to solved.


The Second Solution is the shortest method.

we know for E[B(t)] = integral ( B(t) f(t) dt )
then the after is straight forward. (the upper part of 2nd page)

The Third Solution is the straight method.

This method is just follow the step of other ordinary other questions.
(see the upper part of 1st page)
  • First we consider the cost function.
  • Second we consider the T random variable.
  • Third we derive the B to the T random variable in CDF form.
    then we got the mixed random variable.
  • Fourth change the CDF form to PDF form.
  • Fifth we directly find the E[B] (see the lower part of 2nd page)

วันอังคารที่ 13 กรกฎาคม พ.ศ. 2553

error: extra qualification ‘Item::’ on member ‘Item’

Today I download some fp growth source code from some site.

and compile them and got this error.

error: extra qualification ‘Item::’ on member ‘Item’.

I think it may cause by new compiler didn't want Item:: (class meaning)ahead of Item (function meaning).

วันจันทร์ที่ 21 มิถุนายน พ.ศ. 2553

The annoying adaptor , Tunnel adapter Local Area Connection




After you type "ipconfig /all" in command line in window 7 (or vista).
you may see these Tunnel Adapter

I am very annoy about these adapter It now show 94th adapter on my computer.

I guess these Tunnel adapter is come from Teredo Tunneling Pseudo-Interface.

http://webbosworld.co.uk/blog/?p=30

To solve them. there has several method.

The one solution rather brute force solution (but I still select to do it with this method = =")
is
1. open device manager
2. select view > show hidden devices
3. then you will see
then I manually right click at each adapter and choose uninstall option.
Wish this may help.

and Then if you didn't want to see them again you can disable Teredo adapter by follow this instruction.
http://www.mydigitallife.info/2007/09/09/how-to-disable-tcpipv6-teredo-tunneling-in-vista/

Ubuntu Running in low graphic mode

the cause of this problem is the graphic driver is override by some other software update.

you should download some driver that suit your graphic card and then reinstall.

1. press Ctrl+Alt+F2 (Ctrl+Alt+F8 and BackSpace I can't remember meaning)
then close x server by command "/etc/init.d/gdm stop"
2. sudo ./your driver.run
3. "etc/init.d/gdm start or restart"

Finish then "sudo shutdown now" if you can't back to normal graphic mode = ="

วันเสาร์ที่ 17 เมษายน พ.ศ. 2553

Solve Password for Start-dfs.sh


if you set hadoop command in permission folder then you can't run this command.

my method is "move all of hadoop to home folder".

this may solve.

or if you should insert password 2 times don't tired to type.

the first for datanode and the second for secondary namenode.


วันจันทร์ที่ 22 กุมภาพันธ์ พ.ศ. 2553

My Stupid about Grave accent

I have one problem can't solved for a long time.
That is I can't type ~ in windows 7.

To solve this only hold that key (shift + ~)
if not hold it then it will change your language.

วันอังคารที่ 19 มกราคม พ.ศ. 2553

Installing NVIDIA NEXUS for Debug CUDA , OpenCL

When installing, Nexus Beta 1 says that the required version of Visual Studio is not detected. But Visual Studio 2008 SP1 is installed! What is wrong?

Nexus Beta 1 looks at keys in the Windows registry in order to determine if Visual Studio 2008 SP1 is installed.

The registry keys read by the Nexus Beta 1 installer are:

  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0 where key ApplicationID has the value: REG_SZ “VisualStudio”

  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DevDiv\VS\Servicing\9.0 where key SP has the value: REG_DWORD 0x00000001


If your registry does not have those values in those keys, then unfortunately, Nexus Beta 1 will not install.

text from http://supportcenteronline.com/ics/support/KBAnswer.asp?questionID=70

วันเสาร์ที่ 16 มกราคม พ.ศ. 2553

C1083 cuda error

solved by go to C/C++ > Precompiled Headers > Not Using Precompiled Header

or if you need to use

C/C++ > Precompiled Headers

: Created Precompiled Header (/Yc)
: StdAfx.h
: $(IntDir)\$(TargetName).pch