Message Boards Message Boards

1
|
6631 Views
|
1 Reply
|
1 Total Likes
View groups...
Share
Share this post:

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

Posted 7 years ago

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:

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
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract