Former Karnataka Chief Minister BS Yeddyurappa was expelled yesterday from the Karnataka Janata Party, a party he had helped re-launch along with founder Padmanabha Prasanna, when he quit the Bharatiya Janata Party (BJP). As with the breakup with BJP, Yeddyurappa is expected to encourage a certain fraction of legislators to come along with him this time as well.
While it is not clear what Yeddyurappa’s immediate course of action would be – there are murmurs that he may start his own party this time around – political scientists believe that an important question is beginning to loom in front of Yeddyurappa: “How many breakups can Yeddyurappa successfully undergo before he’s left with a one-man party, i.e. himself?”
Help has come forth from a young resident of Shikaripura, Yeddyurappa’s home constituency. Srikant Bangarappa, a software engineer currently working with Bangalore based software giant, Infosys, has developed an algorithm that will provide the answer to this very question.
“Given all that Mr. Yeddyurappa has done for Karnataka as the Chief Minister, this is the least I could do for him,” sniggered Srikant. “I have placed a basic algorithm in the public domain for use by him and other rebel leaders across the country using which they can make calculated decisions that will protect their political careers. Should leaders need additional customization, they may hire my services for a nominal fee.”
The algorithm has already generated a lot of interest across the political space. A representative from JD(U) has written to Srikant asking if he could modify the algorithm to model break-ups from alliances as against parties. Representatives from Samajwadi party and BSP have made similar requests, but asked to add the additional input parameter ‘CBI’ in the function.
Meanwhile, Srikant’s basic algorithm is already in the public domain, and has been duly reproduced here. The recursive function takes two parameters – the total legislators associated with the current party, and the estimated percentage of faction of legislators loyal to the rebel leader, and returns the total number of breakups the rebel may risk before being left all alone.
int HowManyBreakUps(int TotalLegislators, float LoyalFactionPercentage) // Function
{
int NumberOfLegislatorsYeddyCanTakeAlong = TotalLegislators * LoyalFactionPercentage;
if (NumberOfLegislatorsYeddyCanTakeAlong >= 1)
return (1 + HowManyBreakUps(NumberofLegislatorsYeddyCanTakeAlong, LoyalFactionPercentage));
else
return (0);
}
Related posts:
| |
I am guessing the algorithm runs on a never-ending loop!:)
Purple
January 30, 2013 at 9:28 am
Srikanth sucks at math & programming – thats why he ended up in Infy..
Better algorithm below:
int howManyBreakUps(int totalLegislators, float loyalFactionPercentage) {
return floor(log(1/totalLegislators) / log (loyalFactionPercentage/100));
}
Not good at math!
January 30, 2013 at 12:03 pm
This is an infinite recursion sir. The terminating condition doesn’t arise if the loyal percent is not 0 ;)
Varun
January 30, 2013 at 1:19 pm
Tried running in C++:
Errors- It should be ‘NumberOfLegislatorsYeddyCanTakeAlong’ in the if statement and return 1 +…. currently it is ‘NumberofLegislatorsYeddyCanTakeAlong’
I punched in totallegislators as 100 and fraction as 0.6
No of breakups is 8
Source Code
#include
int HowManyBreakUps(int TotalLegislators, float LoyalFactionPercentage) // Function
{
int NumberOfLegislatorsYeddyCanTakeAlong = TotalLegislators * LoyalFactionPercentage;
if (NumberOfLegislatorsYeddyCanTakeAlong >= 1)
return (1 + HowManyBreakUps(NumberOfLegislatorsYeddyCanTakeAlong, LoyalFactionPercentage));
else
return (0);
}
void main()
{
int x=HowManyBreakUps(100,0.6);
cout<<x;
}
Krr
January 30, 2013 at 2:18 pm
Hey, I sent it to these Unreal chaps with the right variables. It’s their editing team’s fault. And to “Not good at math”, f*** u.
Srikant
January 30, 2013 at 6:54 pm
Hay, I never said no good at math
Krr
January 30, 2013 at 7:57 pm
I meant the guy who posted the 2nd comment. Not you pa
Srikant
January 30, 2013 at 8:17 pm
Hahaha …^^ Krr you crack me up! ^^
CM Gogo
January 30, 2013 at 4:54 pm
Mama,
You should have kept a coding contest to help Yeddyurappa
Pankaj
January 30, 2013 at 8:41 pm
lol, now software engineers are encroaching with their codes into public space. Guys, not everyone here gets the point of ur arguments about the code. So …….
Udit
January 31, 2013 at 4:39 pm