Function Repository Resource:

TapeDiagram

Source Notebook

Visualize fractions, integers and multiplication using tape diagrams

Contributed by: Wolfram|Alpha Math Team

ResourceFunction["TapeDiagram"][n/d]

creates a tape diagram representing a single fraction n/d.

ResourceFunction["TapeDiagram"][m]

creates a tape diagram representing a single whole number m.

ResourceFunction["TapeDiagram"][n/d*m]

creates a tape diagram representing the multiplication of a whole number m by a fraction n/d.

ResourceFunction["TapeDiagram"][n*m]

creates a tape diagram representing the multiplication of two whole numbers m and n.

ResourceFunction["TapeDiagram"][{expr1,expr2,}]

creates a stack of tape diagrams.

Details

ResourceFunction["TapeDiagram"] accepts inputs greater than 1/200 and less than 200.
ResourceFunction["TapeDiagram"] has the same options as Graphics, with the following additions:
"BracketPosition"Automaticcontrols the placement of the brackets and their labels
"DotAfterIntegerPart"Automaticshows a dotted outline around the fractional part of the represented number
FontColorBlacksets the font color of the text in the tape diagram
FillingStyleRGBColor[0.99,0.9,0.5]sets the color for the filled part of the tape diagram
"IntegerMarkers"Falsedraws thick lines at intervals of one throughout the tape
"TapeColor"RGBColor[0.95,0.95,0.95]sets the color for the unfilled part of the tape diagram
"SubdivisionWidth"Noneadds dashed lines at intervals of a given width
"UnitLabels"Automaticsets the text of the label displayed in the sections of the tape diagram
The following settings for the "BracketPosition" option can be given:
Topplaces the brackets and labels on top of the tape diagram
Bottomplaces the brackets and labels on the bottom of the tape diagram
Noneremoves brackets and their labels
Automaticfor tape diagrams showing multiplication of a fraction by a whole number, one bracket appears on top and the other on the bottom
"SubdivisionWidth" can be set to a positive numeric value.
ResourceFunction["TapeDiagram"] has the attribute HoldAll.

Examples

Basic Examples (3) 

Create a tape diagram representing a single fraction:

In[1]:=
ResourceFunction["TapeDiagram"][1/2]
Out[1]=

Create a tape diagram representing the multiplication of a fraction and a whole number:

In[2]:=
ResourceFunction["TapeDiagram"][2/3 * 9]
Out[2]=

Create a stack of tape diagrams:

In[3]:=
ResourceFunction["TapeDiagram"][{1, 1/2, 1/3, 1/4}]
Out[3]=

Scope (2) 

Create a tape diagram representing an improper fraction:

In[4]:=
ResourceFunction["TapeDiagram"][6/4]
Out[4]=

Create a tape diagram representing the multiplication of two whole numbers:

In[5]:=
ResourceFunction["TapeDiagram"][3 * 5]
Out[5]=

Options (18) 

BracketPosition (3) 

Move the brackets to the Top or Bottom of the tape:

In[6]:=
ResourceFunction["TapeDiagram"][3/4, "BracketPosition" -> Top]
Out[6]=
In[7]:=
ResourceFunction["TapeDiagram"][3/4, "BracketPosition" -> Bottom]
Out[7]=

Use None to show a tape with no brackets:

In[8]:=
ResourceFunction["TapeDiagram"][3/4, "BracketPosition" -> None]
Out[8]=

For tapes showing multiplication of a fraction by a whole number, both brackets are adjusted:

In[9]:=
ResourceFunction["TapeDiagram"][ 2/5* 10, "BracketPosition" -> Top]
Out[9]=
In[10]:=
ResourceFunction["TapeDiagram"][ 2/5* 10, "BracketPosition" -> Bottom]
Out[10]=

DotAfterIntegerPart (4) 

For a single fraction with sufficiently wide divisions, the tape automatically becomes dotted after the largest full integer:

In[11]:=
ResourceFunction["TapeDiagram"][7/3]
Out[11]=

When the tape divisions are small, the dotting is automatically turned off:

In[12]:=
ResourceFunction["TapeDiagram"][63/8]
Out[12]=

"DotAfterIntegerPart" can be set to True or False to control when the dotting appears:

In[13]:=
ResourceFunction["TapeDiagram"][7/3, "DotAfterIntegerPart" -> False]
Out[13]=
In[14]:=
ResourceFunction["TapeDiagram"][63/8, "DotAfterIntegerPart" -> True]
Out[14]=

For tapes representing multiplication of a fraction by a whole number, the dotting begins after a length representing the given whole number:

In[15]:=
ResourceFunction["TapeDiagram"][5/3 * 12]
Out[15]=

IntegerMarkers (1) 

Emphasize intervals of length one by setting "IntegerMarkers" to True:

In[16]:=
ResourceFunction["TapeDiagram"][10/2, "IntegerMarkers" -> True]
Out[16]=
In[17]:=
ResourceFunction["TapeDiagram"][25/4, "IntegerMarkers" -> True, "DotAfterIntegerPart" -> True]
Out[17]=

FillingStyle (1) 

Change the filling style of the tape:

In[18]:=
ResourceFunction["TapeDiagram"][5/8, "FillingStyle" -> Red]
Out[18]=

TapeColor (1) 

Change the color of the tape itself:

In[19]:=
ResourceFunction["TapeDiagram"][1/4, "TapeColor" -> Gray]
Out[19]=
In[20]:=
ResourceFunction["TapeDiagram"][3/5, "FillingStyle" -> Green, "TapeColor" -> Darker[Green]]
Out[20]=

FontColor (1) 

Change the font color of the tape labels:

In[21]:=
ResourceFunction["TapeDiagram"][4/5*20, "FontColor" -> Orange]
Out[21]=

SubdivisionWidth (2) 

The "SubdivisionWidth" option allows the user to add additional subdivisions to the tape, for example, visualizing subdivisions of width 1/8 on a tape representing 1/2:

In[22]:=
ResourceFunction["TapeDiagram"][1/2, "SubdivisionWidth" -> 1/8]
Out[22]=

Setting a "SubdivisionWidth" for a stack of tape diagrams applies the subdivision to all tapes at once:

In[23]:=
ResourceFunction["TapeDiagram"][{2, 3, 4}, "SubdivisionWidth" -> 1/2]
Out[23]=

UnitLabels (5) 

Setting the "UnitLabels" option to False removes the labels that show in each section of the tape:

In[24]:=
ResourceFunction["TapeDiagram"][3/5, "UnitLabels" -> False]
Out[24]=

Setting the "UnitLabels" option to Tooltip removes the labels that show in each section of the tape and also adds a Tooltip showing the value of each section:

In[25]:=
ResourceFunction["TapeDiagram"][3/5, "UnitLabels" -> Tooltip]
Out[25]=

For tapes that are small, the "UnitLabels" option is automatically set to Tooltip:

In[26]:=
ResourceFunction["TapeDiagram"][3/5, ImageSize -> Tiny]
Out[26]=

Define custom unit labels by setting the value of "UnitLabels" to any string:

In[27]:=
ResourceFunction["TapeDiagram"][3/8 * 32, "UnitLabels" -> "four"]
Out[27]=
In[28]:=
ResourceFunction["TapeDiagram"][9/3, "UnitLabels" -> "x"]
Out[28]=

For stacks of tapes, "UnitLabels" can be set individually for each tape by providing a list of strings or a list of functions:

In[29]:=
ResourceFunction["TapeDiagram"][{1/2, 1/3, 1/4}, "UnitLabels" -> {"half", "third", "fourth"}]
Out[29]=

Publisher

Wolfram|Alpha Math Team

Version History

  • 2.0.0 – 23 March 2023
  • 1.0.2 – 28 March 2022
  • 1.0.1 – 23 March 2022
  • 1.0.0 – 08 June 2021

Related Resources

Author Notes

To view the full source code for TapeDiagram, evaluate the following:

In[1]:=
SystemOpen[
 FileNameJoin[{DirectoryName[FindFile["ResourceFunctionHelpers`"]], "NumberDiagrams.wl"}]]

License Information