CSE_142_WI24_HW3
.pdf
keyboard_arrow_up
School
University of California, San Diego *
*We aren’t endorsed by this school
Course
142
Subject
Computer Science
Date
May 17, 2024
Type
Pages
7
Uploaded by KidSpider1136 on coursehero.com
CSE 142: Computer Architecture: A Software Perspective
Winter 2024
Homework 3
Instructor: Leo Porter
Due on:
Tuesday, 13 February
(32 points)
Name:
Date:
Instructions
•
Answer each problem in the boxes provided. Any writing outside of the boxes will NOT be graded. Do not
turn in responses recorded on separate sheets.
•
Handwritten or typed responses are accepted. In either case, make sure all answers are in the appropriate
boxes.
•
All responses must be neat and legible. Illegible answers will result in zero points.
1.
Locality
(2 point -
Completeness
):
For a 2-D array, the first index is the row, and the second index is the column. Assume each word is a 32
bit integer and the array is stored in row major order. Also assume that the variables i,j and sum are stored
in registers:
for (i=0; i<100; i++){
for(j=0; j<4000; j++){
sum+= a[j][i] + b[j][i];
}
}
It is observed that the above piece of code suffers from significant memory latency. Why do you think it has
these large memory delays and how can we improve the code to reduce this?
2.
Cache Basics
(6 points -
Correctness
):
We want to explore three different 1024 byte cache designs: direct-mapped, 4-way set-associative, and fully-
associative. All three caches have 64-byte block size and use 32-bit byte addressing. How many bits do you
need to assign for the tag, index, and block offset field for the three different caches? Please write down the
number of bits in the table below.
Cache
direct-mapped
4-way set-associative
fully-associative
block offset
Index
Tag
3.
Cache Accesses
(6 points -
Correctness
):
Complete the following table for each of the below cache configurations:
(a) Cache size - 512 byte, 2-way set associative cache with 64-byte block size.
(b) Cache size - 512 byte, fully associative cache with 64-byte block size.
For each access fill the last column with the type of cache miss if it is a miss (Just write hit if it’s a cache
hit). Use Least Recently Used (LRU) as the replacement policy. Show tag, index and offset bits calculation
in the box below to get full credits.
(You may use the empty space on the right side of the tables to keep track of the cache contents.)
Cache (a)
Cache (b)
block offset
Index
Tag
Sr.
No.
Address (in binary)
Cache (a) (Type of Cache Miss)
1
0010 0110 0000
2
1101 1000 0100
3
0000 0110 0110
4
0101 1110 1010
5
1110 0100 1110
6
1010 0010 0000
7
0010 0110 0001
8
1011 1010 0011
9
1101 1000 1100
10
1000 1100 1100
11
1111 1010 0000
12
1011 1000 1011
13
0100 0000 1110
14
0111 1110 0010
15
0101 1111 1010
16
0111 1111 0011
17
1010 0000 0001
18
0010 0110 0001
19
1110 0110 0010
20
0100 0001 1000
21
1111 1010 1110
22
1011 1001 1011
23
1001 0011 1111
24
0101 1110 0010
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
Transcribed Image Text
A student took four quizzes in a term and would like to compute their average. He also would like to know what will be the remarks. Follow the range of grades and its equivalent remarks, and then fill-up the table below: 100-95 - Excellent 94-90 – Very Satisfactory 89-85 - Satisfactory 84-80 - Fine 79-75 - Fair 74 and below - Poor
arrow_forward
Introduction Some number of teams are participating in a race. You are not told how many teams are participating but you do know that: Each team has a name, which is one of the uppercase letters A-Z. No two teams have the same name, so there are a maximum number of 26 teams. Each team has the same number of members. No two runners cross the finish line at the same time – i.e. there are no ties. At the end of the race we can write the results as a string of characters indicating the order in which runners crossed the finish line. For example: ZZAZAA We can see there were two teams: A and Z. Team A’s runners finished in 3rd, 5th and 6th place. Team Z’s runners finished in 1st, 2nd and 4th place. Scoring the race Each runner is assigned a score equal to their finishing place. In the example above team Z’s runners achieved scores of 1, 2 and 4. Team A’s runners scores were 3, 5, and 6 respectively. The team’s score is the sum of the members score divided by the number of people on…
arrow_forward
ID: A
Name:
ID: A
6. There are 32 students standing in a classroom. Two different algorithms are given for finding the average
height of the students.
Algorithm A
Step 1: All students stand.
gniwolldi odT
gaihnel vd
Step 2: A randomly selected student writes his or her height on a card and is seated.
Step 3: A randomly selected standing student adds his or her height to the value on the card, records the new
value on the card, and is seated. The previous value on the card is erased.
Step 4: Repeat step 3 until no students remain standing.
Step 5: The sum on the card is divided by 32. The result is given to the teacher.
Algorithm B
Step 1: All students stand.
Step 2: Each student is given a card. Each student writes his or her height on the card.
Step 3: Standing students form random pairs at the same time. Each pair adds the numbers written on their
cards and writes the result on one student's card; the other student is seated. The previous value on the card is
erased.
Step 4: Repeat…
arrow_forward
Please answer 4 and 5 only as this question is reposted.
arrow_forward
The Philosophers' Dinner Problem
Five philosophers sit around a table and spend their lives dining and thinking. Each philosopher has a bowl of noodles and a fork to the left of your plate. To eat the noodles you need two forks and each philosopher you can only take the ones to your left and right. If any philosopher takes a fork and the other is busy, he will wait, fork in hand, until pick up the other fork, so you can start eating later. If two adjacent philosophers try to pick up the same fork at the same time, a race condition: they both compete to take the same fork, and one of them left without eating. If all the philosophers take the fork to their right at the same time, then everyone will be waiting forever, because someone must release the fork that is lack. No one will because everyone is in the same situation (hoping that someone put down their forks). Then the philosophers will starve. This lock mutual is called deadlock or deadlock. The problem is to find an algorithm that…
arrow_forward
Moon effect. Some people believe that the Moon controls their activities. If the Moon moves from being directly on the opposite side of
Earth from you to being directly overhead, by what percentage does (a) the Moon's gravitational pull on you increase and (b) your
weight (as measured on a scale) decrease? Assume that the Earth-Moon (center-to-center) distance is 3.82 x 10° m, Earth's radius is
6.37 x 106 m, Moon's mass is 7.36 x 1022 kg, and Earth's mass is 5.98 x 1024 kg.
(a) Number
6.89
Units
percent
(b) Number
i
6.8713e-4
Units
percent
arrow_forward
11 Worksheet 5
Note:Solution using Matlab Code
Write a program that prompts the user to enter a number within the range of 1 through 7, those
numbers represent the weekdays as shown in the table. If the entered number is more than 7,
display 'invalid day'.
Number
1
2
3
4
5
6
7
Day
Sunday
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Type of the day
Workday
Workday
Workday
Workday
Workday
Weekend
Weekend
The program should continue to repeat itself 10 times, after which, the program should stop.
Furthermore, the program should be able to show a message saying if this is a 'workday' or a
'weekend day'.
Note: you are required to add a comment beside your command. Hint: to add a comment you
may use the % sign. thank guys you dodo great.
arrow_forward
Please do not give solution in image formate thanku
Reflection Essay
Write a short essay (at least 500 words) for each reflection essay to reflect upon their learning experiences on Threat Intelligence, Computer Forensics, and Cyber Terrorism . A separate paragraph should be written for each point, and the topic needs to be marked clearly at the beginning of the paragraph.
arrow_forward
Question 4 - Algorithm Design
Imagine you are a treasure hunter standing at one side of the river. There are n (a positive
integer) stones on the river. They are aligned on a straight line and at the nth stone, there is
treasure waiting for you. Your target is to reach the nth stone. For each move, you have the
choice of either walking (move one stone ahead) or leaping (move two stones ahead). Also, you
are not allowed to travel backwards. Design an algorithm that calculates the number of ways
(sequences of walks/leaps) that get you to the treasure stone. You should clearly explain the
algorithm and demonstrate the correctness of the algorithm with a complete proof.
Here is an example. For n =
1
5, there are 8 ways:
Method 1: walk → walk → walk → walk → walk
Method 2: walk → walk → walk → leap
Method 3: walk → walk → leap → walk
Method 4: walk → leap → walk →
walk
walk
Method 5: leap → walk → walk →
Method 6: leap → leap walk
Method 7: leap → walk → leap
Method 8: walk → leap leap
arrow_forward
Skydiving
Bibi is a skydiving instructor. Before carrying out skydiving
activities, Bibi will always ask the name, height, and age
of the participants. Bibi's participants is always 2 people.
To make it easier to remember their identities, Bibi gave
them a paper to write down their identity. But because
they are very enthusiastic in doing skydiving, they write
their identity in a single line only (for both of the
participants), so it wasn't quite neat and it made difficult
for Bibi to see it, and resulted in the skydiving process
being disturbed. As one of the organizer committee, you
do not want this activity to be disturbed and plan to
provide a program that provides their identity neatly to
Bibi.
Format Input
Input consists of 1 line. It contains the identity of 2 people
in a row Ni, Ti, Ui - the name, height, and age of the i-th
participant.
Format Output
The output consists of 6 lines. The first line, "Name 1: N1".
The second line, "Height 1: T1". The third line, "Age: U1".
For…
arrow_forward
Question-1
Friend's Party Circle:
There are a few friends living in the same area.
They have a party every weekend and the place
of party change each week. It is always a
lifficult task to select a place which is nearest
for everyone. They
advantage of Computer Science to solve this
problem.
all decided to take
Names of friends are Ahmed, Rehman, Careem,
Basit, Dawood, Ghani, and Farid. Ahmed lives
at 5 minutes' walk from rehman and at 10
minutes' walk from Careem. Careem lives at 3
minutes' walk from Dawood. Rehman lives at 4
minutes' walk from Basit and 2 minutes' walk
from Dawood. Dawood lives at two minutes'
walk from Farid. Ghani lives at 2 minutes' walk
from Basit.
a. If we represent a graph G = V (V, E) in
which set of vertices are home of each
Friend and an edge represents a path
between
two
homes.
Provide the
adjacency matrix of directed graph of
the graph G.
b. In above directed graph G. You are
required to devise an algorithm to find
all possible paths.
arrow_forward
Assignment
Using a professional tool, create an algorithm to explain how you would solve this problem:
A program reads 3 values from the user and prints the smallest one and the largest one. For example, if the user
enters:
342
The output will be:
The largest number is 4
The smallest number is 2
In the case of duplicates, pick either one.
Submit a JPG of you work
arrow_forward
Instructions
A common problem in textual analysis is to determine the frequency and location of words in a document. The information is stored in a concordance, which lists the distinct words in alphabetical order and makes references to each line on which the word is used. For instance, consider the quotation:
Peter Piper picked a peck of pickled peppers. A peck of pickled peppers Peter Piper picked. If Peter Piper picked a peck of pickled peppers, where is the peck that Peter Piper picked?
The word "piper" occurs 4 times in the text and appears on lines 1, 2, and 3. The word "pickled" occurs 3 times and appears on lines 1 and 2.
For the text above, the output of the concordance is:
Word Frequency Occurs on lines:------------------------------------------------------------------a 3 1, 2if 1 2is 1…
arrow_forward
Only correct answer will be appreciated else downvoted.
arrow_forward
Instructions
A common problem in textual analysis is to determine the frequency and location of words in a document. The information is stored in a concordance, which lists the distinct words in alphabetical order and makes references to each line on which the word is used. For instance, consider the quotation:
Peter Piper picked a peck of pickled peppers. A peck of pickled
peppers Peter Piper picked. If Peter Piper picked a peck of
pickled peppers, where is the peck that Peter Piper picked?
The word “piper” occurs 4 times in the text and appears on lines 1, 2, and 3. The word “pickled” occurs 3 times and appears on lines 1 and 2.
For the text above, the output of the concordance is:
Write a c++ program to create a concordance for a text file. Since during the process of building the concordance, it is frequently necessary to look up the word in the current words in the concordance, update concordance entries, as well as insert new words into the concordance, a binary…
arrow_forward
Read carefully please!
arrow_forward
Sequential Money Problem (Coin Row)• Suppose there are n coins lined up side by side on a table; Let the values of these coins be c₁, c₂, ..., cn (the valuesthey do not have to be different from each other, there may be more than one coin of the same value on the table; but all positive).• The goal is not to take two adjacent coins on the table side by side.collecting the largest total valuable coins from the table, provided that
The algorithm that solves the Ordered Money problem;a. By using the brute-force method, evaluating all possible valid alternatives and reaching the result (with the "exhaustive search" method),b. Write the "recurrence" equation that describes the problem directly (without using the dynamic programming technique).
Describe the time complexity of each of your algorithms for both of the above spelling.
arrow_forward
please very soon Only true or false 1)True or false: A problem is ill-conditioned if its solution is highly sensitive to small changes in the problem data.2)True or false: Using higher-preision arithmetic will make an ill-conditioned problem better conditioned.3)True or false: It is good for a computational problem to have a condition number of 1.4)True or false: The conditioning of a problem depends on the algorithm used to solve it.5)True or false: The choice of algorithm for solving a problem has no effect on the propagated data error.6)True or false: If two real numbers are exactly representable as floating-point numbers, then the result of a real arithmeti operation on them will also be representable as a floating point number.7)True or false: Floating-point numbers are distributed uniformly throughout their range.8)True or false: Floating-point addition is commutative but not associative.
arrow_forward
10 - In an examination, 500 students appeared. Out of these students, 38 % got A+ grade, 45 % got B+ and the remaining just passed. Assuming that no student failed, find the number of students who got A+, B+ and the number of students who just passed.(Python code)
arrow_forward
HW2
In an experiment to determine the spring constant of an elastic
cord of length 0.60 m, a student hangs the cord from a rod as
represented and then attaches a variety of weights to the cord.
For each weight, the student allows the weight to hang in
equilibrium and then measures the entire length of the cord.
The data are recorded in the table below
Į
Weight (N) 0
10 15 20 25
Length (m) 0.60 0.97 1.24 1.37 1.64
1- Plot the force/elongation curve using Matlab.
2- Deduce the spring constant of the cord.
arrow_forward
Correct answer will be appreciated else downvoted multiple times
arrow_forward
grok
Introduction to Programming (Python)
academy
8 - Looping and lists
Yuor biran is an azamnig thnig
Instructions Tutoring
O Problem
pi
Image source
na
Two words are anagrams of each other if they contain the same letters in them. So
na
left is an anagram of felt and vice-versa. A Super Anagram is a special kind of
So
anagram. A Super Anagram is an anagram whose first and last letters are the same.
So
if
Your program needs to read in two words on a single line. If the pair of words are Super
Anagrams of each other, print out Super Anagram!. If the pair of words is not a Super
Anagram (so a human couldn't read it), then print out Huh?. For one-letter words, the
first letter is the last letter.
So, for example:
Enter words: brain brian
Super Anagram!
and another example:
Enter words: too two
Huh?
arrow_forward
Purpose: One of the most commonly made decisions is based on comparing the means of multiple conditions. Significance tests for comparing means are critical in the decision making process. In this assignment, you will practice how to use t tests and ANOVA tests to compare the means of multiple conditions under one independent variable in different experiment design (between-group and within-group)
Tasks: Please write an R script that performs the following operations in the order
listed. At the beginning of each task, write a comment marking the task number.
Name the file as: lab6-<your last name>.R
ANOVA tests
8. Import the 'iris.csv' dataset. Browse and understand the data in each column 9. Compute descriptive statistics and create boxplot for sepal length and
species.
10. Select the appropriate test to determine whether there is significant difference in sepal length between the three species. Follow the steps of ANOVA analysis. Make sure you check whether the assumptions are…
arrow_forward
Exams.cpp) Suppose a teacher weights the fourexams he gives 10%, 25%, 30%, and 35%. Write a programthat reads ten sets of four grades, prints the weightedaverage of each set, and prints the unweighted average ofeach test. The number of students should be in a globalconstant.
arrow_forward
Decrease-by-Constant-Factor Fake-Coin puzzle method in Java or C++ to find the fake coin out of n coins. Assume the false coin is lighter. Randomly place the false coin among the n coins. Submit results images and code files.
arrow_forward
Java Programming Project
You need to make an exam application in the project. Write the project using JavaFX. Do
not use a database. Accordingly, what is requested must be performed:
1. Adding questions to the question bank: different types of questions should be
added to the question bank. Question types include multiple choice, True/False, fill-in,
and classic type questions. It is mandatory to use inheritance and polymorphism in
writing classes related to questions and in using their objects.
For example, a multiple choice question should have the following information:
a) question text
b) answer options such as a, b, c, d
c) answer
d) points
e) degree of difficulty (such as easy, normal and difficult)
In the upper classes, taking into account the content of other types of questions and
subclasses must be determined which properties should be.
2. Removing a question from a question bank: finding a question that will be deleted
first when removing a question from a question bank it…
arrow_forward
Question-1
Friend's Party Circle:
There are a few friends living in the same area.
They have a party every weekend and the place
of party change each week. It is always a
difficult task to select a place which is nearest
for everyone. They all decided
advantage of Computer Science to solve this
problem.
to take
Names of friends are Ahmed, Rehman, Careem,
Basit, Dawood, Ghani, and Farid. Ahmed lives
at 5 minutes’walk from rehman and at 10
minutes' walk from Careem. Careem lives at 3
minutes' walk from Dawood. Rehman lives at 4
minutes' walk from Basit and 2 minutes' walk
from Dawood. Dawood lives at two minutes'
walk from Farid. Ghani lives at 2 minutes' walk
from Basit.
b. In above directed graph G. You are
required to devise an algorithm to find
all possible paths.
arrow_forward
Answer asap. Wrong answer would downvoted.
arrow_forward
ICT can provide both opportunities and challenges to humanity. The Internet
can offer modes for empowerment and convenience, but it can also promote the
digital divide and fraud.
Learning Task 3: Write an essay about: “The Power of Media and Information to
Affect Change, and the Responsibility of the Users."
The essay must have an introduction, body and conclusion. The number of words
must be 450-500. The essay will be graded according to the rubric as seen on the
next page.
II
arrow_forward
8. A game is played by moving a game piece left or right along a horizontal game board. The board consists of
spaces of various colors, as shown. The circle represents the initial location of the game piece.
Yellow
Black
Green
Green
Red
Yellow
Black
Black
Yellow
Black
The following algorithm indicates how the game is played. The game continues until the game is either won
by landing on the red space or lost when the piece moves off either end of the board.
Step 1: Place a game piece on a space that is not red and set a counter to 0.
Step 2: If the game piece is on a yellow space, move the game piece 3 positions to the left and go to step 3.
Otherwise, if the game piece is on a black space, move the game piece 1 position to the left and go to step 3.
Otherwise, if the game piece is on a green space, move the game piece 2 positions to the right and go to step
3.
Step 3: Increase the value of the counter by 1.
Step 4: If game piece is on the red space or moved off the end of the game…
arrow_forward
Asap
arrow_forward
An ISBN (International Standard Book Number) is a 10 digit number that is used to identify a book. The first nine digits of the ISBN number are used to represent the Title, Publisher and Group of the book and the last digit is used for
checking whether ISBN is correct or not. To uniquely identify a book a 10-digit ISBN number is used. The rightmost digit is checksum digit. This digit is determined from the other 9 digits using condition that 10d, + 9dz + 8dg + + d4o
must be a multiple of 11 (where d, denotes the i" digit from the right). The checksum digit d; can be any value from 0 to 10: the ISBN convention is to use the value X to denote 10. Write a C program using pointers that receives a 10-
digit ISBN, and computes the checksum, and reports whether the ISBN number is correct or not.
Example: 007462542X = 10°0 + 9*0 + 8*7 + 74 + 6*6 + 5*2 + 4*5 + 3"4 + 2*2 + 110 = 176
Since 176 leaves no remainder when divided by 11, hence it is a valid ISBN.
Note: When the check digit turns out…
arrow_forward
MODELLING AND SIMULATION:
How do each quotations affect the modeling and simulation?
***Famous Simulation Quotes
“You Cannot Study a System by Stopping It”
“Run It Again”
“Is That Some Kind of Game You Are Playing?”
arrow_forward
PROGRAMMING PROBLEM
The inventory of a shoe store lists shoes by stock number. With each stock number, there
is associated a style number in the range of 0 to 50, the number of pairs in each size (sizes
range from 3 to 14) and a price. A program is to be written to keep track of the inventory.
The user is given the following choices: enter a new record, display a record, change the
price of the stock item, or change the number on hand. When specifying a record the user
may give either the stock number, or the style number. The array index can be used as a
stock number. If the user decides to change the stock on hand, the program should ask
which sizes will have their stock on hand changed. The program should be designed to
run indefinitely, keeping track of changed in stock.
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Operations Research : Applications and Algorithms
Computer Science
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Brooks Cole
Related Questions
- Transcribed Image Text A student took four quizzes in a term and would like to compute their average. He also would like to know what will be the remarks. Follow the range of grades and its equivalent remarks, and then fill-up the table below: 100-95 - Excellent 94-90 – Very Satisfactory 89-85 - Satisfactory 84-80 - Fine 79-75 - Fair 74 and below - Poorarrow_forwardIntroduction Some number of teams are participating in a race. You are not told how many teams are participating but you do know that: Each team has a name, which is one of the uppercase letters A-Z. No two teams have the same name, so there are a maximum number of 26 teams. Each team has the same number of members. No two runners cross the finish line at the same time – i.e. there are no ties. At the end of the race we can write the results as a string of characters indicating the order in which runners crossed the finish line. For example: ZZAZAA We can see there were two teams: A and Z. Team A’s runners finished in 3rd, 5th and 6th place. Team Z’s runners finished in 1st, 2nd and 4th place. Scoring the race Each runner is assigned a score equal to their finishing place. In the example above team Z’s runners achieved scores of 1, 2 and 4. Team A’s runners scores were 3, 5, and 6 respectively. The team’s score is the sum of the members score divided by the number of people on…arrow_forwardID: A Name: ID: A 6. There are 32 students standing in a classroom. Two different algorithms are given for finding the average height of the students. Algorithm A Step 1: All students stand. gniwolldi odT gaihnel vd Step 2: A randomly selected student writes his or her height on a card and is seated. Step 3: A randomly selected standing student adds his or her height to the value on the card, records the new value on the card, and is seated. The previous value on the card is erased. Step 4: Repeat step 3 until no students remain standing. Step 5: The sum on the card is divided by 32. The result is given to the teacher. Algorithm B Step 1: All students stand. Step 2: Each student is given a card. Each student writes his or her height on the card. Step 3: Standing students form random pairs at the same time. Each pair adds the numbers written on their cards and writes the result on one student's card; the other student is seated. The previous value on the card is erased. Step 4: Repeat…arrow_forward
- Please answer 4 and 5 only as this question is reposted.arrow_forwardThe Philosophers' Dinner Problem Five philosophers sit around a table and spend their lives dining and thinking. Each philosopher has a bowl of noodles and a fork to the left of your plate. To eat the noodles you need two forks and each philosopher you can only take the ones to your left and right. If any philosopher takes a fork and the other is busy, he will wait, fork in hand, until pick up the other fork, so you can start eating later. If two adjacent philosophers try to pick up the same fork at the same time, a race condition: they both compete to take the same fork, and one of them left without eating. If all the philosophers take the fork to their right at the same time, then everyone will be waiting forever, because someone must release the fork that is lack. No one will because everyone is in the same situation (hoping that someone put down their forks). Then the philosophers will starve. This lock mutual is called deadlock or deadlock. The problem is to find an algorithm that…arrow_forwardMoon effect. Some people believe that the Moon controls their activities. If the Moon moves from being directly on the opposite side of Earth from you to being directly overhead, by what percentage does (a) the Moon's gravitational pull on you increase and (b) your weight (as measured on a scale) decrease? Assume that the Earth-Moon (center-to-center) distance is 3.82 x 10° m, Earth's radius is 6.37 x 106 m, Moon's mass is 7.36 x 1022 kg, and Earth's mass is 5.98 x 1024 kg. (a) Number 6.89 Units percent (b) Number i 6.8713e-4 Units percentarrow_forward
- 11 Worksheet 5 Note:Solution using Matlab Code Write a program that prompts the user to enter a number within the range of 1 through 7, those numbers represent the weekdays as shown in the table. If the entered number is more than 7, display 'invalid day'. Number 1 2 3 4 5 6 7 Day Sunday Monday Tuesday Wednesday Thursday Friday Saturday Type of the day Workday Workday Workday Workday Workday Weekend Weekend The program should continue to repeat itself 10 times, after which, the program should stop. Furthermore, the program should be able to show a message saying if this is a 'workday' or a 'weekend day'. Note: you are required to add a comment beside your command. Hint: to add a comment you may use the % sign. thank guys you dodo great.arrow_forwardPlease do not give solution in image formate thanku Reflection Essay Write a short essay (at least 500 words) for each reflection essay to reflect upon their learning experiences on Threat Intelligence, Computer Forensics, and Cyber Terrorism . A separate paragraph should be written for each point, and the topic needs to be marked clearly at the beginning of the paragraph.arrow_forwardQuestion 4 - Algorithm Design Imagine you are a treasure hunter standing at one side of the river. There are n (a positive integer) stones on the river. They are aligned on a straight line and at the nth stone, there is treasure waiting for you. Your target is to reach the nth stone. For each move, you have the choice of either walking (move one stone ahead) or leaping (move two stones ahead). Also, you are not allowed to travel backwards. Design an algorithm that calculates the number of ways (sequences of walks/leaps) that get you to the treasure stone. You should clearly explain the algorithm and demonstrate the correctness of the algorithm with a complete proof. Here is an example. For n = 1 5, there are 8 ways: Method 1: walk → walk → walk → walk → walk Method 2: walk → walk → walk → leap Method 3: walk → walk → leap → walk Method 4: walk → leap → walk → walk walk Method 5: leap → walk → walk → Method 6: leap → leap walk Method 7: leap → walk → leap Method 8: walk → leap leaparrow_forward
- Skydiving Bibi is a skydiving instructor. Before carrying out skydiving activities, Bibi will always ask the name, height, and age of the participants. Bibi's participants is always 2 people. To make it easier to remember their identities, Bibi gave them a paper to write down their identity. But because they are very enthusiastic in doing skydiving, they write their identity in a single line only (for both of the participants), so it wasn't quite neat and it made difficult for Bibi to see it, and resulted in the skydiving process being disturbed. As one of the organizer committee, you do not want this activity to be disturbed and plan to provide a program that provides their identity neatly to Bibi. Format Input Input consists of 1 line. It contains the identity of 2 people in a row Ni, Ti, Ui - the name, height, and age of the i-th participant. Format Output The output consists of 6 lines. The first line, "Name 1: N1". The second line, "Height 1: T1". The third line, "Age: U1". For…arrow_forwardQuestion-1 Friend's Party Circle: There are a few friends living in the same area. They have a party every weekend and the place of party change each week. It is always a lifficult task to select a place which is nearest for everyone. They advantage of Computer Science to solve this problem. all decided to take Names of friends are Ahmed, Rehman, Careem, Basit, Dawood, Ghani, and Farid. Ahmed lives at 5 minutes' walk from rehman and at 10 minutes' walk from Careem. Careem lives at 3 minutes' walk from Dawood. Rehman lives at 4 minutes' walk from Basit and 2 minutes' walk from Dawood. Dawood lives at two minutes' walk from Farid. Ghani lives at 2 minutes' walk from Basit. a. If we represent a graph G = V (V, E) in which set of vertices are home of each Friend and an edge represents a path between two homes. Provide the adjacency matrix of directed graph of the graph G. b. In above directed graph G. You are required to devise an algorithm to find all possible paths.arrow_forwardAssignment Using a professional tool, create an algorithm to explain how you would solve this problem: A program reads 3 values from the user and prints the smallest one and the largest one. For example, if the user enters: 342 The output will be: The largest number is 4 The smallest number is 2 In the case of duplicates, pick either one. Submit a JPG of you workarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Operations Research : Applications and AlgorithmsComputer ScienceISBN:9780534380588Author:Wayne L. WinstonPublisher:Brooks Cole
Operations Research : Applications and Algorithms
Computer Science
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Brooks Cole