text:
## Featured resource

### Defining Mathematics Education *REDUCED*

The Seventy-fifth Yearbook is a celebration and reflection of the history of the NCTM yearbooks, and is a great resource on the key issues of mathematics education through the years.

Members: $21.00 inc.GST Others:$ 26.25 inc.GST

Home > Engaging All Students > Starting Points > Snakes on the Rocks

# Snakes on the Rocks

The focus of the lesson is developing early algebraic thinking through growing patterns. While doing this children will be showing their facility with number sequences and counting patterns. Ordinal number is also used.

#### Materials

• Five ice-cream containers or other items which can be imagined as rocks when turned upside down
• About 50 pieces of wool to be the snakes
• A3 Paper and pencils for the students for their work task

#### The lesson

The children all sat on the floor in a large oval so they could all see what was happening.
The five rocks (in the form of upside down icecream containers) were placed in a row on the floor in the centre of the group. I told them to use their imaginations and imagine that these are rocks and asked them to tell me something about the rocks they were imagining. “They are hard”, “they are brown and black” “One is green” “They are in a line”. I talked about the rocks using ordinal numbers making it clear which was the first rock and asking students to identify the second rock, the fourth rock, etc.

I showed the students my collection of pieces of wool but I called them my collection of snakes. I then read the poem, acting out the movements of the snakes and placing one on the first rock, two together on the second rock, three on the third etc. as the poem was read. I placed the five as a group on the fifth rock so they couldn’t see them easily to count them. After each verse of the poem I asked them about how many were on the first rock, the second etc making sure they know which rock is which and that the numbers building up the pattern are drawn to their attention. At the end of the poem I asked them how many were on the fifth rock (the question in the poem) and how they knew without counting them. We went over the pattern again making sure many students had had a chance to answer a question then I asked them to imagine a sixth rock. How many would be on it?

We repeated the task but this time I started with 4 snakes on the first rock, 5 on the second etc.

For the third reading of the poem, I started with one on the first rock again but had 3 on the second and five on the third etc.

For the fourth one, I started with ten on the first rock, but had nine on the second, eight on the third etc.

I did another where I started with 4 and went 6, 8 , 10

When I judged that the students had the idea that the starting number could be different, the numbers could increase or decrease and the increases could be one, two, three or ... , I told them I wanted them to make up their own pattern.  I asked some of them to share what number of snakes they might consider starting with on the first rock.  They were told to draw five shapes for rocks and then decide what number of snakes they would put on their rocks for their pattern.  They went to the tables to do their drawings and I moved around checking they knew what to do and had started – also telling them the rocks just had to be circles and didn’t need to be coloured in.  They were told when they finished they could extend their patterns if they wished by adding a sixth seventh eight and more rocks or that they could make a few different patterns on their paper.

When everyone had at least one pattern of 5 rocks on their sheet I asked them to bring their pictures back to the floor to share what they had done.  During the sharing we focused on some of the different patterns noting the different starting points, the different increases (or decreases) and extending the patterns beyond.  For each pattern I asked about a rock extending the pattern.  For example to extend the ideas, with a simple pattern with 6 rocks I asked how many would be on the eighth rock.

The sharing was what amazed me.  Everyone had managed to draw rocks with snakes.  All but one had a pattern of some kind.  For most of them the number of snakes they had drawn on the rocks corresponded to the number they wrote alongside.  There was one child though where there was no relationship.  He still managed to draw snakes on rocks and write numbers and proudly counted the snakes on one of the rocks for me.

Click on the following student's work to hear Marj's analysis of the student learning.

Another child had drawn 5 snakes on each rock while yet another had used a repeating pattern rather than a growing pattern and had 5, 6, 5, 6, 5 but had the numbers and the number of snakes correct.

The student work here below shows number sequences but is not related at all to the snakes.  The student though was very happy writing the numbers

Then there were students with a range of growing patterns, some extended.

Then there were two students who moved outside the box and tried some different patterns – the one shown here was 2, 1, 4, 3, 5 – she wasn’t sure how to keep going.  One student though increased the decrease each time and had 10, 9, 7, 4, 0.

#### Key mathematical content

• Number patterns
• Odd numbers
• Even numbers
• Counting patterns
• Ordinal number

#### Acknowledgement

This is based on an activity from the Navigator series published by NCTM and the poem with permission of Carole Greenes.

[contributed by Marj Horne, Connect with Maths Community Leader]

Go to the Starting Points Forum to join the discussion about Snakes on the Rocks or find more Starting Points.

## Alejandra

Alejandra drew rocks with snakes. She had a pattern of some kind.  For most students the number of snakes they had drawn on the rocks corresponded to the number they wrote alongside

## Sam

Sam didn't draw a relationship or pattern. He still managed to draw snakes on rocks and write numbers and proudly counted the snakes on one of the rocks for me.

## Avin

Avin drew 5 snakes on each rock.

## Avin 2

Avin continued to create a new page using a repeating pattern rather than a growing pattern and had 5, 6, 5, 6, 5 but had the numbers and the number of snakes correct.

## Ben

Ben shows number sequences but is not related at all to the snakes.  The student though was very happy writing the numbers.

## Danielle

Danielle was one of a group of students who created with a range of growing patterns, some extended.

Adrian was one of a group of students who created with a range of growing patterns, some extended.

## Annie

Annie was one of a group of students who created with a range of growing patterns, some extended.

## Matthew

Mathew
Matthew was one of two students who moved outside the box and tried some different patterns – the one shown here was 2, 1, 4, 3, 5 – she wasn’t sure how to keep going.  One student though increased the decrease each time and had 10, 9, 7, 4, 0.

## Jessica

Jessica was one of two students who moved outside the box and tried some different patterns – the one shown here was 2, 1, 4, 3, 5 – she wasn’t sure how to keep going.  One student though increased the decrease each time and had 10, 9, 7, 4, 0.


text:
# How do you solve x+ x + 13.50= 25.50?

Nov 9, 2017

First, make the decimals as brackets, because we are not calculators
$x + x + \frac{1350}{100} = \frac{2550}{100}$
Solve the variables and transfer the fraction in LHS
$2 x = \frac{2550}{1000} - \frac{1350}{1000}$
Solve
$2 x = \frac{1200}{1000}$
That is equal to
$2 x = 12.00$
Transfer 2 to RHS
$x = \frac{12}{2}$
Solve
$x = 6$

format: plain


text:
# Is there a way to outline text?

If I have:

Graphics[
{Red, EdgeForm[Directive[White, Thick]],
Inset[Style[Text@"Hi!", 44], {0, 0}]}, Background -> Black
]

I unfortunately get:

Which as you can see does not have a thick white outline. Is there a way to get around this since EdgeForm clearly does not work?

By the way, I would rather NOT delve into making a larger, white "Hi" and then putting the red one on top. That's just not elegant.

MMA 8.0.1 for students
OS Windows 7 64-bit

• there was a question on Stack Overflow strongly related to this one. Jul 13 '12 at 20:02
• Oh, I did not know. I sort of gave up googling for MMA help since there usually isn't anything except for stuff here. Also, I can't find it.
– VF1
Jul 13 '12 at 20:04

Import text as a FilledCurve in graphics, using PDF as an intermediate format. Below are modified examples from Documentation Center:

text = First[First[ImportString[ExportString[Style["Hi", Italic, FontSize -> 24,
FontFamily -> "Times"], "PDF"], "PDF", "TextMode" -> "Outlines"]]];

Outline fonts using different edge and face forms:

Graphics[{EdgeForm[Directive[White, Thick]], Red, text},
Background -> Black, PlotRange -> {{-5, 25}, {-0, 20}}]

3D text effect:

Graphics[{EdgeForm[Opacity[0.5]], Table[{ColorData["TemperatureMap"][t],
Translate[text, 4 {-t, t}]}, {t, 0, 1, 1/10}]}, ImageSize -> Medium]

• Vitaliy, very nice! Jul 13 '12 at 20:36
• Cool. But is this really the only way? It's a bit slow to convert it to a curve and I need to display the graphics quickly in my game. The text changes based on the game's statistics, so precomputing's not an option...
– VF1
Jul 13 '12 at 20:55
• @vlad you can do the curve conversion on a letter basis in advance. You'd need a kerning table as well, but that shouldn't be too difficult to generate. Jul 13 '12 at 21:57
• While clever it strikes me as really quite atrocious to have to do an Export->Import to get the outlines. I keep hoping someone will find or share an internal function that does this. :-/ Jul 14 '12 at 1:10
• This is now outdated, now text = First[First[ImportString[ExportString[Style["Hi", Italic, FontSize -> 24, FontFamily -> "Times"],"PDF"], {"PDF", "PageGraphics"},"TextMode" -> "Outlines"]]]; should be used as per the documentation. Jul 30 '21 at 22:50

An important issue in the question seems to be that of speed. So as Sjoerd suggested, I wrote a solution that pre-outlines all the characters in a reasonable range of ASCII characters, and then does the replacements on an arbitrary string. The characters are stored in a table ascii, and their graphic replacements in asciiGraphics. I then define the replacement rule (rule) which is part of the function makeText:

ascii = CharacterRange[" ", "z"]

(*
==> {" ", "!", "\"", "#", "\$", "%", "&", "'", "(", ")", "*", \
"+", ",", "-", ".", "/", "0", "1", "2", "3", "4", "5", "6", "7", "8", \
"9", ":", ";", "<", "=", ">", "?", "@", "A", "B", "C", "D", "E", "F", \
"G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", \
"U", "V", "W", "X", "Y", "Z", "[", "\\", "]", "^", "_", "", "a", \
"b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", \
"p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}
*)

asciiGraphics =
First@ImportString[
ExportString[Style[#, FontFamily -> "Times", FontSize -> 44],
"PDF"], "TextOutlines" -> True] & /@ ascii;

Clear[makeText];
Options[makeText] = {"OutlineThickness" -> 1, "OutlineColor" -> White,
"Color" -> Red};
makeText[string_, OptionsPattern[]] :=
DisplayForm[
Row[Characters[string] /. rule] /.
FilledCurve[
x__] :> {EdgeForm[{AbsoluteThickness[
OptionValue["OutlineThickness"]],
OptionValue["OutlineColor"]}],
OptionValue["Color"],
FilledCurve[x]
}
]

The argument to makeText is the string to be rendered as outlined text. The thickness of the outlines is specified by the option "OutlineThickness". The other two options are "OutlineColor" and "Color" (of the filled areas).

The following is a demo - you win the game by sliding the slider to the right...

Manipulate[
Style[Pane[
makeText["Player 1 has " <> ToString[Floor[p]] <> " points",
"OutlineThickness" -> .7], ImageSize -> 360],
Background -> Black,
Magnification -> 3
], {p, 0, 1000}]

Edit

In response to the question in the comment:

By using Dispatch you can eke out a faster timing, and my focus was on getting fast execution. It won't matter much if you're dealing only with a short string. But if you're trying to translate a long text into outlined characters, the replacement is sped up when you first apply Dispatch to the rule.

• Intresting. But what is the role of Dispatch?
– VF1
Jul 14 '12 at 2:44
• By using Dispatch you can eke out a faster timing, and my focus was on getting fast execution. It won't matter much if you're dealing only with a short string. But if you're trying to translate a long text into outlined characters, the replacement is sped up when you first apply Dispatch to the rule.
– Jens
Jul 14 '12 at 4:08
• @Vlad Speed is the biggest hurdle when doing anything interactive in Mathematica - I hope you'll be able to overcome that for your game...
– Jens
Jul 14 '12 at 4:09

In version 10, we can bypass exporting to PDF and re-importing and can outline text directly using region discretization functions. This is shown in the documentation of BoundaryDiscretizeGraphics.

reg = BoundaryDiscretizeGraphics[Text[Style["R", FontFamily -> "Cambria"]], _Text]

The region can then be converted back to graphics, and the FilledCurve extracted.

WARNING: I just realized that the following line will often crash the kernel with 10.1.0 on OS X! Proceed with caution!

Cases[Normal@Show[reg], _FilledCurve, Infinity]

Normal is for getting rid of GraphicsComplex inside the resulting Graphics object.

If there is a direct way to go from a BoundaryMeshRegion to a FilledCurve, without having to use Show, please let me know!

• weird, RegionBoundary[reg]//FullForm shows the polygon data, but there is no evident way to programmatically extract it. Apply doesn't work.. on a MeshRegion Jul 16 '15 at 19:31
• I'm amazing you can discretize a word,and how do you find the pattern of "_Text"??Do you help me discretize a Tube?Such as "Graphics3D[Tube[{{0, 0, 0}, {1, 1, 1}}, .1]]"?
– yode
Sep 25 '15 at 18:35
• @yode It's in the documentation I linked to, almost this very example. I really don't know more than what's there. Sep 25 '15 at 20:45
• If you provide character i, it would generate Polygon instead of FilledCurve`. Dec 20 '16 at 11:07
• @user1950580 I've done this now where I search for either of them. It suffices to get all the cases I've tried. Mar 17 '17 at 5:11


text:
# Is every contractible metric space locally path connected?

A topological space $X$ is called locally path connected if for every $x \in X$ and open set $U$ containing $x$, there is a path connected open set $V \subseteq U$ such that $x \in V$.

Is every contractible metric space locally path connected ?

No. For instance, let $K\subset\mathbb{R}$ be the Cantor set and let $X=\{(tx,t):x\in K, t\in[0,1]\}\subset\mathbb{R}^2$. Then $X$ is contractible (by the map $H:X\times[0,1]\to X$ given by $H(y,t,s)=(sy,st)$) but is not locally connected at any point other than $(0,0)$.

More generally, given any space $A$, you can consider the cone $X=A\times[0,1]/A\times\{0\}$ on $A$, which is always contractible but contains $A\times(0,1]$ as an open subspace and so will not be locally (path-)connected unless $A$ is. In general $X$ may not be metrizable, but it will be if $A$ is a compact metric space.

Let $A = \{a\in\mathbb{Q}\mid -1 \le a \le 1\}$.

Let $X=\{(x,y)\in \mathbb{R}^2\mid y=ax\;\text{for some}\;a\in A\;\text{and}\;0\le x \le 1\}$.

Let the metric on $X$ be inherited from the Euclidean metric on $\mathbb{R}^2$.

Then $X$ is contractible (to the origin), but not locally path connected at any point of $X$ other than the origin.

Another example is the comb $\left([0,1] \times \{0\}\right) \cup \left( \bigcup_{n=1}^{\infty}\{1/n\} \times [0,1]\right)\cup \left(\{0\} \times [0,1]\right) \subset \mathbb{R}^2$. It is not locally path-connected on points in the leftmost side of the comb (except on the base point, where it is), but it is clearly homotopically equivalent to $[0,1]$, and thus to a point.

If instead of taking the comb roots to be $\{0\} \cup\{1/n\}$ we take the rational numbers, we get yet another example. This time, it is not locally path-connected in any point other than the base points.

If we make this last comb a triangular comb and concatenate them like this:

we get a contractible metric space which is not locally path-connected anywhere.