Question

In a fashion similar to that in Fig. 3.11, write a short program to determine the...

In a fashion similar to that in Fig. 3.11, write a short program to determine the smallest number, xmin, used on the computer you will be employing along with this book. Note that your computer will be unable to reliably distinguish between zero and a quantity that is smaller than this number.

Homework Answers

Answer #1

The figure 3.11 in the text book is the pseudo code that determine that machine epsilon for the binary computer.

Below the mat lab code code which is written in the similar fashion to determine the smallest number X_min

A=1

While (1)

If a<+0,break,end

X min=A;

A=a/2;

End

The execute the above script code,there are following steps:

  • First open the matlab Script editor
  • Now write the above code into the editor.
  • Now save this script as getmin.m
  • Now run this file info the MATLAB commend window promot with getmin.m file name.
  • Out put:
  • The following output gets display after the execution of the above code
  • Ans=4.9407e-324


Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
The following code to run as the described program on python. The extra test file isn't...
The following code to run as the described program on python. The extra test file isn't included here, assume it is a text file named "TXT" with a series of numbers for this purpose. In this lab you will need to take a test file Your program must include: Write a python program to open the test file provided. You will read in the numbers contained in the file and provide a total for the numbers as well as the...
1)Write a program that asks a user for a number. If (and only if) the number...
1)Write a program that asks a user for a number. If (and only if) the number is greater than zero print “The number is valid” 2)Write a program that asks a user for a grade. If (and only if) the grade is greater than zero and less than 101, print “The grade is valid” 3)Write a program that asks a user how many widgets they want to buy and prints out what the user should pay. Widgets costs 10 dollars....
Need in Java coding Write a program that will allow users to enter different types of...
Need in Java coding Write a program that will allow users to enter different types of books into the program, and at the end print out everything that the user entered. Allow the user to enter as many books as they want. Please collect the following information and break down the classes as follows using inheritance/classes. I have added the extra properties that each class should include. Book types: Paper Book (nothing extra) Comic Book (issue number) Magazine (publisher, issue...
program has to be written in X86 processor assy language. Write a program that find the...
program has to be written in X86 processor assy language. Write a program that find the minimum number of coins that can represent an amount of money under $1. The amount of money is a random number between 0 and 99 (cents). The randomRange procedure is used to get a random number. Review the sample code in lab4.asm and run it to see how randomRange works. Each time randomRange is called, it creates a random number between 0 and the...
Using C++, Python, or Java, write a program that: In this programming exercise you will perform...
Using C++, Python, or Java, write a program that: In this programming exercise you will perform an empirical analysis of the QuickSort algorithm to study the actual average case behavior and compare it to the mathematically predicted behavior. That is, you will write a program that counts the number of comparisons performed by QuickSort on an array of a given size. You will run the program on a large number of arrays of a certain size and determine the average...
In this assignment you will write a program that compares the relative strengths of two earthquakes,...
In this assignment you will write a program that compares the relative strengths of two earthquakes, given their magnitudes using the moment magnitude scale. Earthquakes The amount of energy released during an earthquake -- corresponding to the amount of shaking -- is measured using the "moment magnitude scale". We can compare the relative strength of two earthquakes given the magnitudes m1 and m2 using this formula: f=10^1.5(m1−m2) If m1>m2, the resulting value f tells us how many times stronger m1...
The following is the description of sales and cash receipts for the Lady’s Fashion Fair, a...
The following is the description of sales and cash receipts for the Lady’s Fashion Fair, a retail store dealing in expensive women’s clothing. Sales are for cash or credit, using the store’s own billing rather than credit cards. Each salesclerk has her own sales book with prenumbered, three-copy, multicolored sales slips attached, but perforated. Only a central cash register is used. It is operated by the store supervisor, who has been employed for 10 years by Alice Olson, the store...
You will write a program that loops until the user selects 0 to exit. In the...
You will write a program that loops until the user selects 0 to exit. In the loop the user interactively selects a menu choice to compress or decompress a file. There are three menu options: Option 0: allows the user to exit the program. Option 1: allows the user to compress the specified input file and store the result in an output file. Option 2: allows the user to decompress the specified input file and store the result in an...
PART I- TRUE-FALSE QUESTIONS Following 15 questions are True-False Questions. Write ‘T’ for True and ‘F’...
PART I- TRUE-FALSE QUESTIONS Following 15 questions are True-False Questions. Write ‘T’ for True and ‘F’ for False in the True / False Answer Box. Each question carries ‘2’ mark. Excess capacity characterizes firms in monopolistically competitive markets, even in situations of long-run equilibrium. A competitive market will typically experience entry and exit until accounting profits are zero A monopolist produces an efficient quantity of output but it is still inefficient because it charges a price that exceeds marginal cost...
c++ Program Description You are going to write a computer program/prototype to process mail packages that...
c++ Program Description You are going to write a computer program/prototype to process mail packages that are sent to different cities. For each destination city, a destination object is set up with the name of the city, the count of packages to the city and the total weight of all the packages. The destination object is updated periodically when new packages are collected. You will maintain a list of destination objects and use commands to process data in the list....