11667 - Income Tax Hazard II

All about problems in Volume 116. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
mustak
New poster
Posts: 8
Joined: Sun Sep 06, 2009 5:11 pm
Contact:

11667 - Income Tax Hazard II

Post by mustak » Sun Sep 13, 2009 5:24 pm

My question is if 50000<=min<=max<=200000 then in sample input output how min is greater than max in that problem.
edit: Problem number 11667

User avatar
tryit1
Experienced poster
Posts: 119
Joined: Sun Aug 24, 2008 9:09 pm

11667 - Income Tax Hazard (II)

Post by tryit1 » Mon Sep 14, 2009 3:31 pm

Code: Select all

10000 50000 50002
70000 50000 80000
120000 50000 200000
11111 122222 233333
131111 122222 233333
60000   50000 70000
10000 50000 150000
90000 50000 200000
0 0 0

Case 1: 0.00
Case 2: 1333.36
Case 3: 3266.69
Case 4: 0.00
Case 5: 71.12
Case 6: 500.02
Case 7: 0.00
Case 8: 1066.69

mak(cse_DU)
Learning poster
Posts: 72
Joined: Tue May 30, 2006 5:57 pm
Location: bangladesh

Re: 11667 - Income Tax Hazard (II) explanation needed

Post by mak(cse_DU) » Tue Sep 15, 2009 1:40 pm

What does expected amount of tax means?
I am totally unable to realize the problem.
Please explain

problem description:::
Problem Description wrote: you have two find the expected amount of income tax that you need to pay. You should assume that all distinct combinations of S1 and S2 satisfying the above conditions are equally likely.
Mak
Help me PLZ!!

mak(cse_DU)
Learning poster
Posts: 72
Joined: Tue May 30, 2006 5:57 pm
Location: bangladesh

Re: 11667 - Income Tax Hazard (II)

Post by mak(cse_DU) » Tue Sep 15, 2009 5:16 pm

WoW
This is a probability problem.
I have found the hidden description.

But in real life how tax payment can be a probability? confused :roll:
Mak
Help me PLZ!!

mak(cse_DU)
Learning poster
Posts: 72
Joined: Tue May 30, 2006 5:57 pm
Location: bangladesh

11667 - Income Tax Hazard (II) re statement of problem

Post by mak(cse_DU) » Wed Sep 16, 2009 5:47 pm

I am giving extra test case :
Input:

Code: Select all

120000 50000 100000  
400000 50000 200000
0 0 0 
Output:

Code: Select all

Case 1: 9000.00
Case 2: 55000.00
Here hints to solve this problem.

if M<MIN then output must be 0.00
if M>MAX then output .2*(M-MAX)+.1*(MAX-MIN)
But if MIN<=M<=MAX then you have to calculate probability based calculation.

Let TotalSpace=(MAX-MIN+1)*(MAX-MIN+1+1)/2. --> (Total combinations of s1 and s2 ).


Now evaluate below code efficiently.

Code: Select all


res=0.0;
for(i=MIN;i<=M;i++)
           for(j=M;j<=MAX;j++)
                     res+=.1*(M-i)/TotalSpace;

for(i=MIN;i<M;i++)
   for(j=i;j<M;j++){
            res+=.2*(M-j)/TotalSpace;
            res+=.1*(j-i)/TotalSpace;
   }

print res.
MIN,MAX and M are defined in problem statement.
Mak
Help me PLZ!!

ltaravilse
New poster
Posts: 1
Joined: Fri Oct 23, 2009 6:00 pm

Re: 11667 - Income Tax Hazard (II)

Post by ltaravilse » Fri Oct 23, 2009 6:05 pm

Why in test case

70000 50000 80000

I'm getting 1333.33 instead of 1333.36?

It's not a floating point error because I did it by hand and I get 4000/3

Is it wrong 1333.33?

I wonder why did I get so close if it's wrong...

Post Reply

Return to “Volume 116 (11600-11699)”