SlideShare ist ein Scribd-Unternehmen logo
1 von 3
Please see the figure in the inset for an illustration. Let us suppose each task can have “2―
different (latency,power) operating modes. Also the latency values of these modes are the same
while power values are different (across tasks). Hence two tasks s1 and s2 will have different
power values but same latency values for their operating modes.
You are given a cumulative latency constraint T.
Give an algorithm which allocates an operating mode to each task subject to latency constraints
while minimizing the total power. Does your algorithm run in polynomial time (while
guaranteeing correct results)? (if it helps, you can assume the latency, power and T are all
integers). { Use 0 1 Knapsack} C++ code is required dynamic prograaming matrix required
Q2) ) Let us suppose n=2. Let us suppose that the power vs latency relationship is linear and
latency can take any positive value as long as it is less than some MAX constraint (not subject to
an integer number of distinct states). Describe a formal approach to finding the best operating
mode for the two tasks subject to T (latency constraints) while minimizing the total power. In
this context an operating mode is an allocation of latency for each task.
Solution
#include<iostream.h>
#include<conio.h>
class S
{
private:
int por;
int lat;
int* s;
public:
S();
S(int M, int N);
~S();
};
S::S()
{
int * s = NULL;
}
S::S(int N)
{
int * s = new int[N * N];
this->por = N;
this->cols = N;
for(int i = 0; i < N; i++){
for(int j = 0; j < N; j++){
if(i==j)
s[i * N + j] = 1;
else
s[i * N + j] = 0;
}
}
}
S::S(int M, int N){
int * s = new double[M * N];
this->por = M;
this->lat = N;
for(int i = 0; i < M; i++){
for(int j = 0; j < N; j++)
matrix[i * N + j] = 0;
}
}
S::~S(){
delete [] s;
}
void main()
{
S s1,s2;
int n;
s1=new S(n);
s2=new S(n);
getch();
}
Please see the figure in the inset for an illustration- Let us suppose.docx

Weitere ähnliche Inhalte

Ähnlich wie Please see the figure in the inset for an illustration- Let us suppose.docx

Lec03 04-time complexity
Lec03 04-time complexityLec03 04-time complexity
Lec03 04-time complexityAbbas Ali
 
Novel Logic Circuits Dynamic Parameters Analysis
Novel Logic Circuits Dynamic Parameters AnalysisNovel Logic Circuits Dynamic Parameters Analysis
Novel Logic Circuits Dynamic Parameters Analysiscsandit
 
ASYMTOTIC NOTATIONS BIG O OEMGA THETE NOTATION.pptx
ASYMTOTIC NOTATIONS BIG O OEMGA THETE NOTATION.pptxASYMTOTIC NOTATIONS BIG O OEMGA THETE NOTATION.pptx
ASYMTOTIC NOTATIONS BIG O OEMGA THETE NOTATION.pptxsunitha1792
 
Algorithm And analysis Lecture 03& 04-time complexity.
 Algorithm And analysis Lecture 03& 04-time complexity. Algorithm And analysis Lecture 03& 04-time complexity.
Algorithm And analysis Lecture 03& 04-time complexity.Tariq Khan
 
Aad introduction
Aad introductionAad introduction
Aad introductionMr SMAK
 
Basic Computer Engineering Unit II as per RGPV Syllabus
Basic Computer Engineering Unit II as per RGPV SyllabusBasic Computer Engineering Unit II as per RGPV Syllabus
Basic Computer Engineering Unit II as per RGPV SyllabusNANDINI SHARMA
 
VCE Unit 01 (2).pptx
VCE Unit 01 (2).pptxVCE Unit 01 (2).pptx
VCE Unit 01 (2).pptxskilljiolms
 
Sienna 2 analysis
Sienna 2 analysisSienna 2 analysis
Sienna 2 analysischidabdu
 
Module 1 notes of data warehousing and data
Module 1 notes of data warehousing and dataModule 1 notes of data warehousing and data
Module 1 notes of data warehousing and datavijipersonal2012
 
One More Comments on Programming with Big Number Library in Scientific Computing
One More Comments on Programming with Big Number Library in Scientific ComputingOne More Comments on Programming with Big Number Library in Scientific Computing
One More Comments on Programming with Big Number Library in Scientific Computingtheijes
 
Stack squeues lists
Stack squeues listsStack squeues lists
Stack squeues listsJames Wong
 
Stacksqueueslists
StacksqueueslistsStacksqueueslists
StacksqueueslistsFraboni Ec
 
Stacks queues lists
Stacks queues listsStacks queues lists
Stacks queues listsYoung Alista
 
Stacks queues lists
Stacks queues listsStacks queues lists
Stacks queues listsTony Nguyen
 
Stacks queues lists
Stacks queues listsStacks queues lists
Stacks queues listsHarry Potter
 
DAA-Unit1.pptx
DAA-Unit1.pptxDAA-Unit1.pptx
DAA-Unit1.pptxNishaS88
 
Data Structures and Algorithms Lecture 2: Analysis of Algorithms, Asymptotic ...
Data Structures and Algorithms Lecture 2: Analysis of Algorithms, Asymptotic ...Data Structures and Algorithms Lecture 2: Analysis of Algorithms, Asymptotic ...
Data Structures and Algorithms Lecture 2: Analysis of Algorithms, Asymptotic ...TechVision8
 
Some Engg. Applications of Matrices and Partial Derivatives
Some Engg. Applications of Matrices and Partial DerivativesSome Engg. Applications of Matrices and Partial Derivatives
Some Engg. Applications of Matrices and Partial DerivativesSanjaySingh011996
 

Ähnlich wie Please see the figure in the inset for an illustration- Let us suppose.docx (20)

Lec03 04-time complexity
Lec03 04-time complexityLec03 04-time complexity
Lec03 04-time complexity
 
Novel Logic Circuits Dynamic Parameters Analysis
Novel Logic Circuits Dynamic Parameters AnalysisNovel Logic Circuits Dynamic Parameters Analysis
Novel Logic Circuits Dynamic Parameters Analysis
 
ASYMTOTIC NOTATIONS BIG O OEMGA THETE NOTATION.pptx
ASYMTOTIC NOTATIONS BIG O OEMGA THETE NOTATION.pptxASYMTOTIC NOTATIONS BIG O OEMGA THETE NOTATION.pptx
ASYMTOTIC NOTATIONS BIG O OEMGA THETE NOTATION.pptx
 
Algorithm And analysis Lecture 03& 04-time complexity.
 Algorithm And analysis Lecture 03& 04-time complexity. Algorithm And analysis Lecture 03& 04-time complexity.
Algorithm And analysis Lecture 03& 04-time complexity.
 
Aad introduction
Aad introductionAad introduction
Aad introduction
 
Basic Computer Engineering Unit II as per RGPV Syllabus
Basic Computer Engineering Unit II as per RGPV SyllabusBasic Computer Engineering Unit II as per RGPV Syllabus
Basic Computer Engineering Unit II as per RGPV Syllabus
 
VCE Unit 01 (2).pptx
VCE Unit 01 (2).pptxVCE Unit 01 (2).pptx
VCE Unit 01 (2).pptx
 
Sienna 2 analysis
Sienna 2 analysisSienna 2 analysis
Sienna 2 analysis
 
Module 1 notes of data warehousing and data
Module 1 notes of data warehousing and dataModule 1 notes of data warehousing and data
Module 1 notes of data warehousing and data
 
Clojure basics
Clojure basicsClojure basics
Clojure basics
 
One More Comments on Programming with Big Number Library in Scientific Computing
One More Comments on Programming with Big Number Library in Scientific ComputingOne More Comments on Programming with Big Number Library in Scientific Computing
One More Comments on Programming with Big Number Library in Scientific Computing
 
Stack squeues lists
Stack squeues listsStack squeues lists
Stack squeues lists
 
Stacksqueueslists
StacksqueueslistsStacksqueueslists
Stacksqueueslists
 
Stacks queues lists
Stacks queues listsStacks queues lists
Stacks queues lists
 
Stacks queues lists
Stacks queues listsStacks queues lists
Stacks queues lists
 
Stacks queues lists
Stacks queues listsStacks queues lists
Stacks queues lists
 
Stacks queues lists
Stacks queues listsStacks queues lists
Stacks queues lists
 
DAA-Unit1.pptx
DAA-Unit1.pptxDAA-Unit1.pptx
DAA-Unit1.pptx
 
Data Structures and Algorithms Lecture 2: Analysis of Algorithms, Asymptotic ...
Data Structures and Algorithms Lecture 2: Analysis of Algorithms, Asymptotic ...Data Structures and Algorithms Lecture 2: Analysis of Algorithms, Asymptotic ...
Data Structures and Algorithms Lecture 2: Analysis of Algorithms, Asymptotic ...
 
Some Engg. Applications of Matrices and Partial Derivatives
Some Engg. Applications of Matrices and Partial DerivativesSome Engg. Applications of Matrices and Partial Derivatives
Some Engg. Applications of Matrices and Partial Derivatives
 

Mehr von rtodd884

Poly-meta-morphic malware looks different each time it is stored on di.docx
Poly-meta-morphic malware looks different each time it is stored on di.docxPoly-meta-morphic malware looks different each time it is stored on di.docx
Poly-meta-morphic malware looks different each time it is stored on di.docxrtodd884
 
Please write a formal summary of the case before proceeding to answer.docx
Please write a formal summary of the case before proceeding to answer.docxPlease write a formal summary of the case before proceeding to answer.docx
Please write a formal summary of the case before proceeding to answer.docxrtodd884
 
Please respond in detail with an example- Thank you! Financial interme.docx
Please respond in detail with an example- Thank you! Financial interme.docxPlease respond in detail with an example- Thank you! Financial interme.docx
Please respond in detail with an example- Thank you! Financial interme.docxrtodd884
 
Problem 1- Text Editor using files and strings using C++ In this proje.docx
Problem 1- Text Editor using files and strings using C++ In this proje.docxProblem 1- Text Editor using files and strings using C++ In this proje.docx
Problem 1- Text Editor using files and strings using C++ In this proje.docxrtodd884
 
Presented below is the balance sheet of Sargent Corporation for the cu.docx
Presented below is the balance sheet of Sargent Corporation for the cu.docxPresented below is the balance sheet of Sargent Corporation for the cu.docx
Presented below is the balance sheet of Sargent Corporation for the cu.docxrtodd884
 
Presented below is information related to Dino Radja Company- Date End.docx
Presented below is information related to Dino Radja Company- Date End.docxPresented below is information related to Dino Radja Company- Date End.docx
Presented below is information related to Dino Radja Company- Date End.docxrtodd884
 
Prepare the journal entry to record salaries payable for the month of.docx
Prepare the journal entry to record salaries payable for the month of.docxPrepare the journal entry to record salaries payable for the month of.docx
Prepare the journal entry to record salaries payable for the month of.docxrtodd884
 
Prepare a short --talking points-- paper in which you identify and dis.docx
Prepare a short --talking points-- paper in which you identify and dis.docxPrepare a short --talking points-- paper in which you identify and dis.docx
Prepare a short --talking points-- paper in which you identify and dis.docxrtodd884
 

Mehr von rtodd884 (8)

Poly-meta-morphic malware looks different each time it is stored on di.docx
Poly-meta-morphic malware looks different each time it is stored on di.docxPoly-meta-morphic malware looks different each time it is stored on di.docx
Poly-meta-morphic malware looks different each time it is stored on di.docx
 
Please write a formal summary of the case before proceeding to answer.docx
Please write a formal summary of the case before proceeding to answer.docxPlease write a formal summary of the case before proceeding to answer.docx
Please write a formal summary of the case before proceeding to answer.docx
 
Please respond in detail with an example- Thank you! Financial interme.docx
Please respond in detail with an example- Thank you! Financial interme.docxPlease respond in detail with an example- Thank you! Financial interme.docx
Please respond in detail with an example- Thank you! Financial interme.docx
 
Problem 1- Text Editor using files and strings using C++ In this proje.docx
Problem 1- Text Editor using files and strings using C++ In this proje.docxProblem 1- Text Editor using files and strings using C++ In this proje.docx
Problem 1- Text Editor using files and strings using C++ In this proje.docx
 
Presented below is the balance sheet of Sargent Corporation for the cu.docx
Presented below is the balance sheet of Sargent Corporation for the cu.docxPresented below is the balance sheet of Sargent Corporation for the cu.docx
Presented below is the balance sheet of Sargent Corporation for the cu.docx
 
Presented below is information related to Dino Radja Company- Date End.docx
Presented below is information related to Dino Radja Company- Date End.docxPresented below is information related to Dino Radja Company- Date End.docx
Presented below is information related to Dino Radja Company- Date End.docx
 
Prepare the journal entry to record salaries payable for the month of.docx
Prepare the journal entry to record salaries payable for the month of.docxPrepare the journal entry to record salaries payable for the month of.docx
Prepare the journal entry to record salaries payable for the month of.docx
 
Prepare a short --talking points-- paper in which you identify and dis.docx
Prepare a short --talking points-- paper in which you identify and dis.docxPrepare a short --talking points-- paper in which you identify and dis.docx
Prepare a short --talking points-- paper in which you identify and dis.docx
 

Kürzlich hochgeladen

Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 

Kürzlich hochgeladen (20)

Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 

Please see the figure in the inset for an illustration- Let us suppose.docx

  • 1. Please see the figure in the inset for an illustration. Let us suppose each task can have “2― different (latency,power) operating modes. Also the latency values of these modes are the same while power values are different (across tasks). Hence two tasks s1 and s2 will have different power values but same latency values for their operating modes. You are given a cumulative latency constraint T. Give an algorithm which allocates an operating mode to each task subject to latency constraints while minimizing the total power. Does your algorithm run in polynomial time (while guaranteeing correct results)? (if it helps, you can assume the latency, power and T are all integers). { Use 0 1 Knapsack} C++ code is required dynamic prograaming matrix required Q2) ) Let us suppose n=2. Let us suppose that the power vs latency relationship is linear and latency can take any positive value as long as it is less than some MAX constraint (not subject to an integer number of distinct states). Describe a formal approach to finding the best operating mode for the two tasks subject to T (latency constraints) while minimizing the total power. In this context an operating mode is an allocation of latency for each task. Solution #include<iostream.h> #include<conio.h> class S { private: int por; int lat; int* s; public: S(); S(int M, int N); ~S(); }; S::S() { int * s = NULL;
  • 2. } S::S(int N) { int * s = new int[N * N]; this->por = N; this->cols = N; for(int i = 0; i < N; i++){ for(int j = 0; j < N; j++){ if(i==j) s[i * N + j] = 1; else s[i * N + j] = 0; } } } S::S(int M, int N){ int * s = new double[M * N]; this->por = M; this->lat = N; for(int i = 0; i < M; i++){ for(int j = 0; j < N; j++) matrix[i * N + j] = 0; } } S::~S(){ delete [] s; } void main() { S s1,s2; int n; s1=new S(n); s2=new S(n); getch(); }