Arithmetic and application of summaries

Assignment Help Programming Languages
Reference no: EM13235613

1. In his book, Professor Stewart's Hoard of Mathematical Treasures, Ian Stewart asks readers to compute the following expressions.

(8 x 8) + 13
(8 x 88) + 13
(8 x 888) + 13
(8 x 8888) + 13
(8 x 88888) + 13
(8 x 888888) + 13
(8 x 8888888) + 13
(8 x 88888888) + 13

Write some R code that carries out this computation, but do it with a single R expression that contains no commas (,) and no braces ({}).

Hints: This exercise is about computations with vectors. You can do it with sequence generation, simple arithmetic and application of summaries.

2. A Pythagorean triple consists of three positive integers a, b and c with a2 + b2 = c2. Without using control flow constructs (if, for, while and repeat), use R to list all Pythagorean triples with a, b and c less than 1000 and a < b < c (there are 881 such triples).

Hints: Positive integers, a and b, will be part of a triple whenever the square root of a2 + b2 is an integer. You will need try all combinations of a and b less than or equal to 1000 and check whether a < b and that √a2 + b2 is an integer less than or equal to 1000. Sequence generation, repetition and subsetting may prove useful.

3. Some digits look (nearly) the same when turned upside-down (0, 1, 8). Two more come in a pair, each being the other turned upside down (6, 9). The rest (2, 3, 4, 5, 7) don't look like digits when turned upside down.

Some years look the same when turned upside-down. For example, 1691 is unchanged if turned upside down. (Note that turning a year upside down means turning the digits upside down and reverseing their order.)

Reference no: EM13235613

Questions Cloud

How should bp have handled external environmental analysis : How should BP have handled an external environmental analysis and what environmental change and trends (opportunities and threats) might they have discovered?
What is the total annual order and inventory holding costs : Customer orders are placed, the order is picked and packaged, and then shipped to the customer. A fixed order quantity inventory control system helps monitor and control these SKUs. The following information is for one of the calculators that they..
State precipitate of cu form when naoh is added solution : Will a precipitate of Cu(OH)2 (Ksp = 1.6x10-19) form when 10.0 mL of 0.010 M NaOH is added to 1.00 L of a 0.010 M CuCl2 solution
What should the wedding business owners : What external environment (general, industry, and competitive) segments do you think BP considered or didn't consider prior to their drilling off the Gulf Coast? What should the wedding business owners now consider in their external environment?
Arithmetic and application of summaries : Write some R code that carries out computation, but do it with a single R expression that contains no commas (,) and no braces ({}).
What theory or theory might court use to hold wallace liable : Dale Emerson served as the chief financial officer for Reliant Electric Company, a distributor of electricity serving portions of Montana and North Dakota. Reliant was in the final stages of planning a takeover of Dakota Gasworks
Which of the following is not a cost of changing capacity : Which of the following is not a cost of changing capacity?
What charge must be used : An electric field E with an average magnitude of about 150 N/C points downward in the atmosphere near Earth's surface, What charge (both sign and magnitude) must be used
Compute the maximum amount of thorium ion : Calculate the maximum amount of thorium ion that could be present in a waste water, if it is made 0.1500 M in oxalate ion. Assume the oxalate is present in stoichiometric amount, compared to the thorium.

Reviews

Write a Review

Programming Languages Questions & Answers

  Which functions perform assignment score to private member

Consider this class definition: class quiz { public: quiz( ); int f( ); int g( ) const; private: double score; }; Which functions can carry out an assignment score=1.0; to the private member variable score?

  Write program which reads three integer from input dialogs

Write down the program which reads three integer. Integers are entered from input dialogs and stored in variable num1, num2, and num3, respectively.

  Write a program to clean up lane9.dat

Write a program to clean up lane9.dat. Write all numbers and spaces to cleanlane9.txt.

  Program-calculate power loss-transmitted-power generating

Write a program to calculate power loss in transmission line with resistance of 0.05 ohms/mile. Calculate power loss if 500 kW of power is transmitted from power generating station.

  Write driver class to instantiates-updates flight objects

Write a driver class called FlightTest whose main method instantiates and updates several Flight objects. Two classes are needed for this project: Flight and FlightTest.

  Write program prompts to enter three sides of triangle

Write a program which prompts the user to enter three sides of a triangle and your program will display the three sides and its category of either equilateral, isosceles or all unequal.

  Write program to calculate diameter in centimeters of rod

Write program to calculate diameter in centimeters of a steel rod, an aluminum rod, and a copper rod, which can withstand a particular compression load.

  Design program which uses array of shape

Design a program which uses the array of Shape references to objects of each concrete class in hierarchy. The program must print text description of object to which each array element refers.

  Create program to produce a summary of amounts due

Create a program that will produce a summary of the amounts due for Pat's Auto Repair Shop. Display a splash screen first, then display the Job Information Form.

  Program to calculate interest on account balance

10% of total amount owed, which ever is larger. Program comprises loop which lets user repeat this computations until user says she or he is done.

  Neeed to prepare an cgi script that send mass emails

Neeed to prepare an CGI Script that send mass emails - Input fields Sender Name: Sender Email: Subject: Message: choose, by default HTML Emails and send button the script should print the progress of sending.

  Design application to declare an array

Design an application that declares an array of 10 HousePlants. Prompt the user user for data for each of the HousePlants, then display all the values.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd