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

  • Home
  • SEARCH
  • 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 8970569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:44:38+00:00 2026-06-15T17:44:38+00:00

I am trying to determine a hash function which takes an input (i, k)

  • 0

I am trying to determine a hash function which takes an input (i, k) and determines a unique solution.

The possible inputs for (i, k) range from 0 to 100. Consider each (i, k) as a position of a node in a trinomial tree.

Ex: (0, 0) can diverge to (1, 1) (1, 0) (1, -1). 
    (1, 1) can diverge to (2, 2) (2, 1) (2, 0).

Sample given here:

http://www.google.com/imgres?imgurl=http://sfb649.wiwi.hu-berlin.de/fedc_homepage/xplore/tutorials/stfhtmlimg1156.gif&imgrefurl=http://sfb649.wiwi.hu-berlin.de/fedc_homepage/xplore/tutorials/stfhtmlnode41.html&h=413&w=416&sz=4&tbnid=OegDZu-yeVitZM:&tbnh=90&tbnw=91&zoom=1&usg=__9uQWDNYNLV14YioWWbrqPgfa3DQ=&docid=2hhitNyRWjI_DM&hl=en&sa=X&ei=xAfFUIbyG8nzyAHv2YDICg&ved=0CDsQ9QEwAQ

I am using a map

map <double, double> hash_table

I need a key value to be determined from pairs (i, k) to hash to to value for that (i, k)

So far I was only able to come up with linear functions such as:
double Hash_function(int i, int k)

{
    //double val = pow(i, k) + i;
    //return (val % 4294967296);
    return (i*3.1415 + k*i*9.12341); 
}

However, I cannot determine a unique key with a certain (i, k). What kind of functions can I use to help me do so?

  • 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. Editorial Team
    Editorial Team
    2026-06-15T17:44:39+00:00Added an answer on June 15, 2026 at 5:44 pm

    Mathematically speaking, you are seeking a bijection. This is not a hash function in the computer science sense because hash functions are expected to produce collisions on occasion (unless it is a perfect hash function).

    What you have labeled hash_table is not a hash table. std::map is a different data structure called an ordered map, and it is able to use any key type for which the less-than operator < provides a strict weak ordering. You can, in fact, use std::pair from the utility header:

    std::map<std::pair<int, int>, double> table;
    

    To insert into the table, you would use:

    table[std::make_pair(i, j)] = value;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to determine a rank for each key in a hash against the
Trying to determine if it is possible to bind the SelectedValue of a ComboBox
I'm trying to determine if a character falls within a given range. I've searched,
I am trying to determine the point at which a line segment intersect a
I am trying to determine if a Telerik RadMaskedTextBox allows multiline input. I the
I'm trying to determine which is the right way to code a DAO for
Im trying to determine where a shot will hit the wall from a position
im trying to implement a hash function in python. Would you consider the following
I'm trying determine if it's possible in C# to have a generic class that
Am trying to determine the best way to persist information from an originating email,

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.