The document discusses hashing and its components. [1] It describes how hashing works by mapping keys to locations in a hash table using a hash function. [2] Common collision resolution techniques are chaining, linear probing, quadratic probing, and double hashing. [3] Hashing provides fast average-case performance of O(1) by storing data in blocks based on the hash value and load factor.
At the beginning, the number of elements in a set of numbers to be stored in a computer system used to be not so large or having a wide range. Then, using a
simple table T [0, 1, ..., m − 1]called, direct-address table, could be used to store those numbers. As the situation became more and more complex, and a new idea came to be:
Definition
An associative array, map, symbol table, or dictionary is an abstract data type composed of a collection of tuples {(key, value)}
This can bee seen in the example of dictionaries in any spoken language. The problem became more complex when the range of the possible values for the
keys at the tuples became unbounded. Therefore a new type of data structure is needed to avoid the sparsity problem in the data, the hash table.
Hashing notes data structures (HASHING AND HASH FUNCTIONS)Kuntal Bhowmick
A Hash table is a data structure used for storing and retrieving data very quickly. Insertion of data in the hash table is based on the key value. Hence every entry in the hash table is associated with some key.
HASHING AND HASH FUNCTIONS, HASH TABLE REPRESENTATION, HASH FUNCTION, TYPES OF HASH FUNCTIONS, COLLISION, COLLISION RESOLUTION, CHAINING, OPEN ADDRESSING – LINEAR PROBING, QUADRATIC PROBING, DOUBLE HASHING
Hash Tables
The memory available to maintain the symbol table is assumed to be sequential. This memory is referred to as the hash table, HT. The term bucket denotes a unit of storage that can store one or more records. A bucket is typically one disk block size but could be chosen to be smaller or larger than a disk block.
If the number of buckets in a Hash table HT is b, then the buckets are designated HT(0), ... HT(b-1). Each bucket is capable of holding one or more records. The number of records a bucket can store is known as its slot-size. Thus, a bucket is said to consist of s slots, if it can hold s number of records in it.
A function that is used to compute the address of a record in the hash table, is known as a hash function. Usually, s = 1 and in this case each bucket can hold exactly 1 record.
The presentation is an introduction the hash algorithm application, dealing with random data and sorting it for fast accessing and implications with normal hashing techniques.
hashing is encryption process mostly used in programming language for security purpose.
This presentation will you understand all about hashing and also different techniques used in it for encryption process
At the beginning, the number of elements in a set of numbers to be stored in a computer system used to be not so large or having a wide range. Then, using a
simple table T [0, 1, ..., m − 1]called, direct-address table, could be used to store those numbers. As the situation became more and more complex, and a new idea came to be:
Definition
An associative array, map, symbol table, or dictionary is an abstract data type composed of a collection of tuples {(key, value)}
This can bee seen in the example of dictionaries in any spoken language. The problem became more complex when the range of the possible values for the
keys at the tuples became unbounded. Therefore a new type of data structure is needed to avoid the sparsity problem in the data, the hash table.
Hashing notes data structures (HASHING AND HASH FUNCTIONS)Kuntal Bhowmick
A Hash table is a data structure used for storing and retrieving data very quickly. Insertion of data in the hash table is based on the key value. Hence every entry in the hash table is associated with some key.
HASHING AND HASH FUNCTIONS, HASH TABLE REPRESENTATION, HASH FUNCTION, TYPES OF HASH FUNCTIONS, COLLISION, COLLISION RESOLUTION, CHAINING, OPEN ADDRESSING – LINEAR PROBING, QUADRATIC PROBING, DOUBLE HASHING
Hash Tables
The memory available to maintain the symbol table is assumed to be sequential. This memory is referred to as the hash table, HT. The term bucket denotes a unit of storage that can store one or more records. A bucket is typically one disk block size but could be chosen to be smaller or larger than a disk block.
If the number of buckets in a Hash table HT is b, then the buckets are designated HT(0), ... HT(b-1). Each bucket is capable of holding one or more records. The number of records a bucket can store is known as its slot-size. Thus, a bucket is said to consist of s slots, if it can hold s number of records in it.
A function that is used to compute the address of a record in the hash table, is known as a hash function. Usually, s = 1 and in this case each bucket can hold exactly 1 record.
The presentation is an introduction the hash algorithm application, dealing with random data and sorting it for fast accessing and implications with normal hashing techniques.
hashing is encryption process mostly used in programming language for security purpose.
This presentation will you understand all about hashing and also different techniques used in it for encryption process
Introduction to Deep Learning, Keras, and TensorFlowSri Ambati
This meetup was recorded in San Francisco on Jan 9, 2019.
Video recording of the session can be viewed here: https://youtu.be/yG1UJEzpJ64
Description:
This fast-paced session starts with a simple yet complete neural network (no frameworks), followed by an overview of activation functions, cost functions, backpropagation, and then a quick dive into CNNs. Next, we'll create a neural network using Keras, followed by an introduction to TensorFlow and TensorBoard. For best results, familiarity with basic vectors and matrices, inner (aka "dot") products of vectors, and rudimentary Python is definitely helpful. If time permits, we'll look at the UAT, CLT, and the Fixed Point Theorem. (Bonus points if you know Zorn's Lemma, the Well-Ordering Theorem, and the Axiom of Choice.)
Oswald's Bio:
Oswald Campesato is an education junkie: a former Ph.D. Candidate in Mathematics (ABD), with multiple Master's and 2 Bachelor's degrees. In a previous career, he worked in South America, Italy, and the French Riviera, which enabled him to travel to 70 countries throughout the world.
He has worked in American and Japanese corporations and start-ups, as C/C++ and Java developer to CTO. He works in the web and mobile space, conducts training sessions in Android, Java, Angular 2, and ReactJS, and he writes graphics code for fun. He's comfortable in four languages and aspires to become proficient in Japanese, ideally sometime in the next two decades. He enjoys collaborating with people who share his passion for learning the latest cool stuff, and he's currently working on his 15th book, which is about Angular 2.
Introduction to Deep Learning, Keras, and TensorflowOswald Campesato
A fast-paced introduction to Deep Learning concepts, such as activation functions, cost functions, back propagation, and then a quick dive into CNNs. Basic knowledge of vectors, matrices, and derivatives is helpful in order to derive the maximum benefit from this session. Then we'll see how to create a Convolutional Neural Network in Keras, followed by a quick introduction to TensorFlow and TensorBoard.
A fast-paced introduction to Deep Learning concepts, such as activation functions, cost functions, back propagation, and then a quick dive into CNNs, followed by a Keras code sample for defining a CNN. Basic knowledge of vectors, matrices, and derivatives is helpful in order to derive the maximum benefit from this session. Then we'll see a short introduction to TensorFlow 1.x and some insights into TF 2 that will be released some time this year.
"A fast-paced introduction to Deep Learning (DL) concepts, such as neural networks, back propagation, activation functions, and CNNs. We'll also look at JavaScript-based toolkits (such as TensorFire and deeplearning.js) that leverage the power of WebGL. Basic knowledge of elementary calculus (e.g., derivatives) is recommended in order to derive the maximum benefit from this session.
Дмитрий Селиванов, OK.RU. Finding Similar Items in high-dimensional spaces: L...Mail.ru Group
Дмитрий рассказал о методе снижения размерности многомерных данных – Locality Sensitive Hashing. На примере задачи поиска похожих текстовых документов гости был подробно разобран алгоритм Minhash.
The presentation explains the recurrent neural networks warp time.
It considers the invariance to time rescaling and invariance to time warpings with pure warpings and padding.
(Nov 18th, 2019)
Towards Safe Automated Refactoring of Imperative Deep Learning Programs to Gr...Raffi Khatchadourian
Efficiency is essential to support responsiveness w.r.t. ever-growing datasets, especially for Deep Learning (DL) systems. DL frameworks have traditionally embraced deferred execution-style DL code—supporting symbolic, graph-based Deep Neural Network (DNN) computation. While scalable, such development is error-prone, non-intuitive, and difficult to debug. Consequently, more natural, imperative DL frameworks encouraging eager execution have emerged at the expense of run-time performance. Though hybrid approaches aim for the “best of both worlds,” using them effectively requires subtle considerations to make code amenable to safe, accurate, and efficient graph execution. We present our ongoing work on automated refactoring that assists developers in specifying whether and how their otherwise eagerly-executed imperative DL code could be reliably and efficiently executed as graphs while preserving semantics. The approach, based on a novel imperative tensor analysis, will automatically determine when it is safe and potentially advantageous to migrate imperative DL code to graph execution and modify decorator parameters or eagerly executing code already running as graphs. The approach is being implemented as a PyDev Eclipse IDE plug-in and uses the WALA Ariadne analysis framework. We discuss our ongoing work towards optimizing imperative DL code to its full potential.
A fast-paced introduction to Deep Learning concepts, such as activation functions, cost functions, back propagation, followed by some TensorFlow features, and then a code sample of training a CNN in tensorflow.js. Basic knowledge of vectors, matrices, and derivatives is helpful in order to derive the maximum benefit from this session.
Similar to Application of hashing in better alg design tanmay (20)
Embracing GenAI - A Strategic ImperativePeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
Introduction to AI for Nonprofits with Tapp NetworkTechSoup
Dive into the world of AI! Experts Jon Hill and Tareq Monaur will guide you through AI's role in enhancing nonprofit websites and basic marketing strategies, making it easy to understand and apply.
Normal Labour/ Stages of Labour/ Mechanism of LabourWasim Ak
Normal labor is also termed spontaneous labor, defined as the natural physiological process through which the fetus, placenta, and membranes are expelled from the uterus through the birth canal at term (37 to 42 weeks
Macroeconomics- Movie Location
This will be used as part of your Personal Professional Portfolio once graded.
Objective:
Prepare a presentation or a paper using research, basic comparative analysis, data organization and application of economic information. You will make an informed assessment of an economic climate outside of the United States to accomplish an entertainment industry objective.
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Dr. Vinod Kumar Kanvaria
Exploiting Artificial Intelligence for Empowering Researchers and Faculty,
International FDP on Fundamentals of Research in Social Sciences
at Integral University, Lucknow, 06.06.2024
By Dr. Vinod Kumar Kanvaria
2. AGENDA
Dictionaries,
Symbol table and their
implementation
Series_VIT University
TanmaySinha_Student Seminar
What is Hashing…..Why
Hashing????
Components
Comparison of techniques
Time Complexity
Examples
3. DICTIONARIES
Real time examples of dictionaries
Spelling Checker
Series_VIT University
TanmaySinha_Student Seminar
Symbol tables generated by assemblers and
compilers
Routing tables used in networking
components(for DNS lookup)
4. SYMBOL TABLEA MODIFIED DICTIONARY
Data structure that associates a value with
key
Basic operations allowed
Series_VIT University
TanmaySinha_Student Seminar
Implemented using
1)Arrays(Unordered/Ordered)-O(n), O(n) /O(lg n)
2)Linked List(Ordered/Unordered)-O(n)
3)Binary Search Trees-O(lg n)
4)HASHING….!!!!
THE “DREADED” TAG of TIME
COMPLEXITY of an algorithm..!!!!!
5. UNDERSTANDING HASHING
ArraysHash Table
Example Design an algorithm for printing the
Series_VIT University
TanmaySinha_Student Seminar
1st repeated character, if there are duplicate
elements in it……!!!!!!
Possible Solutions From Brute Force Approach to a
better solution
IF ARRAYS ARE THERE……WHY
HASHING…?????
Map Keys to locations…!!!
6. COMPONENTS IN HASHING
Hash Table
1)Generalization of an array
Series_VIT University
TanmaySinha_Student Seminar
2)Direct addressing
3)ProblemsLess Locations and more possible
keysanalogous to VIRTUAL MEMORY concept
Basically , a hash table is a data structure that
stores the keys and their associated values!!!
7. COMPONENTS IN HASHING…CONTD
Hash Function
1)Transform the key to index, ‘k’ to ‘h(k)’….thereby
reducing range of array indices!!
Series_VIT University
TanmaySinha_Student Seminar
2)Characteristics of Good Hash fn
Minimize collision
Be quick and easy to compare
Distribute key values evenly in the hash table
Use all the information provided in the key
Have a high load factor for a given set of keys
8. COMPONENTS IN HASHING…CONTD
DEFINING TERMS
1. Load Factor No. of elements in hash
Series_VIT University
TanmaySinha_Student Seminar
table/hash table size=n/m
2. Collisions2 records stored in same memory
location
What if the keys are non-integers…???
Choice of x=33,37,39,41 gives atmost 6
collisions on a vocabulary of 50000 elglish
words!!!!!!!!
9. COLLISION RESOLUTION
TECHNIQUES
Process of finding an alternate location
Direct Chaining- array of linked lists –
Series_VIT University
TanmaySinha_Student Seminar
Separate chaining
Open Addressing – array based – Linear
Probing, Quadratic probing , Double Hashing
10. CHAINING
Slot ‘x’ contains a pointer(reference) to head
of the list of all the stored elements that hash to
‘x’
Analogous to adjacency matrix
Series_VIT University
TanmaySinha_Student Seminar
representation of graphs
Doubly Linked list preferable Given the
node’s address, it helps to delete quickly(takes an
i/p element ‘x’ and not it’s key ‘k’)
Worst case behaviour is terribleall ‘n’ keys
hash to the same slot,creating a list of length ‘n’
Avg. Case behaviour can be improved , if we
assume that any given element in equally likely
to hash into any of the table slotsSIMPLE
UNIFORM HASHING!!!!
11. LINEAR PROBING
Search Sequentially If location occupied, check
next location
Restrictionno. of elements inserted into the table <
Series_VIT University
TanmaySinha_Student Seminar
table size
Fn. For rehashing
H(Key)= (n+1) % tablesize
Problems – Clustering!!!
Importance of Tablesizeshould be prime,should
not be a power of 2
PROBLEM IN DELETION->use of tombstones!!!!
13. QUADRATIC PROBING
Our main requirement now is to eliminate
CLUSTERING problem
Series_VIT University
TanmaySinha_Student Seminar
Instead of step size 1 , if the location is
occupied check at locations i+12 , i+22 ……
Fn. For rehashing
H(Key)= (n+k2 ) % tablesize
15. DOUBLE HASHING
Reduces Clustering in a better way.
Use of a 2nd hash function h2(offset), such that h2!=0
Series_VIT University
TanmaySinha_Student Seminar
and h2!=h1
Concept
First probe at location h1
If it’s occupied, probe at location
(probe+k*offset)(h1+h2) , (h1+2*h2)…….
Specialized case is Linear Probing offset is 1
If Size of table is prime, then the technique
ensures we look at all table locations.
16. EXAMPLE
0
H1(key)= key% 11
1 H2(key)=7-(key%7)
2 58 % 11=3
Series_VIT University
TanmaySinha_Student Seminar
3 58 14 % 11=33+7=10
4 91% 11=33+73+2*7
%11= 6
5
25%11=33+33+2*3=9
6 91
7
(key%7) lies between 0
8 and 6, so that h2 always
9 25 lies between 1 and 7
10 14
17. COMPARISON
Linear Probing Quadratic probing Double Hashing
Fastest amongst three Easier to implement and Makes more efficient use
deploy of memory
Series_VIT University
TanmaySinha_Student Seminar
Uses few probes Uses extra memory for Uses few probes but
links + does not probe all takes more time
table locations
Problem of Primary Problem of Secondary More complicated to
Clustering Clustering implement
Interval between probes Interval between probes Interval between probes
is fixed – often at 1 increases proportional to is computed by another
hash value hash function
18. HOW DOES HASHING GET O(1)
COMPLEXITY???
Each block(may be a linked list) on the avg. stores max. no.
of elements less than the “Load Factor(lf)”
Generally “Load Factor” is constant So,searching time
Series_VIT University
TanmaySinha_Student Seminar
becomes constant
Rehashing the elements with bigger hash table size , if
avg. no. of elements in block is > Load Factor
Access time of table depends on Load factor, which in-turn
depends on Hash Function
Unsuccessful/Successful Search For chaining.Total
time = O(1+lf), including time req. to compute h(k)
Unsuccessful/Successful Search For Probing.Total
time = O(1/(1+lf)), including time req. to compute h(k)
19. EXTRA POINTS
Static Hashing data is staticset of keys fixed
ExampleSet of reserved words in a programming
Series_VIT University
TanmaySinha_Student Seminar
language, set of file names on CD-ROM
Dynamic Hashingkeys can change dynamically.
Example Cache design, Hash functions in
Cryptography
20. A ONE-WAY HASH FUNCTION TAKES VARIABLE-LENGTH INPUT—IN THIS
CASE, A MESSAGE OF ANY LENGTH, EVEN THOUSANDS OR MILLIONS OF
BITS—AND PRODUCES A FIXED-LENGTH OUTPUT; SAY, 160-
BITS(MESSAGE DIGEST)
hash function
Series_VIT University
TanmaySinha_Student Seminar
plaintext
digest signed
with private
key
message digest plaintext
+
signature
private key
use for
signing
21. PROBLEM 1
Can you Give an algorithm for finding the 1st non
repeated character in the string????? For e.g, the
1st non repeated character in the string “abzddab”
is ‘z’
Series_VIT University
TanmaySinha_Student Seminar
Brute Force approach Improvement using
For each character in the hash tables
string, scan the remaining Create a hash table by
string….If that character reading all characters in i/p
doesn’t appear, we’re done string and keep their
with the solution, else we count.
move to the next character After creating hash table,
O(n2 ) just read the hash table
entries to find out, which
element has count = 1
O(n)
22. PROBLEM 2
Given an array of ‘n’ elements. Find 2
elements in the array whose sum is equal to
given element ‘K’
Alternative Approach
Brute ForceO(n2 )
Series_VIT University
TanmaySinha_Student Seminar
ObejctiveA[x]+A[y]=K
Improving Time
ComplexityO(nlgn) Insert A[x] into hash table.
Before moving to next
Maintain 2 indices ‘low=0’
element,check whether K-
and ‘high=n-1’.
A[x] also exists in hash
Compute A[low]+A[high] table.
If sum is < K, decrement Existence of such a no.
‘high’ , else increment ‘low’ means that we are able to
If sum = K, that’s the find the indices.
solution…BINGO!!! Else,proceed to next i/p
element.
O(n)