Regression: Predicting the global land temperature of the Earth in 2050 from the past data

Problem Consider this dataset, usaTemperatureHistory.txt, which contains the global land temperature of the earth from 1743 to 2013 at every monthly resolution. As stated in the file, temperatures are in Celsius and reported as anomalies relative to the average global...

Understanding the Central Limit Theorem via random walk

In probability theory, the central limit theorem (CLT) establishes that, when independent random variables are added together, their properly normalized sum tends toward a normal distribution (informally a “bell curve”) even if the original variables themselves are not normally distributed....

Finding the maximum value of an array via recursive function calls

Problem Write a recursive Python function findMaxVal() that takes an input list of numbers and returns the maximum value stored the list. Do not use any max() function from any Python package. Your code should only contain if blocks and...

Finding the position of the maximum value of an array via recursive function calls

Problem Write a recursive Python function findMaxValMaxLoc() that takes an input list of numbers and returns, as a tuple, both the maximum value and the position (index) of maximum value in the input list. Your function should return None if...

Making and using a Dynamic-Link Library (DLL) from a Fortran procedure using Intel Fortran Compiler on Windows OS: getSquare()

Consider the following example Fortran function contained in Fortran module Square_mod which takes an input real number of type real64 and returns its square as output, module Square_mod implicit none contains function getSquare(val) result(valSquared) use, intrinsic :: iso_fortran_env, only: RK...

Calling Fortran function from other languages via a Dynamic-Link Library (DLL): getPower()

Consider the following example Fortran function contained in Fortran module Power_mod which takes an input real number base of type real64 and an integer variable expo of type int32 and returns $\mathrm{base}^{\mathrm{expo}}$ as output, module Power_mod implicit none contains function...

Passing characters and strings from C to Fortran and from Fortran to C

Problem Consider the following example Fortran function getLowerCase which takes a string of arbitrary length as input and converts all of the upper-case letters to lower-case and returns the result as the output string, module String_mod implicit none use, intrinsic...

Passing allocatable string from Fortran to C

Problem Consider the following example Fortran function replaceStr which takes a string of arbitrary length as input and search string. Then it searches for patterns in the input string that match the search string and replaces them with the input...

Data transfer: Converting Comma-Separated-Values (CSV) input to formatted output

Problem Consider this comma-separated data file: data.in. Write a simple script named csv2formatted that takes two input arguments representing the input and output file names. Then, the script writes the same input float data to the output file data.out in...

The while-loop implementation of for-loop

Problem MATLAB Consider the following two vectors of temperatures in Celsius degrees to Fahrenheit, using a for-loop and then prints them on screen. Cdegrees = [-20, -15, -10, -5, 0, 5, 10, 15, 20, 25, 30, 35, 40] Fdegrees =...

Version-control using Git and GitHub

Git Guidelines. Use the following Markdown language references, or any other reference that you find or prefer, to perform the tasks requested in this question. Markdown language cheat-sheet (pdf) Markdown language reference (web) Adam Pritchard’s Markdown cheat-sheet (web) Write the...

Simple GitHub page from README.md file

GitHub Problem Part 1 Design a simple GitHub page for your project, using the main directory’s readme.md file. Submit the link to the page as your answer. Note that you don’t need to add anything extra to your readme file....

value, variable, type, syntax error

Problem Type the following in the command window and submit the results. Briefly explain what each assignment does. a = 1 b = 'x' c = true whos a b c a == c a + c d = [1...

Computing the area of a triangle

Problem An arbitrary triangle can be described by the coordinates of its three vertices: $(x1,y1),(x2,y2),(x3,y3)$, numbered in a counterclockwise direction. The area of the triangle is given by the formula, \[A = \frac{1}{2} \bigg| x2y3 - x3y2 - x1y3 +...

Time required for cooking a refrigerated egg

Problem As an egg cooks, the proteins first denature and then coagulate. When the temperature exceeds a critical point, reactions begin and proceed faster as the temperature increases. In the egg white, the proteins start to coagulate for temperatures above...

String concatenation using for-loop

Problem MATLAB Consider the following nested cell array, q = {{'a', 'b', 'c'}, {'d', 'e', 'f'}, {'g', 'h'}} Write a for-loop that extracts all the letters in the list and finally prints them all as a single string, abcdefgh Python...

String concatenation using for-loop I

Problem MATLAB Consider the following nested cell vector, List = { {'M','A','T','L','A','B'}, {' '}, {'i','s'}, {' '}, {'a'}, {' '}, {'s','t','r','a','n','g','e'}, {', '}, {'b','u','t',' '}, {'p','o','p','u','l','a','r'}, {' '}, {'p','r','o','g','r','a','m','m','i','n','g',' ','l','a','n','g','u','a','g','e'} }; Write a MATLAB script extractLetter.m that uses for-loop to...

Simulating the Monty Hall game

Problem Suppose you’re on a game show, and you’re given the choice of three doors, Behind one door is a car; behind the two others, goats. You pick a door, say No. 1, and the host of the show opens...

Impact of round-off errors on numerical computations

Problem MATLAB Consider the following program, formatSpec = 'With %d sqrt, then %d times ^2 operations, the number %.16f becomes: %.16f \n'; % the string format for fprintf function for n = 1:60 r_original = 2.0; r = r_original; for...

Regression: obtaining the most likely mean and standard deviation of a set of Standard Normally Distributed Random Variables

Problem Consider this dataset, Drand.mat, which contains a set of random numbers. Let’s make a hypothesis with regards to this dataset: We assume that this dataset is well fit by a Gaussian distribution. But, we don’t know the values of...