Searcharxiv⌕ Search

arXiv subjects

Robin K. S. Hankin

Publications and source records attributed to Robin K. S. Hankin.

15 recordsLinked to original sources

Introducing the vfunc R package

$f,g\colon\mathbb{R}\longrightarrow\mathbb{R}$, it is natural to define $f+g$ as the function that maps $x\in\mathbb{R}$ to $f(x) + g(x)$. However, in base R, objects of class function do not have arithmetic methods defined, so idiom such as "f + g" returns an error, even though it has a perfectly reasonable expectation. The vfunc package offers this functionality. Other similar features are provided, which lead to compact and readable idiom. A wide class of coding bugs is eliminated.

cs.SC↗

Discrete Lanchester attrition models: the case of precautionary surrender

Discrete Lanchester-type attrition models describe many types of antagonistic situations; the preferred interpretation is two fleets of battleships, each trying to sink the other. Such models may be characterised by a bivariate recurrence relation. Here I consider a restricted case in which a fleet that finds itself two or three units behind its opponent immediately surrenders. I present some theoretical and numerical results and suggest lines for further work.

physics.soc-ph↗

The free Abelian group in R: the frab package

In this short article I introduce the frab package which provides an alternative interpretation of named vectors in the R programming language; it is available on CRAN. The underlying mathematical object is the free Abelian group.

cs.SC↗

Jordan algebra in R

In this short article I introduce the "jordan" package which provides functionality for working with different types of Jordan algebra. I give some numerical verification of the Jordan identity for the five types of Jordan algebras. The package is available on CRAN at https://CRAN.R-project.org/package=stokes.

cs.SC↗

Quantum algebra in R: the weyl package

Weyl algebra is a simple noncommutative system used in quantum mechanics. Here I introduce the weyl package, written in the R computing language, which furnishes functionality for working with univariate and multivariate Weyl algebras. The package is available on CRAN at https://CRAN.R-project.org/package=weyl.

cs.SC↗

A systematic search for a three-velocity gyrodistributive law in special relativity with the lorentz R package

Here I present the lorentz package for working with relativistic physics. The package includes functionality for four-vector transformations, three-velocity addition, and other relativistic processes such as the behaviour of photons. It was designed to facilitate the search for a gyrodistributive law. In special relativity, three-velocities and scalars constitute a gyrovector space with addition $\oplus$ and scalar multiplication $\odot$. Standard vector spaces obey the distributive law $a(x + y) = ax + ay$ for scalar $a$ and vectors $x$, $y$; but no analogous gyrodistributive law for $r\odot (u \oplus v)$ is known. The package was designed to facilitate the search for a gyrodistributive law and includes functionality for four-vector transformations and three-velocity addition, which is noncommutative and nonassociative. I use the package to systematically sweep a large space of potential gyrodistributive laws, without success. The package is available on CRAN, at \url{https://CRAN.R-project.org/package=lorentz}.

physics.class-ph↗

The free group in R

Here I present the freegroup package for working with the free group on a finite set of symbols. The package is vectorised; internally it uses an efficient matrix-based representation for free group objects but uses a configurable print method. A range of R-centric functionality is provided. It is available on CRAN at https://CRAN.R-project.org/package=freegroup.

cs.SC↗

The free algebra in R

The free algebra is an interesting and useful algebraic object. Here I introduce "freealg", an R package which furnishes computational support for free algebras. The package uses the standard template library's "map" class for efficiency, which uses the fact that the order of the terms is algebraically immaterial. The package follows "disordR" discipline. I demonstrate some properties of free algebra using the package, and showcase package idiom. The package is available on CRAN at https://CRAN.R-project.org/package=freealg.

cs.SC↗

Clifford algebra in R

Here I present the 'clifford' package for working with Clifford algebras in the R programming language. The algebra is described and package idiom is given.

cs.SC↗

Stokes's theorem in R

In this short article I introduce the stokes package which provides functionality for working with tensors, alternating forms, wedge products, and related concepts from the exterior calculus. Notation and spirit follow Spivak. Stokes's generalized integral theorem, viz $\int_{\partial X}ϕ=\int_Xdϕ$, is demonstrated here using the package; it is available on CRAN athttps://CRAN.R-project.org/package=stokes.

cs.SC↗

Fast multivariate polynomials in R: the mvp package

In this short article I introduce the mvp package, which provides some functionality for handling multivariate polynomials. The package uses the C++ Standard Template Library's map class to store and retrieve elements; it conforms to disordR discipline for coefficients. The package is available on CRAN at https://CRAN.R-project.org/package=mvp.

cs.SC↗

Sparse arrays in R: the spray package

In this short article I introduce the spray package, which provides some functionality for handling sparse arrays. The package uses the C++ Standard Template Library's map class to store and retrieve elements. One natural application for sparse arrays is multivariate polynomials and I give two examples of the package in use, one drawn from the fields of random walks on lattices and one from the field of recreational combinatorics. The package is available on CRAN at https://CRAN.R-project.org/package=spray.

cs.SC↗

Disordered vectors in R: introducing the disordR package

Objects in the {\tt stl map} class of {\tt C++} associate a value to each of a set of keys. Accessing values or keys of such an object is problematic in the R programming language because the value-key pairs are not stored in a well-defined order. This document motivates and discusses the concept of "disordered vector" as implemented by the {\tt disordR} package which facilitates the handling of {\tt map} objects. Values and keys of a map are stored in an implementation-specific way so certain extraction and replacement operations should be forbidden. For example, if values are real, then the "first" value is implementation specific\ldots but the maximum value has a well-defined result. The {\tt disordR} package makes forbidden operations impossible while allowing transparent R idiom for permitted operations. An illustrative R session is given in which the package is used abstractly, without reference to any particular application, and then shows how it can be used to manipulate multivariate polynomials. The {\tt disordR} package is a dependency of {\tt clifford}, {\tt freealg}, {\tt hyper2}, {\tt mvp}, {\tt spray}, {\tt stokes}, and {\tt weyl}. The {\tt disordR} package is available on CRAN at \url{https://CRAN.R-project.org/package=disordR}.

cs.SC↗

A liability allocation game

The following problem is considered. Two players are each required to allocate a quota of~$n$ counters among~$k$ boxes labelled~$1,2,\ldots,k$. At times $t=1,2,3,\ldots$ a random box is identified; the probability of choosing box~$i$ is~$p_i$. If a player has at least one counter in the chosen box, she removes one counter from it; otherwise she takes no action. The winner is the first player to remove all her counters. The game so described may be modified so that each player simultaneously, but independently, identifies a box at random. This paper analyses this deceptively simple game, which has apparently not been studied in the literature. Some analytical and numerical results are then presented, followed by some challenges for further work.

math.CO↗

Visually pleasing knot projections in R

In this short article I introduce the knotR package, which creates two dimensional knot diagrams optimized for visual appearance using the R programming language. The knotR package is a systematic R-centric suite of software for the creation of production-quality artwork of knot diagrams, released under GPL2.

math.GT↗