SlideShare a Scribd company logo
1 of 4
In computer science, a space–time or time–memory tradeoff is a situation where
the memory use can be reduced at the cost of slower program execution (and, conversely,
the computation time can be reduced at the cost of increased memory use). As the relative
costs of CPU cycles, RAM space, and hard drive space change—hard drive space has for some
time been getting cheaper at a much faster rate than other components of computers[citation
needed]
       —the appropriate choices for space–time tradeoffs have changed radically. Often, by
exploiting a space–time tradeoff, a program can be made to run much faster.
N COMPUTER SCIENCE, A SPACE-TIME OR TIME-MEMORY TRADEOFF IS A
SITUATION WHERE THE MEMORY USE CAN BE REDUCED AT THE COST OF
SLOWER PROGRAM EXECUTION (OR, VICE VERSA, THE COMPUTATION TIME CAN
BE REDUCED AT THE COST OF INCREASED MEMORY USE). AS THE RELATIVE
COSTS OF CPU CYCLES, RAM SPACE, AND HARD DRIVE SPACE CHANGE HARD
DRIVE SPACE HAS FOR SOME TIME BEEN GETTING CHEAPER AT A MUCH FASTER
RATE THAN OTHER COMPONENTS OF COMPUTERS. THE APPROPRIATE CHOICES
FOR SPACE-TIME TRADEOFFS HAVE CHANGED RADICALLY. OFTEN, BY
EXPLOITING A SPACE-TIME TRADEOFF, A PROGRAM CAN BE MADE TO RUN MUCH
FASTER.
THE MOST COMMON SITUATION IS AN ALGORITHM INVOLVING A LOOKUP TABLE:
AN IMPLEMENTATION CAN INCLUDE THE ENTIRE TABLE, WHICH REDUCES
COMPUTING TIME, BUT INCREASES THE AMOUNT OF MEMORY NEEDED, OR IT
CAN COMPUTE TABLE ENTRIES AS NEEDED, INCREASING COMPUTING TIME, BUT
REDUCING MEMORY REQUIREMENTS. A SPACE-TIME TRADEOFF CAN BE APPLIED
TO THE PROBLEM OF DATA STORAGE. IF DATA IS STORED UNCOMPRESSED, IT
TAKES MORE SPACE BUT LESS TIME THAN IF THE DATA WERE STORED
COMPRESSED (SINCE COMPRESSING THE DATA REDUCES THE AMOUNT OF
SPACE IT TAKES, BUT IT TAKES TIME TO RUN THECOMPRESSION ALGORITHM).
DEPENDING ON THE PARTICULAR INSTANCE OF THE PROBLEM, EITHER WAY IS
PRACTICAL. ANOTHER EXAMPLE IS DISPLAYING MATHEMATICAL FORMULAE ON
PRIMARILY TEXT-BASED WEBSITES, SUCH AS WIKIPEDIA.
Storing only the LaTeX source and rendering it as an image every time the page is
requested would be trading time for space - more time used, but less space. Rendering the
image when the page is changed and storing the rendered images would be trading space
for time - more space used, but less time. Note that there are also rare instances where it is
possible to directly work with compressed data, such as in the case of compressed bitmap
indices, where it is faster to work with compression than without compression. Larger code
size can be traded for higher program speed when applying loop unrolling. This technique
makes the code longer for each iteration of a loop, but saves the computation time required
for jumping back to the beginning of the loop at the end of each iteration. Algorithms that
also make use of space-time tradeoffs include:
BABY-STEP GIANT-STEP ALGORITHM FOR CALCULATING DISCRETE LOGARITHMS.
RAINBOW TABLES IN CRYPTOGRAPHY, WHERE THE ADVERSARY IS TRYING TO DO
BETTER THAN THE EXPONENTIAL TIME REQUIRED FOR A BRUTE FORCE ATTACK.
RAINBOW TABLES USE PARTIALLY PRECOMPUTED VALUES IN THE HASH SPACE
OF A CRYPTOGRAPHIC HASH FUNCTION TO CRACK PASSWORDS IN MINUTES
INSTEAD OF WEEKS. DECREASING THE SIZE OF THE RAINBOW TABLE INCREASES
THE TIME REQUIRED TO ITERATE OVER THE HASH SPACE.
THE MEET-IN-THE-MIDDLE ATTACK USES A SPACE-TIME TRADEOFF TO FIND THE
CRYPTOGRAPHIC KEY IN ONLY 2N + 1 ENCRYPTIONS (AND O(2N) SPACE) VERSUS
THE EXPECTED 22N ENCRYPTIONS (BUT ONLY O(1) SPACE) OF THE NAIVE
ATTACK.
DYNAMIC PROGRAMMING, WHERE THE TIME COMPLEXITY OF A PROBLEM CAN BE
REDUCED SIGNIFICANTLY BY USING MORE MEMORY.

More Related Content

Viewers also liked

From 3 stars to 5 stars in the Apple Store
From 3 stars to 5 stars in the Apple StoreFrom 3 stars to 5 stars in the Apple Store
From 3 stars to 5 stars in the Apple StoreJavier Moscardó
 
B2 b marketing-manifesto-velocity-partners
B2 b marketing-manifesto-velocity-partnersB2 b marketing-manifesto-velocity-partners
B2 b marketing-manifesto-velocity-partnersFrancesca Diana Radice
 
Educational tools for Learning and Teaching 2015 2 July 2015 at PIS 2015
Educational tools for Learning and Teaching 2015 2 July 2015 at PIS 2015Educational tools for Learning and Teaching 2015 2 July 2015 at PIS 2015
Educational tools for Learning and Teaching 2015 2 July 2015 at PIS 2015SHAKINAZ DESA
 
Designing an integrative learning
Designing an integrative learningDesigning an integrative learning
Designing an integrative learningSHAKINAZ DESA
 
Ax 1 compon. 1- part 2
Ax 1  compon. 1- part 2Ax 1  compon. 1- part 2
Ax 1 compon. 1- part 2Nathalie Ross
 
Fuel50 overview
Fuel50 overview  Fuel50 overview
Fuel50 overview Jo Mills
 
Niche area discussion 27 april
Niche area discussion 27 aprilNiche area discussion 27 april
Niche area discussion 27 aprilSHAKINAZ DESA
 
Audit stage 2 2014 taklimat
Audit stage 2 2014 taklimat Audit stage 2 2014 taklimat
Audit stage 2 2014 taklimat SHAKINAZ DESA
 
Kemahiran guling belakng (2)
Kemahiran guling belakng (2)Kemahiran guling belakng (2)
Kemahiran guling belakng (2)Tan Siow Hoon
 
Workforce development program_toolkit_august04
Workforce development program_toolkit_august04Workforce development program_toolkit_august04
Workforce development program_toolkit_august04Khaled Qureshi
 
Topic 5 Muscular System
Topic 5  Muscular System Topic 5  Muscular System
Topic 5 Muscular System SHAKINAZ DESA
 
Topic 7 Photosynthesis
Topic 7  PhotosynthesisTopic 7  Photosynthesis
Topic 7 PhotosynthesisSHAKINAZ DESA
 

Viewers also liked (18)

From 3 stars to 5 stars in the Apple Store
From 3 stars to 5 stars in the Apple StoreFrom 3 stars to 5 stars in the Apple Store
From 3 stars to 5 stars in the Apple Store
 
B2 b marketing-manifesto-velocity-partners
B2 b marketing-manifesto-velocity-partnersB2 b marketing-manifesto-velocity-partners
B2 b marketing-manifesto-velocity-partners
 
Educational tools for Learning and Teaching 2015 2 July 2015 at PIS 2015
Educational tools for Learning and Teaching 2015 2 July 2015 at PIS 2015Educational tools for Learning and Teaching 2015 2 July 2015 at PIS 2015
Educational tools for Learning and Teaching 2015 2 July 2015 at PIS 2015
 
Bug prevention at Spotify
Bug prevention at SpotifyBug prevention at Spotify
Bug prevention at Spotify
 
Designing an integrative learning
Designing an integrative learningDesigning an integrative learning
Designing an integrative learning
 
Bab 3
Bab 3Bab 3
Bab 3
 
Routeoutline
RouteoutlineRouteoutline
Routeoutline
 
In the Swarm by Mike Kent
In the Swarm by Mike KentIn the Swarm by Mike Kent
In the Swarm by Mike Kent
 
002
002002
002
 
Ax 1 compon. 1- part 2
Ax 1  compon. 1- part 2Ax 1  compon. 1- part 2
Ax 1 compon. 1- part 2
 
Fuel50 overview
Fuel50 overview  Fuel50 overview
Fuel50 overview
 
Niche area discussion 27 april
Niche area discussion 27 aprilNiche area discussion 27 april
Niche area discussion 27 april
 
Audit stage 2 2014 taklimat
Audit stage 2 2014 taklimat Audit stage 2 2014 taklimat
Audit stage 2 2014 taklimat
 
Kemahiran guling belakng (2)
Kemahiran guling belakng (2)Kemahiran guling belakng (2)
Kemahiran guling belakng (2)
 
Net303 a2a radice
Net303 a2a radiceNet303 a2a radice
Net303 a2a radice
 
Workforce development program_toolkit_august04
Workforce development program_toolkit_august04Workforce development program_toolkit_august04
Workforce development program_toolkit_august04
 
Topic 5 Muscular System
Topic 5  Muscular System Topic 5  Muscular System
Topic 5 Muscular System
 
Topic 7 Photosynthesis
Topic 7  PhotosynthesisTopic 7  Photosynthesis
Topic 7 Photosynthesis
 

Similar to Doc5

Parallel Algorithms Advantages and Disadvantages
Parallel Algorithms Advantages and DisadvantagesParallel Algorithms Advantages and Disadvantages
Parallel Algorithms Advantages and DisadvantagesMurtadha Alsabbagh
 
MongoDB Sharding
MongoDB ShardingMongoDB Sharding
MongoDB Shardinguzzal basak
 
Efficient Management for Hybrid Memory in Managed Language Runtime
Efficient Management for Hybrid Memory in Managed Language RuntimeEfficient Management for Hybrid Memory in Managed Language Runtime
Efficient Management for Hybrid Memory in Managed Language RuntimeChenxi Wang
 
Limitations of memory system performance
Limitations of memory system performanceLimitations of memory system performance
Limitations of memory system performanceSyed Zaid Irshad
 
algocomplexity cost effective tradeoff in
algocomplexity cost effective tradeoff inalgocomplexity cost effective tradeoff in
algocomplexity cost effective tradeoff injaved75
 
Virtual memory pre-final-formatting
Virtual memory pre-final-formattingVirtual memory pre-final-formatting
Virtual memory pre-final-formattingmarangburu42
 
Unit iiios Storage Management
Unit iiios Storage ManagementUnit iiios Storage Management
Unit iiios Storage Managementdonny101
 
Optimal Round Robin CPU Scheduling Algorithm using Manhattan Distance
Optimal Round Robin CPU Scheduling Algorithm using Manhattan Distance Optimal Round Robin CPU Scheduling Algorithm using Manhattan Distance
Optimal Round Robin CPU Scheduling Algorithm using Manhattan Distance IJECEIAES
 
Chapter 9 OS
Chapter 9 OSChapter 9 OS
Chapter 9 OSC.U
 
Cost-Efficient Task Scheduling with Ant Colony Algorithm for Executing Large ...
Cost-Efficient Task Scheduling with Ant Colony Algorithm for Executing Large ...Cost-Efficient Task Scheduling with Ant Colony Algorithm for Executing Large ...
Cost-Efficient Task Scheduling with Ant Colony Algorithm for Executing Large ...Editor IJCATR
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual Memoryvampugani
 

Similar to Doc5 (20)

Ie3313971401
Ie3313971401Ie3313971401
Ie3313971401
 
Ie3313971401
Ie3313971401Ie3313971401
Ie3313971401
 
Parallel Algorithms Advantages and Disadvantages
Parallel Algorithms Advantages and DisadvantagesParallel Algorithms Advantages and Disadvantages
Parallel Algorithms Advantages and Disadvantages
 
Ijetr012049
Ijetr012049Ijetr012049
Ijetr012049
 
MongoDB Sharding
MongoDB ShardingMongoDB Sharding
MongoDB Sharding
 
Chap2 slides
Chap2 slidesChap2 slides
Chap2 slides
 
Efficient Management for Hybrid Memory in Managed Language Runtime
Efficient Management for Hybrid Memory in Managed Language RuntimeEfficient Management for Hybrid Memory in Managed Language Runtime
Efficient Management for Hybrid Memory in Managed Language Runtime
 
Limitations of memory system performance
Limitations of memory system performanceLimitations of memory system performance
Limitations of memory system performance
 
My sql
My sqlMy sql
My sql
 
algocomplexity cost effective tradeoff in
algocomplexity cost effective tradeoff inalgocomplexity cost effective tradeoff in
algocomplexity cost effective tradeoff in
 
Virtual memory pre-final-formatting
Virtual memory pre-final-formattingVirtual memory pre-final-formatting
Virtual memory pre-final-formatting
 
Unit iiios Storage Management
Unit iiios Storage ManagementUnit iiios Storage Management
Unit iiios Storage Management
 
Module 4 memory management
Module 4 memory managementModule 4 memory management
Module 4 memory management
 
Operating System
Operating SystemOperating System
Operating System
 
Optimal Round Robin CPU Scheduling Algorithm using Manhattan Distance
Optimal Round Robin CPU Scheduling Algorithm using Manhattan Distance Optimal Round Robin CPU Scheduling Algorithm using Manhattan Distance
Optimal Round Robin CPU Scheduling Algorithm using Manhattan Distance
 
Dynamic loading
Dynamic loadingDynamic loading
Dynamic loading
 
Chapter 9 OS
Chapter 9 OSChapter 9 OS
Chapter 9 OS
 
Cost-Efficient Task Scheduling with Ant Colony Algorithm for Executing Large ...
Cost-Efficient Task Scheduling with Ant Colony Algorithm for Executing Large ...Cost-Efficient Task Scheduling with Ant Colony Algorithm for Executing Large ...
Cost-Efficient Task Scheduling with Ant Colony Algorithm for Executing Large ...
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual Memory
 
Ijetr012052
Ijetr012052Ijetr012052
Ijetr012052
 

Doc5

  • 1.
  • 2. In computer science, a space–time or time–memory tradeoff is a situation where the memory use can be reduced at the cost of slower program execution (and, conversely, the computation time can be reduced at the cost of increased memory use). As the relative costs of CPU cycles, RAM space, and hard drive space change—hard drive space has for some time been getting cheaper at a much faster rate than other components of computers[citation needed] —the appropriate choices for space–time tradeoffs have changed radically. Often, by exploiting a space–time tradeoff, a program can be made to run much faster.
  • 3. N COMPUTER SCIENCE, A SPACE-TIME OR TIME-MEMORY TRADEOFF IS A SITUATION WHERE THE MEMORY USE CAN BE REDUCED AT THE COST OF SLOWER PROGRAM EXECUTION (OR, VICE VERSA, THE COMPUTATION TIME CAN BE REDUCED AT THE COST OF INCREASED MEMORY USE). AS THE RELATIVE COSTS OF CPU CYCLES, RAM SPACE, AND HARD DRIVE SPACE CHANGE HARD DRIVE SPACE HAS FOR SOME TIME BEEN GETTING CHEAPER AT A MUCH FASTER RATE THAN OTHER COMPONENTS OF COMPUTERS. THE APPROPRIATE CHOICES FOR SPACE-TIME TRADEOFFS HAVE CHANGED RADICALLY. OFTEN, BY EXPLOITING A SPACE-TIME TRADEOFF, A PROGRAM CAN BE MADE TO RUN MUCH FASTER. THE MOST COMMON SITUATION IS AN ALGORITHM INVOLVING A LOOKUP TABLE: AN IMPLEMENTATION CAN INCLUDE THE ENTIRE TABLE, WHICH REDUCES COMPUTING TIME, BUT INCREASES THE AMOUNT OF MEMORY NEEDED, OR IT CAN COMPUTE TABLE ENTRIES AS NEEDED, INCREASING COMPUTING TIME, BUT REDUCING MEMORY REQUIREMENTS. A SPACE-TIME TRADEOFF CAN BE APPLIED TO THE PROBLEM OF DATA STORAGE. IF DATA IS STORED UNCOMPRESSED, IT TAKES MORE SPACE BUT LESS TIME THAN IF THE DATA WERE STORED COMPRESSED (SINCE COMPRESSING THE DATA REDUCES THE AMOUNT OF SPACE IT TAKES, BUT IT TAKES TIME TO RUN THECOMPRESSION ALGORITHM). DEPENDING ON THE PARTICULAR INSTANCE OF THE PROBLEM, EITHER WAY IS PRACTICAL. ANOTHER EXAMPLE IS DISPLAYING MATHEMATICAL FORMULAE ON PRIMARILY TEXT-BASED WEBSITES, SUCH AS WIKIPEDIA. Storing only the LaTeX source and rendering it as an image every time the page is requested would be trading time for space - more time used, but less space. Rendering the image when the page is changed and storing the rendered images would be trading space for time - more space used, but less time. Note that there are also rare instances where it is possible to directly work with compressed data, such as in the case of compressed bitmap indices, where it is faster to work with compression than without compression. Larger code size can be traded for higher program speed when applying loop unrolling. This technique makes the code longer for each iteration of a loop, but saves the computation time required for jumping back to the beginning of the loop at the end of each iteration. Algorithms that also make use of space-time tradeoffs include: BABY-STEP GIANT-STEP ALGORITHM FOR CALCULATING DISCRETE LOGARITHMS. RAINBOW TABLES IN CRYPTOGRAPHY, WHERE THE ADVERSARY IS TRYING TO DO BETTER THAN THE EXPONENTIAL TIME REQUIRED FOR A BRUTE FORCE ATTACK. RAINBOW TABLES USE PARTIALLY PRECOMPUTED VALUES IN THE HASH SPACE OF A CRYPTOGRAPHIC HASH FUNCTION TO CRACK PASSWORDS IN MINUTES INSTEAD OF WEEKS. DECREASING THE SIZE OF THE RAINBOW TABLE INCREASES THE TIME REQUIRED TO ITERATE OVER THE HASH SPACE. THE MEET-IN-THE-MIDDLE ATTACK USES A SPACE-TIME TRADEOFF TO FIND THE CRYPTOGRAPHIC KEY IN ONLY 2N + 1 ENCRYPTIONS (AND O(2N) SPACE) VERSUS THE EXPECTED 22N ENCRYPTIONS (BUT ONLY O(1) SPACE) OF THE NAIVE
  • 4. ATTACK. DYNAMIC PROGRAMMING, WHERE THE TIME COMPLEXITY OF A PROBLEM CAN BE REDUCED SIGNIFICANTLY BY USING MORE MEMORY.