Message Boards Message Boards

Error in An Elementary Introduction to the Wolfram Language Chapter 30.6?

GROUPS:

I think I found an error in the online An Elementary Introduction to the Wolfram Language Chapter 30 Rearranging lists Exercises problem +30.6

+30.6 Make a line plot of integers up to 200 sorted by the lengths of their names in English.

The answer given is:

ListLinePlot[SortBy[Range[200], IntegerName]]

This results in a plot sorted by names. I believe the correct answer should be:

ListLinePlot[SortBy[Range[200], StringLength[IntegerName[#]] &]]

Quite a different plot. How should I report this so a correction can be made? Or am I wrong?

Attachments:
POSTED BY: Marshall Crenshaw
Answer
5 months ago

It now appears to be question 30.12:

Sort integers up to 20 by the length of their names in English.

30.6 seems to be now something else?

Your solution with StringLength@*IntegerName is indeed correct!

POSTED BY: Sander Huisman
Answer
5 months ago

Group Abstract Group Abstract