All Matches
Solution Library
Expert Answer
Textbooks
Search Textbook questions, tutors and Books
Oops, something went wrong!
Change your search query and then try again
Toggle navigation
FREE Trial
S
Books
FREE
Tutors
Study Help
Expert Questions
Accounting
General Management
Mathematics
Finance
Organizational Behaviour
Law
Physics
Operating System
Management Leadership
Sociology
Programming
Marketing
Database
Computer Network
Economics
Textbooks Solutions
Accounting
Managerial Accounting
Management Leadership
Cost Accounting
Statistics
Business Law
Corporate Finance
Finance
Economics
Auditing
Hire a Tutor
AI Study Help
New
Search
Search
Sign In
Register
study help
business
accounting for financial instruments
Questions and Answers of
Accounting For Financial Instruments
2. (C++ Futures with Non-void Return Types)Modify the code in Section 32.2.3 to create futures that return a double value corresponding to an option price. Test the new code. Furthermore, investigate
1. (Making Random Number Classes More Generic)In Chapter 31 and Section 32.2.1 we created a class hierarchy consisting of classes that encapsulate specific random number engines from C++ and Boost
1. (Quiz)The questions in this exercise are best answered by writing code, testing assumptions and examining output. To this end, we give a number of assertions and questions and you need to
7. (C++11 Promises 101)A promise is the counterpart of a future. Both are able to temporarily hold a shared state. Thus, a promise is a general mechanism to allow values and exceptions to be passed
6. (Shared Futures 101)We process the outcome of a concurrent computation more than once, especially when multiple threads are running. To this end, we use std::shared_future so that we can make
5. (Waiting on Tasks to Complete)In this exercise the client thread fires up four asynchronous functions. The signature of the function is:double Computation(int n);The client waits (a kind of
2. (Data Parallelism versus Task Parallelism, Quiz)Which of the following statements accurately describe data parallelism best and which accurately describe task parallelism?a)
1. (Concurrency versus Parallelism, Quiz)Which of the following statements are applicable to concurrency or parallelism (or both)?a) Use of shared resources.b) Goals are correctness, performance
7. (Extending the Framework in Figure 14.6, Brainstorming)The solution to this exercise is discussed in Chapter 31 but it does no harm to address the problem as early as possible in the book. The
6. (Log–Log and Semi-log Plots)In some cases we may wish to transform data in someway before presenting it in Excel.In general, the linear plot between the horizontal x and vertical y axes can be
5. (SDEs with Analytical Solutions)In some cases (we might get lucky) it is possible to find analytical solutions to SDEs(Kloeden and Platen, 1995, pp. 118–126). Some examples of SDEs and their
4. (The Cox–Ingersoll–Ross (CIR) Model)We examine the CIR interest-rate model (also known as square-root diffusion) defined as the following SDE with constant coefficients (Glasserman, 2004):dr =
3. (Cubic Spline Overshoots, Part II)In Chapter 13 we gave a detailed introduction to cubic splines and some of their applications.In particular, Exercise 5 in Chapter 13 was concerned with a
2. (Finite Difference Schemes for the One-Dimensional Heat Equation)An interesting and useful application of the Excel driver is in displaying the values of the approximate solutions (using FDM in
1. (Extensions to the Excel Driver)There are many ways to add new functionality to the Excel driver. In this exercise we focus on generalising the code.We wish to display functions of arity one and
6. (Generalisation of Code)Generalise the use cases in Section 13.6 to support a range of vector types (for example, Boost vectors and home-grown vectors) as well as norms other than the max norm
5. (Cubic Spline Overshoots)Consider the test data x = {1, 2, 3, 3.1, 5.1, 6, 7, 8} and y = {1.8, 1.9, 1.7, 1.1, 1.1, 1.7, 1.4, 1.9}. Apply cubic spline interpolation to this data set using
4. (The Saul’yev ADE Method)Implement this method for the heat equation as a variation of the discussion of the Barakat and Clark method in Section 13.4. In this case we use a single array to
3. (Numerical Differentiation)In Chapter 8 we discussed numerical differentiation of a function based on divided differences. We saw that this was an ill-posed problem using floating-point
2. (Performance of Tridiagonal Solvers)The objective of this exercise is to improve the performance of the tridiagonal solvers.Answer the following questions:a) Consider using move semantics instead
1. (Double Sweep Method)Generalise the Double Sweep method from one that supports Dirichlet boundary conditions to one that supports Robin boundary conditions:⎧⎪⎪⎨⎪⎪⎩ajUj−1 + bjUj +
12. (Trinomial Method, Project)We focused in Chapters 11 and 12 on the binomial method to price one-factor plain and American options. In this exercise we are interested in creating a small software
11. (Two-Dimensional Binomial Method, Small Project)The goal of this exercise is to implement the algorithm for the two-dimensional binomial method as discussed in Section 12.8. In particular, we
10. (Numerical Efficiency)We compare the relative efficiency of the CRR and Tian (see Tian, 1993) methods applied to the ATM European case K = S = 60, T = 1, r = 006, sig. = 0.3 (put = 5.335399, c =
9. (Dividend-Paying Options)Based on the code in Section 12.4.3 and the Black–Scholes formula, compute the following perpetual option values: American call and put with and without dividends.
8. (Efficiency Improvement)The code in Section 12.4.2 that computes the price of a discrete dividend-paying option is inefficient in the following sense: first, the (default) forward induction
7. (Simple Pricing)Use the code in the framework to price the following kinds of option:a) Futures contract, price = 4200, volatility = 15%, strike = 3800, T = 0.5. The put option premium is fully
6. (Computing Option Sensitivities II, Small Project)Write code to compute the sensitivities in equation (12.14). The requirements are that the code should be reusable, easy to understand, accurate
5. (Computing Option Sensitivities I)The goal of this exercise is twofold: based on the discussions in Section 12.5 we create a more user-friendly wrapper to compute option delta and gamma. We write
4. (American Option Pricing)In this exercise we use the binomial method to price American options. Answer the following questions:a) Compute the price of an American option for large values of the
3. (Binomial Option Pricing versus Exact Solution)Use formula (12.5) to compute the call price for the following payoffs: Symmetric power call:V(S, T) = max((S − K)p, 0). (12.43) Asymmetric power
2. (Performance Testing)We examine the code in Section 12.2 with a view to improving its run-time performance.Answer the following questions by writing code to compare the performance of candidate
1. (Pascal’s Triangle Functionality)There are many applications of Pascal’s triangle. We discuss some of them and the objective is to implement them in C++. Answer the following questions:a)
15. (Software Framework (New Version); Medium-Sized Project)The goal of this exercise is to extend the initial software framework that we introduced in this chapter to help model a larger range of
14. (Project: Using C++11 and C++14 to Improve Readability of Code)In previous chapters we introduced advanced C++ syntax to improve the readability of code, in particular: Scoped enumerators to
13. (Richardson Extrapolation)The binomial method is first-order accurate and it is possible to expand the binomial price as an asymptotic expansion depending on the number of time steps n as
12. (Sawtooth Phenomenon and Smoothing)One of the issues with some implementations of the binomial method is that the approximate solution oscillates around the true option price as the number of
11. (STL Compatibility and Emulation, Project)Using the design philosophy underlying the STL algorithms will improve the quality of the code for lattice ADTs and make the code less redundant.Answer
10. (Code Reduction Using Variadic Parameters)The algorithms for forward and backward induction in Layer 2 of the software framework use tuples. In particular, binomial lattices use tuples with two
9. (The Leisen–Reimer Method)It is well known that convergence of the solution of the binomial method to the true solution is not monotone in general and it tends to oscillate around the exact
8. Investigate the accuracy of the CRR model as a function of the number of time steps.Do you get better approximations when you increase the number of time steps? Test the accuracy for both even and
7. (Lattice Models)In Section 11.5 we priced an option using the CRR model to compute lattice parameters.In this section we discuss a number of alternatives to the CRR method:Answer the following
6. (Pascal’s Triangle)Use the code in Section 11.4.2 to compute Pascal’s triangle. Use a function object and a lambda function to implement the generator that computes up and down jumps.We shall
5. (C++ 11 Combinations)Based on the discussion in Section 11.4.3 consider the following general scenarios: Using function wrappers with embedded tuples. Using function wrappers with embedded
4. (Code Rewrite as a Useful Exercise in Code Versioning)Consider the code in Section 11.4 to price an American down-and-out call option.The objective of the current exercise is to manually
3. (Software Quality Characteristics in a Lattice Framework)We discuss some advantages associated with lattice ADTs. Discuss how they deliver the following benefits (McConnell, 2004):a) They hide
2. (Efficiency of ADT Implementations)We have implemented simple and generalised lattices using nested STL vectors and STL maps, respectively. The performance of these data structures may not be good
1. (Analysing Code)The C++ code in Section 11.4 was not written with maintainability in mind. In fact, it was written in a hurry because the manager wanted to see results for a quick prototype, a
3. (Comparing Singly and Doubly Linked Lists)In this exercise we carry out some operations on std::list (call it A for convenience) and std::forward_list (call it B).Answer the following questions:a)
2. (Creating Object Adapters for Bitset, Compile-Time (Composition))In this exercise we create a compile-time bit matrix (call it BitMatrix) consisting of N rows and M columns all of whose elements
1. (std::vector versus std::bitset)An alternative to bitsets is to employ the class std::vector. There has been much discussion about the shortcomings of this class (for example, it does not
9. (Determining the Requirements)This exercise attempts to simulate a discussion on how to discover and document system requirements for a new software product (see Sommerville and Sawyer, 1997 on
8. (Brainstorming, Configuration and Packaging)Once code has been written we need to test it and deliver it to clients. Determine how to deliver the following functionality:a) Separation of
7. (Brainstorming, Design and Coding)The focus in this exercise is to decide which of the design approaches 1, …, 5 from Section 9.8 in combination with modern C++ features to use for the following
6. (Brainstorming, Starting a Software Project)The next three exercises are meant to stimulate discussion on scoping and designing a software system and then packaging the code so that it can be used
5. (Which Category Does an Application Belong to?)In this book we discuss a number of applications in computational finance. In this exercise we wish to gain deep insights into understanding problems
4. (Alternative Implementation of the DVM Problem)The solution of the DVM system in this chapter was based on C++ templates and PBD. This may not be the most suitable approach in all situations. More
3. (Extending the DVM Code of Section 9.6)The initial code for the DVM problem needs to be extended to suit a wider range of customers. Some new features and requirements are:a) Remote management of
2. (Extending the PBD Design of Section 9.3.3)We ask some questions regarding the code in Section 9.3.3. The objective is to extend and modify the code in order to get hands-on experience with a
1. (Brainstorming Question)Consider steps 1, 2, 3 and 4 in Section 9.1. Answer the following questions from the perspective of software development (preciseness is not a concern at the moment; the
9. (Machine Precision Issues)This exercise requires that you do some research into how C++11 and Boost C++Math Toolkit support the following functionality (x is a given value): The next
8. (Machine Epsilon)Machine epsilon gives an upper bound on the relative error due to rounding in floatingpoint arithmetic. In C++11, epsilon is the difference between 1.0 and the next representable
7. Consider the following code:// Exception handling{std::cout
6. (Exception Handling, Small Research Project)This chapter seems to be a suitable place to discuss how C++ supports exception handling, error codes and error conditions (see Josuttis, 2012 for an
5. (Gauss–Legendre Quadrature)In this exercise we discuss some topics related to Section 8.5.Answer the following questions:a) Implement the 6-point formula with the following pairs of weights and
4. Explain what the output of the following code is:double S = 2.0; double K = 65.0; double h = 1.0;double sum = 0.0;for (int i = 1; i
3. Which of the following statements are true?a) DBL_MIN/2 is subnormal.b) – 0.0 is zero.c) 1.0/0.0 is Inf.d) 1.0 is normal.
2. Which one of the following is not a NaN?a) std::exp(800).b) INFINITY – INFINITY.c) 0/0.d) std::log(0.0/1.0);.
1. Which three of the following statements are true?a) std::isinf determines if a number is positive infinity or negative infinity.b) std::fpclassify categorises floating-point numbers.c)
13. (Class Hierarchies, Brainstorming)Consider the following class hierarchies and Gen/Spec relationships. Which ones are semantically correct, which ones are semantically incorrect and can you model
12. (Designing a Monte Carlo Framework)In Section 7.2.3 we produced a context diagram that shows the modules/subsystems that participate in a Monte Carlo option pricer that we shall discuss in more
11. How can you identify code (in general terms) that is not using Whole–Part?a) The participating objects tend to fail SRP, in other words weak separation of concerns.b) Classes tend to have
10. Which choice for modelling functions results in the most flexible software?a) Dynamic polymorphism.b) Static polymorphism (CRTP pattern).c) Universal function wrapper.d) Free functions (C
9. Give the top three risks associated with deep inheritance hierarchies:a) They become increasingly difficult to maintain.b) There is a probability that the inherited functionality is semantically
8. How can the Fragile Base Class Problem be resolved?a) Using interfaces (if they are supported) instead of base classes.b) Using more composition and less inheritance.c) Making some base class
7. What is the Fragile Base Class Problem?a) A base class which when modified can cause derived classes to malfunction.b) A base class containing many abstract methods that must be overridden in
6. Which two (most important) symptoms in your opinion can manifest themselves if a class does not satisfy SRP?a) The number of methods in a class increases (threshold value ∼ 12).b) Class
5. Explain why the following member function of class Point does not compile:constexpr double Distance(const Point& pt2) const{return std::sqrt((x - pt2.x)*(x - pt2.x) + (y - pt2.y)*(y -
4. Which of the following statements are true?a) constexpr applies to both objects and functions.b) All const objects are also constexpr objects.c) The output from a constexpr function will be known
3. In this exercise we investigate the copy constructor and copy assignment operator as default and deleted forms (there are four choices of default/delete for these two functions).One choice is://
2. Which of the following statements are advantages of using deleted functions compared to declaring these functions as private as in the C++98 standard?a) Calling a deleted function will cause a
1. (Explicit Constructors)Consider the following class:struct B{explicit B(int) {}explicit B(int, int) {}explicit operator int() const { return 0; }};Create a program to test the class. Which lines
12. (Creating Stochastic Differential Equations, Brainstorming)The approach in Section 6.9 seems to be relatively new and innovative. We have asked several quant developers for their opinions on how
11. (Capture Modes, Brainstorming Question)In Sections 6.5, 6.6 and 6.7 we introduced generic lambda functions, some examples and how to deal with captured variables. It is natural to ask which
10. (Conversions)Sometimes you may wish to structurally change fundamental properties of types in an application. Examples are: Mapping integers to unsigned integers and vice versa. Adding/removing
9. (Array Categories)We discuss some functions that work with array types. The rank of an array type is equal to the number of dimensions of the array. The extent of an array type is the number of
8. (Simple Switchable Bridge Functionality)We create a template function that supports both pointers and reference types. If it is a pointer it is dereferenced and then printed while if it is not a
7. (Pointers and Non-pointers)This exercise consists of calling some functions from the Primary type category.Answer the following questions:a) Write a function to determine if a type is a pointer,
6. (Other Type Traits, Investigation)This exercise entails determining which type traits functions to use for the following functionality. Having discovered the appropriate functions then create some
5. Which of the following statements are true regarding a variadic function?a) It is declared using ellipses.b) It is not possible to make a copy of the variadic function arguments.c) It accepts any
4. Which statements describe a variadic function?a) Arguments whose types are variant.b) Takes a variable number of template arguments.c) Takes a variable number of arguments of specific types.d)
3. (Arithmetic Types)a) Which of the following types are of arithmetic type? int, int const, int &, int*, float, float const, float &, float *.b) Consider std::complex. Does it fit into the following
2. Consider the code:// Testing arithmetic types std::cout
1. Give the top two advantages of type traits:a) Creating type-independent code.b) ‘Compile-time’ reflection.c) It is a replacement for subtype polymorphism.d) It is used to add properties to C++
8. (Performance)Consider the following code to generate arrays containing uniform random values:std::vector compute(){ // Re-seed uniform generator when requesting a new path
7. (Generalising the Code for Newton–Raphson)a) In Section 5.6.2 we applied the Newton–Raphson method to find the solution of ex = 148.4131591. Generalise the code so that it works with any
6. (Reviewing the Code, Small Project)The goal of this exercise is to understand the code examples in Section 5.2 and to apply them in your own programs.Answer the following questions:a) Since a
5. What are the main differences between tuples and sets in C++?a) Sets and tuples may have elements of heterogeneous types.b) A tuple may have multiple instances of the same element.c) A tuple has a
4. Which of the following features are supported by C++ tuples?a) Associating C++ variables with a tuple’s elements.b) The ability to forward elements of a tuple to a function taking tuple
3. Which of the following functionalities can be used to construct tuples?a) std::make_tuple.b) Initializer lists.c) Tuple concatenation.d) Using std::tie to create a tuple of lvalue references.
Showing 1 - 100
of 920
1
2
3
4
5
6
7
8
9
10