After the successful installation of R in BeagleBoard XM, it is natural to come up with a concept of a calculator running R. The ingredients are simple: a small form factor BeagleBoard, a LCD screen, a simple keypad. R can run on Android but as a keypad passionate, no touch screen is better than the feel of real key punch.
As a proof of concept and also a weekend project, the R on the BeagleBoard is “bridged” across an Apache web server (also on the BB), to be accessed by an Android app which act as input device for R commands. Result returned from R is then forwarded to an 16×2 LCD screen from a previous IoT prototype with TI MSP430 MCU and a TP Link portable router with OpenWRT.
A little delay, but works.
The Android app is done in MIT App Inventor. It is a very nice graphical, easy to use, completely web based application to build Android app. No typing of code is required.
From the “HP 12C Platinum Solutions Handbook”, an example is given on calculation of refinancing an existing mortgage (on page 7). Since the HP 12C is a special breed specializing in financial calculations, much of the steps are optimized and is different from using financial functions available on other higher end calculators like the TI Nspire. In the following re-work of the same example, the Finance Solver is called from within the Calculator Page and the Vars are recalled for calculations.
Monthly payment on existing mortgage received by lender calculation.
Monthly payment on new payment calculation.
Net monthly payment to lender, and Present value of net monthly payment calculation.
While curious on how C code are optimized by compiler on mathematical functions, two implementations of the standard normal distribution are compared in terms of performance. The aim is to provide insight on how the generated machine code performs, without having to actually inspecting them. The function is an approximation function coded in standard C. It should be noted that both functions implement the same approximation, but the actual equation is a little bit different in terms of number of multiplication operator. The first implementation is with less multiplication operators: i.e.
While the second one is a modified version with more multiplication operators, e.g. expanding k5 to k*k*k*k*k.
A scaffolding test rig is used to loop 10 million times, within it, the approximation function is called from 0 to 1 in steps of 0.1. Visual Studio is used for the code compilation, and 20 samples are collected from each of the two functions. For the analysis, the TI-84 Pocket SE is used to carry out 2-sample T test in the procedure below:
By evaluating the p-value, It looks like the first version of more compact C code performed better and perhaps there is little the compiler can help here.
On a local newspaper yesterday, this question is reported to be controversial for primary school examination since it is too difficult. It goes like this. There are two people and the older one said:
“When I was at your age, you were only 5.
When you become as old as I am now, I will become 71.” The question is, how old are these two people?
It turns out, according to the newspaper, the question is not aimed at simultaneous equation at all, but to solve the problem by graphically dividing lines in proportion.
To solve in an overkill fashion by Nspire:
And this is also a refresher on how to solve simultaneous equations on TI-84 series using the rref function (reduced row echelon form). Define the equations in form of matrix (as [A] below), and then run the rref() function on it. The result matrix contained the solution to the problem.
And just in case Excel is the only tool available, no worry, its solver will get you covered (!).