Answer:
In Python:
bin = int(input("Binary Number: "))
num = str(bin)
dec = 0
for i in range(len(num)):
dec = dec + int(num[i]) * 2**int(len(num)-i-1)
print("Decimal Equivalent: "+str(dec))
Explanation:
Note that the program assumes that the user input will be valid. So, error check was done in the program
This line gets the binary number from the user
bin = int(input("Binary Number: "))
This converts the inputted number to string
num = str(bin)
This initializes decimal number to 0
dec = 0
This iterates through the string number
for i in range(len(num)):
This converts the number to decimal
dec = dec + int(num[i]) * 2**int(len(num)-i-1)
This prints the result of the conversion
print("Decimal Equivalent: "+str(dec))
See attachment for screenshots
What are other ways you could use the shake or compass code blocks in physical computing projects?
Answer:there are different ways of quick navigation between files and functions. ... You should use the menu 'Remove file from project' instead of deleting files. ... A Makefile generation tool for Code::Blocks IDE by Mirai Computing
Consider a computer system with three users: Alice, Bob, and Cyndy. Alice owns the file alicerc, and Bob and Cyndy can read it. Cyndy can read and write the file bobrc, which Bob owns, but Alice can only read it. Only Cyndy can read and write the file cyndyrc, which she owns. Assume that the owner of each of these files can execute it.
a. Create the corresponding access control matrix.
b. Cindy gives Alice permission to read cyndyrc, and Alice removes Bob's ability to rad alicerc. Show the new access control matrix.
Answer:
Following are the solution to this question:
Explanation:
For point a:
[tex]alicerc \ \ \ \ \ \ \ \ \ \ \ bobrc \ \ \ \ \ \ \ \ \ \ \ \ \ \ cyndyrc\\[/tex]
[tex]Alice \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ox \ \ \ \ \ \ \ \ \ \ \ \ \ \ r\\\\ Bob \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ r \ \ \ \ \ \ \ \ \ \ \ \ \ \ ox \\\\Cyndy \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ r\ \ \ \ \ \ \ \ \ \ \ \ \ \ rw \ \ \ \ \ \ \ \ \ \ \ \ \ \ orwx[/tex]
For point b:
[tex]alicerc \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ bobrc \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ cyndyrc[/tex]
[tex]Alice \ \ \ \ \ \ \ \ \ \ \ \ \ \ ox \ \ \ \ \ \ \ \ \ \ \ \ \ \ r \ \ \ \ \ \ \ \ \ \ \ \ \ \ r\\\\Bob \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ox \\\\Cyndy \ \ \ \ \ \ \ \ \ \ \ \ \ \ r \ \ \ \ \ \ \ \ \ \ \ \ \ \ rw \ \ \ \ \ \ \ \ \ \ \ \ \ \ orwx[/tex]
Compilers can have a profound impact on the performance of an application. Assume that for a program, compiler A results in a dynamic instruction count of 1.0E9 and has an execution time of 1.1 s, while compiler B results in a dynamic instruction count of 1.2E9 and an execution time of 1.5 s. a. Find the average CPI for each program given that the processor has a clock cycle time of 1 ns.
Answer:
The answer is "1.25"
Explanation:
[tex]{CPU \ time}= {instructions \times CPI \times cycle\ time}[/tex]
[tex]\therefore\\\CPI= \frac{CPU \ time}{instructions \times cycle \ time} \\\\cycle \ time = 1 \\\\ns = 10^{-9} s \\[/tex]
Also for this context, it executes the time = CPU time. So, the compiler A, we has
[tex]CPI_{A}= \frac{CPU \ time_{A}} {instructions_{A} \times cycle \ time}= \frac{1.1 s}{10^{9} \times 10^{-9} s}= 1.1[/tex]
For compiler B, we have
[tex]CPI_{B}= \frac{CPU \ times_{B}} {instructions_{B} \times cycle \ time}[/tex]
[tex]= \frac{1.5\ s}{ 1.2 \times 10^{9} \times 10^{-9} \ s}\\\\= \frac{1.5}{ 1.2 }\\\\= 1.25[/tex]
The average CPI for each program given that the processor has a clock cycle time of 1 ns is : 1.1, 1.25.
Average CPI for each programCPI (Complier A)=CPU time/Instruction×Cycle time
Where:
Cycle time=1ns=10^-9s
Hence:
CPI (Complier A)=1.1s/10^9×10^-9s
CPI (Complier A)=1.1
CPI (Complier B)=CPU time/Instruction×Cycle time
CPI (Complier B)=1.5s/1.2×10^9×10^-9s
CPI (Complier B)=1.25
Inconclusion the average CPI for each program given that the processor has a clock cycle time of 1 ns is : 1.1, 1.25.
Learn more about average CPI here:https://brainly.com/question/24723238
SAM trainings include 4 parts, which of the following is NOT one of them?
A.practice
B.grading
C.guide
D.Observe
Answer:
doon sa pasay nag kakapi
At which stage should Joan discuss the look and feel of her website with her website designer?
At the
stage, Joan should discuss the look and feel of her website with her website designer.
Answer:
Development stage: It is great to talk with the website designer during the development stages to understand the goalsAnswer:
At the planning stage maybe?
Explanation:
I'm not positive but in plato it discusses this in the Website Development Proccess lesson.
Film and video speak the same audiovisual’’__________.’’
Answer:
Film and video speak the same audiovisual ’’Technology’’
When you check your hard drive to see how much space is available, you are checking your
O primary memory
O secondary storage
O tertiary storage
O primary storage
Answer:
secondary storage
Without this step of the problem solving process you might solve the wrong problem, not know where to start, or not know when you are finished.
Select one:
Define
Prepare
Try
Reflect
I don't get the width and height part (PLEASE HELP WILL GIVE BRAINLIEST ANSWER)
Answer:
What they're saying is that the first two bytes (first two eight bit segments) tell you the width and height of the pattern.
In the example given, you'll notice that the first 16 digits are 00000100 00000100. If you convert those to decimal, you'll see that those are both equal to four.
If instead the second block of eight bits was 00000111, the image height would then be seven.
0111101101010110101110110001001011101001011101101010101010110101
Refer to the above bit string to answer the below questions.
Create a valid IPv4 addresses using the above bit string.
Answer:
binary digits in computer system it belongs
What is software?
a. The soft parts of a computer, like the mouse pad. b. The collection of programs that make the computer do useful work
c. The physical components that come together to form a computer
d. A special kind of CD-ROM
Answer:
B
Explanation:
Answer:
I believe the answer is B
Suppose a program contains 500 million instructions to execute on a processor running on 2.2 GHz. Half of the instructions takes 3 clock cycles to execute, where rest of the instructions take 10 clock cycle. What is the execution time of the program
Answer:
1.48 s
Explanation:
Number of instructions = 500 million = 500 * 10⁶
clock rate = 1 / 2.2 GHz = 1 / (2.2 * 10⁹ Hz) = 0.4545 * 10⁻⁹ s
We need to compute the clocks per instruction (CPI)
The CPI = summation of (value * frequency)
CPI = (50% * 3 clock cycles) + (50% * 10 clock cycles)
CPI = (0.5 * 3) + (0.5 * 10) = 1.5 + 5 = 6.5
Execution time = number of instructions * CPI * clock rate
Execution time = 500 * 10⁶ * 6.5 * 0.4545 * 10⁻⁹ =1.48 s
The Boolean Foundation hosted a raffle to raise money for charity and used a computer program to notify the participants about the results. Unfortunately, the program they used was not very robust and all 250 participants received an email telling them that they won... and that their name is Shauna.
Improve this program by writing a function called sendEmail to print a personalized email to stdout. The function should take three parameters:
The name of the recipient
The prize for the raffle
Whether or not the recipient won
Use the email template from the existing program.
#include
using namespace std;
int main() {
cout << "Dear Shauna," << endl;
cout << "You are the winner of our raffle for charity." << endl;
cout << "The prize was: a stuffed giraffe toy" << endl;
cout << "Thank you for giving to charity!" << endl;
cout << "Sincerely," << endl;
cout << "The Boolean Foundation" << endl;
return 0;
}
Answer:
The function is as follows:
void sendEmail(string name, string prize, string win_lose){
cout << "Dear "<<name<<", " << endl;
cout << "You are the "<<win_lose<<" of our raffle for charity." << endl;
cout << "The prize was: "<<prize<< endl;
cout << "Thank you for giving to charity!" << endl;
cout << "Sincerely," << endl;
cout << "The Boolean Foundation" << endl;
}
Explanation:
This defines the function along the three parameters
void sendEmail(string name, string prize, string win_lose){
This prints the salutation with the person's name
cout << "Dear "<<name<<", " << endl;
This prints if the person won or lost
cout << "You are the "<<win_lose<<" of our raffle for charity." << endl;
This prints the prize, if any
cout << "The prize was: "<<prize<< endl;
The following is the closing remark
cout << "Thank you for giving to charity!" << endl;
cout << "Sincerely," << endl;
cout << "The Boolean Foundation" << endl;
}
Concentrate strings
Write code that concatenates the character strings in str1 and str2, separated by a space, and assigns the result to a variable named joined. Assume that both string variables have been initialized.
Two Letters in Word
Given a character string stored in a variable called word, write code that concatenates the fifth character of the word to the third character from the end of the word, and assigns that string to a variable named two_letters. Assume that word already has a value and is at least five characters long.
Set the Number of Cards if Necessary
Write code that sets the value of the variable num_cards to seven if its current value is less than seven. Otherwise, don't change the value. Assume that nuncards already has an initial value.
Answer:
In Python:
(a) Concatenate strings:
joined = str1+" "+str2
(b) Two Letters in Word :
two_letters = word[4]+word[-3]
(c) Set Numbers in Card
if num_cards < 7:
num_cards = 7
Explanation:
The code segments were written in Python
All variables were assumed to have been initialized
Solving (a): Concatenate strings:
To do this, we make use of + operator.
So, the concatenation of str1 and str2 with space in between is
str1+" "+str2
When assigned to variable joined, it becomes
joined = str1+" "+str2
Solving (b): Two Letters in Word :
The character at the 5th position is represented with index 4 i.e. word[4]
To access a character from the end, we make use of - sign. So, the third character from the end is word[-3]
Concatenate them using + operator.
So, we have:
two_letters = word[4]+word[-3]
Solving (c): Set Numbers in Card
Here, we make use of the if condtion.
First, check if num_cards is less than 7(i.e. num_cards < 7)
If true, assign num_cards to 7
So, we have:
if num_cards < 7:
num_cards = 7
Select the correct answer.
Jane's team is using the V-shaped model for their project. During the high-level design phase of the project, testers perform integration testing
What is the purpose of an integration test plan in the V-model of development?
OA. checks if the team has gathered all the requirements
OB. checks how the product interacts with external systems
ОC. checks the flow of data in internal modules
OD. checks how the product works from the client side
Answer:
a
Explanation:
Match the following
A. Birju Maharaj Brain Lara
B. Jhaveri Sister Mike Tyson
C. Hockey Major Dhyan Chand
D. Boxing Manipur
E. Cricket Uttar Pradesh
15. Select the correct answer.
What determines the measure of height and width of an image in pixels?
A.
pixel depth
B.
pixel dimension
C.
resolution
D.
image size
E.
interpolation
Answer:
Pixel dimensions
Explanation:
measure of height and width of a image in pixels
Write formal descriptions of the following sets.
(a) The set containing the numbers 1, 10, and 100
(b) The set containing all integers that are greater than 10
(c) The set containing all natural numbers that are less than 10
(d) The set containing nothing at all
(e) The set containing the empty string
(f) The set containing the string abc
Answer:
{1, 10, 100}
{a : a ∈ Z and a > 10}
{a : a ∈ N and a < 10}
∅
{ε}
{abc}
Explanation:
1.) A set containing the numbers 1, 10 and 100
2.) Z represents integers, hence numbers n the set are integers values greater Than 100
3.) N represents natural numbers, this the set contains natural numbers less Than 10
4.)∅ represents a null or empty set
5.)represents an empty string
6) contains the sting values a, b and c
Consider the following method, remDups, which is intended to remove duplicate consecutive elements from nums, an ArrayList of integers. For example, if nums contains {1, 2, 2, 3, 4, 3, 5, 5, 6}, then after executing remDups(nums), nums should contain {1, 2, 3, 4, 3, 5, 6}.
public static void remDups(ArrayList nums)
{
for (int j = 0; j < nums.size() - 1; j++)
{
if (nums.get(j).equals(nums.get(j + 1)))
{
nums.remove(j);
j++;
}
}
}
The code does not always work as intended. Which of the following lists can be passed to remDups to show that the method does NOT work as intended?
A. {1, 1, 2, 3, 3, 4, 5}
B. {1, 2, 2, 3, 3, 4, 5}
C. {1, 2, 2, 3, 4, 4, 5}
D. {1, 2, 2, 3, 4, 5, 5}
E. {1, 2, 3, 3, 4, 5, 5}
Answer:
B. {1, 2, 2, 3, 3, 4, 5}
Explanation:
Given
The above code segment
Required
Determine which list does not work
The list that didn't work is [tex]B.\ \{1, 2, 2, 3, 3, 4, 5\}[/tex]
Considering options (A) to (E), we notice that only list B has consecutive duplicate numbers i.e. 2,2 and 3,3
All other list do not have consecutive duplicate numbers
Option B can be represented as:
[tex]nums[0] = 1[/tex]
[tex]nums[1] = 2[/tex]
[tex]nums[2] = 2[/tex]
[tex]nums[3] = 3[/tex]
[tex]nums[4] = 3[/tex]
[tex]nums[5] = 4[/tex]
[tex]nums[6] = 5[/tex]
if (nums.get(j).equals(nums.get(j + 1)))
The above if condition checks for duplicate numbers.
In (B), when the elements at index 1 and 2 (i.e. 2 and 2) are compared, one of the 2's is removed and the Arraylist becomes:
[tex]nums[0] = 1[/tex]
[tex]nums[1] = 2[/tex]
[tex]nums[2] = 3[/tex]
[tex]nums[3] = 3[/tex]
[tex]nums[4] = 4[/tex]
[tex]nums[5] = 5[/tex]
The next comparison is: index 3 and 4. Meaning that comparison of index 2 and 3 has been skipped.
This is so because of the way the if statement is constructed.
There are different kinds of ArrayList of integers. The option in the lists can be passed to remDups to show that the method does not work as intended is {1, 2, 2, 3, 3, 4, 5}.
When you study the different options given, one will see that that only list B has repeated duplicate numbers such as 2,2 and 3,3. while the other options have only a duplicate numbers that are not following each other.In Python, there are different ways to remove duplicates from list. An example using naive or novice method is;
The main list is : [1, 3, 5, 6, 3, 5, 6, 1]
The list after deleting duplicates : [1, 3, 5, 6]
Learn more about coding from
https://brainly.com/question/22654163
Electronic mail is best used to:
Question 31 options:
Send and Receive messages over a network
Send and Receive messages via the Internet
Send and Receive messages via radio waves.
A and B
Answer:
send and receive messages via the internet
Answer:
a and b
Explanation:
because iam smart
What emotion or feeling did the photographer create with this photo? How does the photograph do this?
Choose the correct type of error.
A
error occurs when the program runs, has output, but the result is wrong due.
runtime
syntax
logical
Answer:
logical is the answer
hope it helps
Answer:
logical
Explanation: keep it real witcha
what is hyperlink and its used in website
Explanation:
Hyperlink is the primary method used to navigate between webpages.
Hyperlink can redirect us to another webpages, such as websites that has graphics, files, sounds on the same webpage.
Write a program that declares and initializes a variable representing the weight in milligrams from the keyboard. The program displays the equivalent weight in kilograms, grams, and milligrams. For example, 1050042 milligrams are equivalent to 1 kilogram, 50 grams, and 42 milligrams.
Answer:
weight = int(input("Enter weight in milligrams: "))
kilograms = int(weight / 1000000)
grams = int((weight - (kilograms * 1000000)) / 1000)
milligrams = weight - ((kilograms * 1000000) + (grams * 1000))
print("{} milligrams are equivalent to {} kilogram(s), {} gram(s), and {} milligram(s)".format(weight, kilograms, grams, milligrams))
Explanation:
*The code is in Python.
Ask the user to enter the weight and set it to the variable weight
Calculate the kilograms, divide the weight by 1000000 and cast the result to the int (If the weight is 1050042, kilograms would be 1050042/1000000 = 1)
Calculate the grams, subtract the kilograms from the weight, divide it by 1000 and cast the result to the int (If the weight is 1050042, grams would be int((1050042 - (1 * 1000000)) / 1000) = 50)
Calculate the milligrams, subtract the kilograms and grams from the weight (If the weight is 1050042, milligrams would be 1050042 - ((1 * 1000000) + (50 * 1000)) = 42)
Print the weight, kilograms, grams, and milligrams in the required format
In this exercise we have to use the knowledge of the python language to write the code, so we have to:
The code is in the attached photo.
Some important information informed in the statement that we have to use in the code is:
Calculate the kilograms, divide the weight by 1000000 and cast the result.Calculate the grams, subtract the kilograms from the weight, divide it by 1000 and cast the result.Calculate the milligrams, subtract the kilograms and grams from the weight.So to make it easier the code can be found at:
weight = int(input("Enter weight in milligrams: "))
kilograms = int(weight / 1000000)
grams = int((weight - (kilograms * 1000000)) / 1000)
milligrams = weight - ((kilograms * 1000000) + (grams * 1000))
print("{} milligrams are equivalent to {} kilogram(s), {} gram(s), and {} milligram(s)".format(weight, kilograms, grams, milligrams))
See more about python at brainly.com/question/26104476
Match the web development languages to their types.
PHP
HTML
ASP
JavaScript
XML
SGML
MARKUP LANGUAGE
SCRIPTING LANGUAGE
Answer:
HTML, XML and SGML are the markup languages (hence the "ML" suffix on each of their acronyms).
PHP, ASP and Javascript are scripting languages.
A kind of markup language is HTML. It "marks up" or encapsulates data using HTML tags that specify the data and explain how it will be used on the webpage. Following that, the web browser examines the HTML, which instructs it as to what sections are headings, paragraphs, links, etc.
What are the different web development languages?OOP scripting is used in Java, whereas OOP programming is used in Java. JavaScript code can only be run on a browser, while Java applications can run on a virtual machine or browser.
While JavaScript code is completely in text, Java code must be compiled. They both need various plug-ins.
Therefore, The "ML" suffix on each acronym stands for markup languages, which are HTML, XML, and SGML respectively. Scripting languages include JavaScript, ASP, and PHP.
Learn more about languages here:
https://brainly.com/question/29239656
#SPJ2
4. What are the traits of a good follower?
Answer:
Judgment. Followers must take direction, but not blindly. Work ethic. Good followers are good workers. Competence. In order to follow, followers must be competent. Honesty. Followers have a responsibility to be honest. Courage. Discretion. Loyalty. Ego management.In this assignment, you will implement an online banking system. Users can sign-up with the system, log in to the system, change their password, and delete their account. They can also update their bank account balance and transfer money to another user’s bank account.
You’ll implement functions related to File I/O and dictionaries. The first two functions require you to import files and create dictionaries. User information will be imported from the "users.txt" file and account information will be imported from the "bank.txt" file. Take a look at the content in the different files. The remaining functions require you to use or modify the two dictionaries created from the files.
Each function has been defined for you, but without the code. See the docstring in each function for instructions on what the function is supposed to do and how to write the code. It should be clear enough. In some cases, we have provided hints to help you get started.
def import_and_create_dictionary(filename):
'''
This function is used to create a bank dictionary. The given argument is the filename to load.
Every line in the file will look like
key: value
Key is a user's name and value is an amount to update the user's bank account with. The value should be a
number, however, it is possible that there is no value or that the value is an invalid number.
What you will do:
- Try to make a dictionary from the contents of the file.
- If the key doesn't exist, create a new key:value pair.
- If the key does exist, increment its value with the amount.
- You should also handle cases when the value is invalid. If so, ignore that line and don't update the dictionary.
- Finally, return the dictionary.
Note: All of the users in the bank file are in the user account file.
'''
d = {}
# your code here
return d
##########################
### TEST YOUR SOLUTION ###
##########################
bank = import_and_create_dictionary("bank.txt")
tools.assert_false(len(bank) == 0)
tools.assert_almost_equal(115.5, bank.get("Brandon"))
tools.assert_almost_equal(128.87, bank.get("James"))
tools.assert_is_none(bank.get("Joel"))
tools.assert_is_none(bank.get("Luke"))
tools.assert_almost_equal(bank.get("Sarah"), 827.43)
#user.txt
Brandon - brandon123ABC
Jack
Jack - jac123
Jack - jack123POU
Patrick - patrick5678
Brandon - brandon123ABCD
James - 100jamesABD
Sarah - sd896ssfJJH
Jennie - sadsaca
#bank.txt
Brandon: 5
Patrick: 18.9
Brandon: xyz
Jack:
Sarah: 825
Jack : 45
Brandon: 10
James: 3.25
James: 125.62
Sarah: 2.43
Brandon: 100.5
Answer:
# global variable for logged in users
loggedin = []
# create the user account list as a dictionary called "bank".
def import_and_create_dictionary(filename):
bank = {}
i = 1
with open(filename, "r") as file:
for line in file:
(name, amt) = line.rstrip('\n').split(":")
bank[i] = [name.strip(), amt]
i += 1
return bank
#create the list of user login details.
def import_and_create_accounts(filename):
acc = []
with open(filename, "r") as file:
for line in file:
(login, password) = line.rstrip('\n').split("-")
acc.append([login.strip(), password.strip()])
return acc
# function to login users that are yet to login.
def signin(accounts, login, password):
flag="true"
for lst in accounts:
if(lst[0]==login and lst[1] == password):
for log in loggedin:
if(log ==login):
print("You are already logged in")
flag="false"
break
else:
flag="false"
if(flag=="true"):
loggedin.append(login) # adding user to loggedin list
print("logged in succesfully")
return True
return False
# calling both the function to create bank dictionary and user_account list
bank = import_and_create_dictionary("bank.txt")
print (bank)
user_account = import_and_create_accounts("user.txt")
print(user_account)
# check for users loggedin
signin(user_account,"Brandon","123abcAB")
signin(user_account,"James","100jamesABD")
signin(user_account,"Sarah","sd896ssfJJH")
Explanation:
The python program is a banking application system that creates a list of user accounts and their login details from the bank.txt and user.txt file. The program also uses the information to log in and check for users already logged into their account with the "loggedin" global variable.
In this exercise we have to use the knowledge of programming in the python language, in this way we find that the code can be written as:
The code can be seen in the attached image.
To make it even simpler to visualize the code, we can rewrite it below as:
def import_and_create_dictionary(filename):
bank = {}
i = 1
with open(filename, "r") as file:
for line in file:
(name, amt) = line.rstrip('\n').split(":")
bank[i] = [name.strip(), amt]
i += 1
return bank
#create the list of user login details.
def import_and_create_accounts(filename):
acc = []
with open(filename, "r") as file:
for line in file:
(login, password) = line.rstrip('\n').split("-")
acc.append([login.strip(), password.strip()])
return acc
def signin(accounts, login, password):
flag="true"
for lst in accounts:
if(lst[0]==login and lst[1] == password):
for log in loggedin:
if(log ==login):
print("You are already logged in")
flag="false"
break
else:
flag="false"
if(flag=="true"):
loggedin.append(login) # adding user to loggedin list
print("logged in succesfully")
return True
return False
bank = import_and_create_dictionary("bank.txt")
print (bank)
user_account = import_and_create_accounts("user.txt")
print(user_account)
signin(user_account,"Brandon","123abcAB")
signin(user_account,"James","100jamesABD")
signin(user_account,"Sarah","sd896ssfJJH")
See more about programming at brainly.com/question/11288081
Which version of Microsoft Office is free?
Answer:
the older versions and really all of them are
Answer:
This is what I found on the internet that I hope will help you! :3
Explanation:
It's a free app that will be preinstalled with Windows 10, and you don't need an Office 365 subscription to use it. The existing My Office app has many of these features, but the new Office app puts the focus on the free online versions of Office if you're not an Office 365 subscriber.
Let A and B be two stations attempting to transmit on an Ethernet. Each has a steady queue of frames ready to send; A’s frames will be numbered ????1, ????2 and so on, and B’s similarly. Let T = 51.2 ????????????c be the exponential backoff base unit. Suppose A and B simultaneously attempt to send frame 1, collide, and happen to choose backoff times of 0 × T and 1 × T, respectively. As a result, Station A transmits ????1 while Station B waits. At the end of this transmission, B will attempt to retransmit ????1 while A will attempt to transmit ????2. These first attempts will collide, but now A backs off for either 0 × T or 1 × T (with equal probability), while B backs off for time equal to one of 0 × T, 1 × T, 2 × T and 3× T (with equal probability).(a) Give the probability that A wins this second backoff race immediately after his first collision.(b) Suppose A wins this second backoff race. A transmits ????2 and when it is finished, A and B collide again as A tries to transmit ????3 and B tries once more to transmit ????1. Give the probability that Awins this third backoff race immediately after the first collision.(c) What is the probability that A wins all the ???? backoff races. (???? is a given constant)(d) Assume that there are 3 stations sharing the Ethernet. Will the chance for A to win all the backoffraces decrease or increase? Why?
Answer:
Following are the solution to the given question:
Explanation:
Please find the complete and correct question in the attachment file.
For Point a:
For the second round,
A is selects kA(2) either 0 or 1, so for each of them, that is [tex]\frac{1}{2}[/tex].
B selects [tex]kB(2)\ from\ (0, 1, 2, 3)[/tex] for each choice with the probability of [tex]\frac{1}{4}[/tex].
If [tex]kA(2) < kB(2)[/tex] wins the second rear race.
[tex]\to P[A \ wins] = P[kA(2) < kB(2)][/tex]
[tex]= P[kA(2) = 0] \times P[kB(2) > 0] + P[kA(2) = 1] \times P[kB(2) > 1]\\\\= \frac{1}{2} \times \frac{3}{4} + \frac{1}{2} \times \frac{2}{4} \\\\=\frac{3}{8} +\frac{2}{8} \\\\= \frac{3+2}{8}\\\\= \frac{5}{8}[/tex]
For Point b:
Throughout this example, [tex]kA(3)[/tex] also selects to be either 0 or 1 with such a [tex]\frac{1}{2}[/tex] probability. So, although B chooses [tex]kB(3)[/tex] from [tex](0, 1, 2, 3, 4, 5, 6, 7),[/tex] the probabilities each are [tex]\frac{1}{8}[/tex]:
[tex]\to P[A \ wins] = P[kA(3) < kB(3)][/tex]
[tex]= P[kA(3) = 0] \times P[kB(3) > 0] + P[kA(3) = 1] \times P[kB(3) > 1]\\\\= \frac{1}{2} \times \frac{7}{8} + \frac{1}{2} \times \frac{6}{8}\\\\= \frac{7}{16} + \frac{6}{16}\\\\= \frac{7+6}{16} \\\\= \frac{13}{16}\\\\[/tex]
For point c:
Assume that B tries again 16 times (typical value), and it destroys. In addition, throughout the exponential background n is obtained at 10 when choosing k between 0 to 2n−1. The probability of A winning all 13 backoff events is: [tex]P[A \text{wins remaining races}] = 16\pi i =4P[A \ wins \ i |A \ wins \ i -1 ][/tex]
Let the k value kA(i) be A for the backoff race I select. Because A retains the breed
[tex]=(kA(i)] \cdot P[kA(i+ 1)< kB(i+ 1)] \geq P[kA(i) + 1<kB(i)] \cdot P[kA(i+ 1)< kB(i+1)]+P[kA(i) + 1 \geq kB(i)] \cdot P[kA(i+ 1)< kB(i+ 1)] \\\\= (P[kA(i) + 1< kB(i)] +P[kA(i) + 1 \geq kB(i)]) \times P[kA(i+ 1) < kB(i+ 1)]\\\\=P[kA(i+ 1)< kB(i+ 1)]\\\\[/tex]
For point d:
Two stations A and B are supposed. They assume that B will try 16 times afterward. Even so, for A, 16 races were likely to also be won at a rate of 0.82 For Just higher expectations of three A, B, and C stations. For Station A, possibility to win all backoffs
5. You have been putting off writing a research paper, and now it's due in two days. You have gathered
a few notes, but fear you will not complete the assignment on time. You are considering purchasing
a paper from a website that produces research papers on any topic, though you are concerned the
content might not be original. Should you take a chance and purchase the research paper? Is using
the website's services even ethical?