NR:Forwardal Of Suggestion-newChapter
kutta
02-06-2009, 08:00 AM
Hello Comrades/Authors of NR
May I include a suggestion contextual to NR-Algorithms
and enlcose this few lines of text...
Thanking you
As Kutta(C.R.Muthukumar)
:)
kutta
02-12-2009, 05:16 AM
Hello Comrades/Authors of NR
May I include a suggestion contextual to NR-Algorithms
and enlcose this few lines of text...
Thanking you
As Kutta(C.R.Muthukumar)
:)
Further to the above fowardal, I now add a small rider or
a corollary under the same suject that might help all or any of the person that wants to successfully carry out the task at hand.
Though there appears to be no reply to this useful inclusion/suggestion, am now able to send the following extra text material that would make one to try in this
new field of global requirement that will be first of its kind to NR in totality.This is in 3 parts
each is to be treated as an example .
The first part is a different strategy .Part 2 And Part3 are to collectively read for creating an algorithm..
Hope this addtional details are only for making the NR Book a blooming one if at all something done concretely to create a new chapter as suggested
Thanking You
As
Kutta(C.R.Muthukumar):)
Part1:
Two objects of value $100 & $130 are to be auctioned at a public sale Only two bidders are interested in these items . Bidder A has $ 100 available and bidder B has $ 80 avialable .What should be their startegies if each bidder is interested in maximising his own gain?
Solution:--
Let us assume for simplicity that successive bids increase in steps of deltx .At any stage of bidding a player has the option of letting his opponent's bid stand or of increasing it by $ deltx and leaving the next decision upto his opponent .Suppose that bidder B has just bid x dollars for the first Object .Let Alpha(x,0) be A's gain, if he lets B's bid stand --(1),
And Alpha(x, deltx) be A's gain if he increases the bid to x+ deltx and B lets him win --(2),
If A lets B take the first Object for x, then A is sure to win the second Object with a bid of 80 - x + deltx--------(3),
Since B's total capital is 80
Thus
Alpha(x-0) = 130-[80-x+deltx]= 50+x-deltx;
If A wins with a bid x + deltx then B will win the seond Object if x >= $20, with a bid of 130-(x+deltx)+deltx = 130- x;
Alpha(x ,deltx) = 100 - (x+deltx) = 100 - x- deltx;
We see that A should bid x + deltx provided 100 - x - deltx >= 50 + x - deltx;
ie) provided x<= 25 ;
If x>25,
A should let B win the first Object for that amount.
Player B has a similar decisions to make. If A has just bid x( and if x>= 20)
Then B's gaining Beta(x,0) and Beta(x detx)
are given by Beta(x,0)= 130-(100-x+deltx)=30+x-deltx;
Beta(x, deltx) = 100-(x+deltx) = 100 - x deltx;
So B should bid x+ deltx on item 1 provided x <= 35;
It is clear that B will take the less expensive Object for amount $ 25, and A will take the more expensive Object for about $55.Both parties end up with the same net gain and if the other than items were offered first the results would be exactly the same. The order of the items is immaterial in all such problems, regardless of the relative values of the two items and the relative resources of the competitors.The net gains will be the equal when conditions are such that the optimal strategies lead to a division of the two items between the competitors,
otherwise, ofcourse ,the net gain for one of the parties will be zero.
*************************************************
Part2
Bidding Example
My cost(thousands) 10
My bid(thousands) #NAME?
Competitor 1 Bid #NAME?
Competitor 2 Bid #NAME?
Competitor 3 Bid #NAME?
Competitor 4 Bid #NAME?
Profit(thousands) #NAME?
Iterations= 400
Simulations= 10
# Input Variables= 5
# Output Variables= 1
Sampling Type= Latin Hypercube
Runtime= 00:02:45
Summary Statistics
Cell Name Minimum Mean Maximum
C9 (Sim#1) Profit(thousa... 0 0.81 1
C9 (Sim#2) Profit(thousa... 0 1.3 2
C9 (Sim#3) Profit(thousa... 0 1.575 3
C9 (Sim#4) Profit(thousa... 0 1.66 4
C9 (Sim#5) Profit(thousa... 0 1.5625 5
C9 (Sim#6) Profit(thousa... 0 1.41 6
C9 (Sim#7) Profit(thousa... 0 1.155 7
C9 (Sim#8) Profit(thousa... 0 0.96 8
C9 (Sim#9) Profit(thousa... 0 0.7425 9
C9 (Sim#10) Profit(thous... 0 0.55 10
***********************************************
Part3
(All numbers in 000's)
Our cost Comp1 bid Linear prediction Power prediction Exponential prediction Actual Linear Error Linear %age error Power %age error Exponential %age error Linear abs %age error Power abs %age error Exponential %age error
10 13 13.1027 13.35697365 16.37950845 -0.1027 -0.007838079 -0.026725638 -0.206325389 0.007838079 0.026725638 0.206325389
14 20 19.0587 19.07213041 19.53154926 0.9413 0.049389518 0.048650548 0.023984311 0.049389518 0.048650548 0.023984311
16 22 22.0367 21.96794754 21.32821979 -0.0367 -0.001665404 0.001459056 0.031497247 0.001665404 0.001459056 0.031497247
18 25 25.0147 24.88510875 23.29016268 -0.0147 -0.000587654 0.004616868 0.073414572 0.000587654 0.004616868 0.073414572
30 44 42.8827 42.73548423 39.48935211 1.1173 0.026054796 0.029589363 0.114224409 0.026054796 0.029589363 0.114224409
25 34 35.4377 35.23443909 31.69094739 -1.4377 -0.040569789 -0.035035015 0.072861584 0.040569789 0.035035015 0.072861584
38 56 54.7947 54.88668285 56.15024636 1.2053 0.021996653 0.020283921 -0.002675792 0.021996653 0.020283921 0.002675792
44 63 63.7287 64.1013347 73.11481901 -0.7287 -0.011434409 -0.017181151 -0.138341572 0.011434409 0.017181151 0.138341572
24 33 33.9487 33.74424297 30.32677752 -0.9487 -0.027945105 -0.022055406 0.088147265 0.027945105 0.022055406 0.088147265
stdev 0.941891507 0.020831267 0.022844107 0.083496904
***************************************
kutta
04-30-2009, 09:59 AM
Further to the above fowardal, I now add a small rider or
a corollary under the same suject that might help all or any of the person that wants to successfully carry out the task at hand.
Though there appears to be no reply to this useful inclusion/suggestion, am now able to send the following extra text material that would make one to try in this
new field of global requirement that will be first of its kind to NR in totality.This is in 3 parts
each is to be treated as an example .
The first part is a different strategy .Part 2 And Part3 are to collectively read for creating an algorithm..
Hope this addtional details are only for making the NR Book a blooming one if at all something done concretely to create a new chapter as suggested
Thanking You
As
Kutta(C.R.Muthukumar):)
Hello Comrades and Authors of NR
There appears to be existing an ambiguous treatments for posting as well as reply column(MainPage) that is edited in the NR-Forum.
Is it not better to identify and indictate accordingly.
After all, when a person does edit a post ,he may continue to do so especially when the prevoius post requires more info or so on the subject.
Hence both editions in conitnuence cannot be indicated as reply as is the case above.Separate column for post and reply to be provided instead of clubbing, thereby helping the viewers/users to confirm insantantaniosly if any reply has been notified,without opening the exact posted place.
Hope the concerned authorities woud do this needfull endeavour.
Thanking You
As
Kutta(C.R.Muthukumar):)
kutta
12-06-2009, 05:14 AM
Further to the above fowardal, I now add a small rider or
a corollary under the same suject that might help all or any of the person that wants to successfully carry out the task at hand.
Though there appears to be no reply to this useful inclusion/suggestion, am now able to send the following extra text material that would make one to try in this
new field of global requirement that will be first of its kind to NR in totality.This is in 3 parts
each is to be treated as an example .
The first part is a different strategy .Part 2 And Part3 are to collectively read for creating an algorithm..
Hope this addtional details are only for making the NR Book a blooming one if at all something done concretely to create a new chapter as suggested
Thanking You
As
Kutta(C.R.Muthukumar):)
Hello NR Comrades and authors,
I shall be failing in my duty( for the post that has already been putforth being in an unfinished status inlieu of no response) if i do not atleast try to add some ways and means to convince if there could be a solution for the formulation of a routine for inclusion of it in the NRecipe after the accordance
by the Chieves.
Fortunately the only way i colud do this again by way of an example .So please try to comprehend the following assignment and using integral and exponential function
to formulate a permanant method for atleast bidding for sealed contract.(to start with)
I am sure this way you will find the forth coming new year a very happy one resulting in abundance of new things etc
Thanking You
As
Kutta(C.R.Muthukumar)
A Caterer is about to submit a sealed bid to run a restaurant concession at a municipal airport for the next five years. He must state the fixed rent that he is prepared to pay annually .He estimates that gross profits before rent is paid will be $ 100,000//=the first year and will increase by 10 % per year.Past experience shows that if R is the annual rent offered by a winning bid, and G is his own estimate of the total gross profit of the contract running n years., the ratio nR/G is normally distributed about 0.5 with a standard deviation of 0.07.What should be bid so as to maximimise his expected profit.
:)
kutta
01-22-2010, 04:33 AM
Hello NR Comrades and authors,
I shall be failing in my duty( for the post that has already been putforth being in an unfinished status inlieu of no response) if i do not atleast try to add some ways and means to convince if there could be a solution for the formulation of a routine for inclusion of it in the NRecipe after the accordance
by the Chieves.
Fortunately the only way i colud do this again by way of an example .So please try to comprehend the following assignment and using integral and exponential function
to formulate a permanant method for atleast bidding for sealed contract.(to start with)
I am sure this way you will find the forth coming new year a very happy one resulting in abundance of new things etc
Thanking You
As
Kutta(C.R.Muthukumar)
:)
Hello NR-representatives and concerned,
Please try once more to solve this .After all you have to declare the variables from the example and evaluate both the exponential function as well as integral function shown earlier for these variables .by using expint and integral programs of NR & obtain the values and the Maximum Bidding for the problem is where both curves intersect of the two functions or otherwise the equal roots of both functions.
I extend my New Year wishes after a lapse of one month,
thus maintaining the right understanding .
With Thanks
Kutta(C.R.Muthukumar):)
kutta
02-22-2010, 03:03 AM
Hello NR comrades and Authors,
Waiting for one month,in lieu of a reference of a textualbase info as a solution being available though the program that is supporetd by two pages referred herein does not make the output fully yet.I onceagain request you all ,not to give it up,but give rise to the exact requirement esssentially to fetch the intersecting point of both integral as well as exponential function mentioned,probably using iterator method for the program shown in.
In the event of a succesful finish, the authors can consider it to include as suggested new Chapter in NR.
I onceagin thank all
As
Kutta(C.R.Muthukumar)
kutta
05-21-2010, 12:55 AM
Hello NR comrades and Authors,
Waiting for one month,in lieu of a reference of a textualbase info as a solution being available though the program that is supporetd by two pages referred herein does not make the output fully yet.I onceagain request you all ,not to give it up,but give rise to the exact requirement esssentially to fetch the intersecting point of both integral as well as exponential function mentioned,probably using iterator method for the program shown in.
In the event of a succesful finish, the authors can consider it to include as suggested new Chapter in NR.
I onceagin thank all
As
Kutta(C.R.Muthukumar)
Hello NR-Authors,NR-Readers
Using the dfridr.cpp routine ,I tried to solve the Caterer's bidding Problem,which is appended below for perusal. So the bidding types of problems is able toget the scope of enriching itself with a better comprehension of the real business world ,I hope.
I also do hope that the same may please be viewed in a more useful way for the Readers Of NR at large.
Thanks and bye for now
As
Kutta(C.R.Muthukumar)
[QUOTE]
//**This program evaluates function and supplies dy value.
//When integral function and exponential function are evaluated separately
// the value of dy is same for/at the intersecting pt as explained in the bidding algo/problem
// earlier sent/*
#include "nr3.h"
#include <iostream>
#include <iomanip>
#include <cmath>
#define f
using namespace std;
template<class T>
Doub dfridr(T &func, const Doub x, const Doub h, Doub &err)
{
const Int ntab=10;
const Doub con=1.4, con2=(con*con);
const Doub big=numeric_limits<Doub>::max();
const Doub safe=2.0;
Int i,j;
Doub t;
Doub errt,fac,hh,ans,u1,v;
MatDoub a(ntab,ntab);
if (h == 0.0)
hh=h;
// u1=0.6;
// v=0.5;
err=big;
for (i=1;i<ntab;i++) {
hh /= con;
a[0][0]= (u1+t*v-1)*exp(exp(pow(-(x+hh/2),2))) - (u1+t*v-1)*exp(exp(pow(-(t+hh/2),2))/2.0*hh);//exponentailfunction
a[0][i]= exp(exp(pow(-(x+hh/2),2))) -exp(exp(pow(-(x-hh/2),2)))/(2.0*hh); //integralfunction
fac=con2;
for (j=1;j<=i;j++) {
a[j][i]=(a[j-1][i]*fac-a[j-1][i-1])/(fac-1.0);
fac=con2*fac;
errt=MAX(abs(a[j][i]-a[j-1][i]),abs(a[j][i]-a[j-1][i-1]));
if (errt <= err) {
err=errt;
ans=a[j][i];
}
}
if (abs(a[i][i]-a[i-1][i-1]) >= safe*err) break;
}
return ans;
}
int main()
{
Doub t,hh,x; // refer the nr3 routine for the hh,x values & for the t value attachent
Doub u1=0.002;//u1 value is approximate from the problem
Doub v=0.5; //v vlue is also from the problem
int i;
cout << " \n Details of Exponential function f(t) \t\t\n";
cout <<endl;
cout << " \n T ******************* f(t) \t\t\n";
cout << fixed;
for (int i=0; i<=10; i++)
{
cout << endl;
double t = i *((u1+t*v-1)*exp(exp(pow(-(t+hh/2),2))) - (u1+t*v-1)*exp(exp(pow(-(t+hh/2),2)))/(2.*hh));
cout << endl <<setw(5) << setprecision(3)
<< t << " ";
cout << endl << setw(5) << setprecision(3)
<< f(t) << " "
<< (u1+t*v-1)*exp(exp(pow(-(t+hh/2),2))) - (u1+t*v-1)*exp(exp(pow(-(t+hh/2),2)))/(2.*hh);
cout << " \n Details of Integral function f(x) \t\t\n";
cout<< endl;
cout << " \n X *********************** f(x) \t\t\n";
cout << fixed;
for (int i=0; i<=10; i++)
{
cout << endl;
double x = i*(exp(exp(pow(-(x+hh/2),2))) -exp(exp(pow(-(x-hh/2),2)))/(2.0*hh)); //integralfunction
cout << endl << setw(5) << setprecision(3)
<< x << " ";
cout << endl <<setw(5) << setprecision(3)
<< f(x) << " "
<< exp(exp(pow(-(x+hh/2),2))) -exp(exp(pow(-(x-hh/2),2)))/(2.0*hh); //integralfunction
if(t == x)
break;
cout << endl << "\n *******************Final Result************************\t\t\t \n";
cout << endl <<" \n Sealed Contract is Profitable"
"\n when Bid value is at"
"\n the intersecting pt of both the functions ie at the \t\t\t\n " << setw(5) << x;
return 0;
}
}
}
Output:
/**
T ******************* f(t)
-1.#IO
-1.#IO 1.#QO
Details of Integral function f(x)
X *********************** f(x)
-1.#IO
-1.#IO 1.#QO
*******************Final Result************************
Sealed Contract is Profitable
when Bid value is at
the intersecting pt of both the functions ie at the
-1.#IO
*/
[/QOUTE]
kutta
06-25-2010, 06:04 AM
Hello NR_Readers And Authors
Though suggestions are helpul for future,I am contented atleast that the same is viewed by a larger no of readers
which proves its values.And on the same lines,I now include
yet another probablistic notes that may again be useful for a try.
Please peruse this,inliew of a news that went here that the day (21-06-2010) was the longest .
This is the reason a new suggestion as follows.
Thanking you
As
Kutta(C.R.Muthukumar)
kutta
11-05-2010, 03:45 AM
Hello NR_Readers And Authors
Though suggestions are helpul for future,I am contented atleast that the same is viewed by a larger no of readers
which proves its values.And on the same lines,I now include
yet another probablistic notes that may again be useful for a try.
Please peruse this,inliew of a news that went here that the day (21-06-2010) was the longest .
This is the reason a new suggestion as follows.
Thanking you
As
Kutta(C.R.Muthukumar)
Hello Friends/Colleagues of Numerical Recipe
Please help me with a latest algorithm for finding the intersecting point of two equations .This request i place so that if there is any method be available to solve the ageold bidding problem .There appears to be no affirmations for the already suggested method ,and in-lieu of the same ,please atleast assertain that the method is correct atleast .Thanks
As
Kutta(C.R.Muthukumar)
With New Year Wishes
kutta
11-12-2010, 03:16 AM
Hello Friends/Colleagues of Numerical Recipe
Please help me with a latest algorithm for finding the intersecting point of two equations .This request i place so that if there is any method be available to solve the ageold bidding problem .There appears to be no affirmations for the already suggested method ,and in-lieu of the same ,please atleast assertain that the method is correct atleast .Thanks
As
Kutta(C.R.Muthukumar)
With New Year Wishes
Hello Authors ,members of NRRecipe,
Inlieu of non reply from any one I intend closing this post with final try.Please accept my thanks however.The new method is enclosed in this LastButNotThe LeastRider.doc for your perusal.
Thanks
As
Kutta(C.R.Muthukumar)
kutta
03-18-2011, 04:46 AM
Hello Authors ,members of NRRecipe,
Inlieu of non reply from any one I intend closing this post with final try.Please accept my thanks however.The new method is enclosed in this LastButNotThe LeastRider.doc for your perusal.
Thanks
As
Kutta(C.R.Muthukumar)
Hello Authors &Friends of NRRecipe
No matter whether if you are able to concurr for this final
quicker method to reach the output for the same bidding problem initiated with a specfic example on the same ,i shall be pleased if you are to include this suggestion before me closing this post.Rather i also say i have been able to revisit
C-Programming style inorder make u make it in C++,if it is
as normal as ever in algorithmic way.
As usual thanks
As
C.R.Muthukumar(Kutta)
***************************
include <conio.h>
#define clrscr()
float f(float);
float f(float);
float f(float x)
{
return ( sqrt(1/3.14)*exp(pow(-(x/2),2)));//(ExponentialFunction)
}
float f1(float x){
return (( (0.5 + 5*0.07-1)/0.07) *(sqrt(1/3.14) *exp(pow(-(x/2),2))));//(Integral function)
}
main()
{
int i;
float guess,oldx,newx;
printf("Enter Your guess:");
scanf("%f",&guess);
clrscr();
oldx=guess;
printf("ITERARTION OLDX NEWX|n\n");
for(i=1;;i++)
{
newx = oldx =f(oldx)/f1(oldx);
printf(" %3d %7.3f %7.3f \n",i,oldx,newx);
if(fabs(newx - oldx) < 0.001)
{
printf("\n\n Final value of x = %7.3f\n",newx);
break;
}
oldx=newx;
}
kutta
06-21-2011, 12:42 AM
Hello Authors &Friends of NRRecipe
No matter whether if you are able to concurr for this final
quicker method to reach the output for the same bidding problem initiated with a specfic example on the same ,i shall be pleased if you are to include this suggestion before me closing this post.Rather i also say i have been able to revisit
C-Programming style inorder make u make it in C++,if it is
as normal as ever in algorithmic way.
As usual thanks
As
C.R.Muthukumar(Kutta)
Hello NR-Orienters,
There has been a silence for the clearence
of this algorithm.May be to follow the age old proverb.
viz.,Silence is golden meaning that
the clearence is in order .
Thanks all
Bye for now
C.R.Muthukumar(Kutta)