Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 146873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T08:40:51+00:00 2026-05-11T08:40:51+00:00

in another post, MSN gave me a good guide on solving my algebra problem

  • 0

in another post, MSN gave me a good guide on solving my algebra problem (Calculating bid price from total cost). Now, even though I can calculate it by hand, I’m completely stuck on how to write this in pseudocode or code. Anyone could give me a quick hint? By the way, I want to calculate the bid given the final costs .

usage cost(bid) = PIN(bid*0.10, 10, 50) seller cost(bid) = bid*.02 added cost(bid) = PIN(ceiling(bid/500)*5, 5, 10) + PIN(ceiling((bid - 1000)/2000)*5, 0, 10) storing cost(bid) = 100 So the final cost is something like:  final cost(bid) = PIN(bid*.1, 10, 50) + pin(ceiling(bid/500)*5, 5, 20) + PIN(ceiling((bid - 1000)/2000)*10, 0, 20) + bid*.02 + 100 + bid Solve for a particular value and you're done.  For example, if you want the total cost to be $2000:  2000 = PIN(bid*.1, 10, 50) + pin(ceiling(bid/500)*5, 5, 10) + PIN(ceiling((bid - 1000)/2000)*5, 0, 10) + bid*.02 + 100 + bid. Bid must be at least > 1500 and < 2000, which works out nicely since we can make those PIN sections constant:  2000 = 50 + 10 + 5 + 100 + bid*1.02 1835 = bid*1.02 bid = 1799.0196078431372549019607843137 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T08:40:52+00:00Added an answer on May 11, 2026 at 8:40 am

    The function simplifies to:

                      / 1.02 * bid + 115   bid <   100                   | 1.12 * bid + 105   bid <=  500 final cost(bid) = | 1.02 * bid + 160   bid <= 1000                   | 1.02 * bid + 165   bid <= 3000                   \ 1.02 * bid + 170   otherwise 

    If you consider each piece as a separate function, they can be inverted:

    bid_a(cost) = (cost - 115) / 1.02 bid_b(cost) = (cost - 105) / 1.12 bid_c(cost) = (cost - 160) / 1.02 bid_d(cost) = (cost - 165) / 1.02 bid_e(cost) = (cost - 170) / 1.02 

    If you plug your cost into each function you get an estimated bid value for that range. You must check that this value indeed is within that functions valid range.

    Example:

    cost = 2000  bid_a(2000) = (2000 - 115) / 1.02 = 1848  Too big! Need to be < 100 bid_b(2000) = (2000 - 105) / 1.12 = 1692  Too big! Need to be <= 500 bid_c(2000) = (2000 - 160) / 1.02 = 1804  Too big! Need to be <= 1000 bid_d(2000) = (2000 - 165) / 1.02 = 1799  Good. It is <= 3000 bid_e(2000) = (2000 - 170) / 1.02 = 1794  Too small! Need to be > 3000  Just to check:  final cost(1799) = 1.02 * 1799 + 165 = 2000   Good! 

    Since the original function is strictly increasing, at most one of those functions will give an acceptable value. But for some inputs none of them will give a good value. This is because the original function jumps over those values.

    final cost(1000) = 1.02 * 1000 + 160 = 1180 final cost(1001) = 1.02 * 1001 + 165 = 1186 

    So no function will give an acceptable value for cost = 1182 for example.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a followup from another post at here . Problem: The code below
This is a followup from another post at here . Problem: links aren't been
I discovered Microsoft's .Net charting controls from another post here, and so far I
Below is the code for Ctrl + F (from another SO post). But how
As I stated in another post , I access at times controls direct from
In the hope of fixing a bug of mine from another post i would
Let say I have a method (example taken from another post): public IQueryable<CityBlock> GetCityBlocks(){
Hi I am using some modified code from another post. Basically I want to
I got this RegEx from another post, but it doesn't fully function like it
This is a follow up question from another post but that post was answered.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.