Group Abstract Group Abstract

Message Boards Message Boards

Computational Parenting: Are we nearly there yet?

POSTED BY: Marco Thiel
7 Replies

Dear Marco,

it is always a pleasure to read your inventive posts - thanks for sharing! Certainly your kids never ever will be bored!

As a side note: It is probably not surprising that your findings in "time length for counting" (depending on language) seem correlate with the entropy of the respective used letters:

languages = {"English", "German", "Spanish"};
langChars = 
  Association@
   Table[lng -> 
     Characters@
      StringDelete[
       StringJoin[
        IntegerName[#, {"Words", lng}] & /@ 
         Range[100000]], {FromCharacterCode[8208], " ", ","}], {lng, languages}];
entropy = N[Entropy[#]] & /@ langChars
(* Out:  <|English -> 2.6504, German -> 2.70404, Spanish -> 2.58885|>  *)

Best regards from Germany -- Henrik

POSTED BY: Henrik Schachner

I have a hard time interpreting the entropy measure in this case. For example:

POSTED BY: Mohammad Bahrami

Your children are incredibly lucky to have you. :)

POSTED BY: Danielle Rommel

Hi Mads,

I have no idea about the entropies. I think though that you are calculating some sort of cumulative string. If you do it per number:

s = Table[N@Entropy@
StringDelete[StringJoin[IntegerName[#, {"Words", "English"}] & @i], {FromCharacterCode[
8208], " ", ","}], {i, 1, 1000}];

ListLinePlot[s, GridLines -> {Range[1, 1000, 10], Automatic}]

enter image description here

Here's a (very badly plotted) image

entropyspeech = Entropy[SpeechSynthesize[StringReplace[IntegerName[#], "\[Hyphen]" -> " "]]] & /@ Range[1000];

Show[ListLinePlot[N[Entropy[StringDelete[StringRiffle[StringSplit@IntegerName[#, {"Words", "English"}], " "], ","]]] & /@ Range[1, 1000], PlotRange -> All], 
 ListLinePlot[entropyspeech // N, PlotRange -> All, PlotStyle -> Red],PlotRange -> All]

enter image description here

I cannot really tell yet what that means. Perhaps if I plot it better, and fix the problem I mentioned in the reply to Henrik...

Cheers,

Marco

POSTED BY: Marco Thiel

Dear Henrik,

thank you very much for your kind words. It appears that my kids would choose computer games and movies if it was up to them ;-) I do try to use the Wolfram Language though to illustrate computational aspects of their questions; I am still dreaming of a world in which maths/computation is used as naturally by children as reading.

Regarding your observation as the entropies, it is certainly quite interesting. I am not sure how the relationship between the written numbers and their pronunciation is. Here is a short visualisation of English word lengths and their "pronunciation time".

dataEnglish = {#, StringLength[#], Duration[SpeechSynthesize[#]], QuantityMagnitude@Duration[SpeechSynthesize[#]]} & /@ RandomSample[DictionaryLookup[], 2000];

enter image description here

We can represent this like so (string length vs time to say the word):

ListPlot[Select[dataEnglish, NumberQ[#[[-1]]] &][[All, {2, -1}]]]

enter image description here

If we fit a linear model to this we get:

lm1 = LinearModelFit[Select[dataEnglish, NumberQ[#[[-1]]] &][[All, {2, -1}]], {1, x}, x]

which gives

0.273066 + 0.0629077 x

We can compare that with the numbers:

stringlength = StringLength[StringReplace[IntegerName[#], "\[Hyphen]" -> " "]] & /@Range[1000];

speakingtime = QuantityMagnitude[Duration[SpeechSynthesize[StringReplace[IntegerName[#], "\[Hyphen]" -> " "]]]] & /@ Range[1000];

syllables = Length /@ 
(ResourceFunction["WordSyllables"][StringDelete[StringRiffle[StringSplit@IntegerName[#, {"Words", "English"}]," "], ","]] & /@ Range[1, 1000]);

We can plot this

ListLinePlot[{stringlength, 14 speakingtime, syllables}]

enter image description here

where blue is the string length, orange is the speaking time, and green the number of syllables.

And then:

ListPlot[Transpose[{stringlength, speakingtime}]]

enter image description here

I have also calculated the readability score, but suppose that lots of assumptions don't apply when applying that measure to individual words:

readabilityscore = ResourceFunction["ReadabilityScore"][
StringDelete[StringRiffle[StringSplit@IntegerName[#, {"Words", "English"}], " "], ","]] & /@ Range[1000];

ListLinePlot[readabilityscore]

enter image description here

I have no idea what most of this means. Well, string length is correlated with speaking time, which is trivial. I'll try to look at this for different languages and other texts/books which I have in different languages.

I'll try to post some things when I have fixed a little problem. If I run this:

dataEnglish = {#, StringLength[#], Duration[SpeechSynthesize[#]], QuantityMagnitude@Duration[SpeechSynthesize[#]]} & /@ RandomSample[DictionaryLookup[], 2000];

It appears to work for a while and then produces an error and then SpeechSynthesize stops working. Even killing the kernel doesn't help; it needs a reboot. Hope to fix that soon.

Thanks for your comment and all the best from Aberdeen,

Marco

POSTED BY: Marco Thiel

Moderator Note: this post was highlighted on the Wolfram's official social media channels. Thank you for your contribution. We are looking forward to your future posts.

POSTED BY: EDITORIAL BOARD

enter image description here -- you have earned Featured Contributor Badge enter image description here Your exceptional post has been selected for our editorial column Staff Picks http://wolfr.am/StaffPicks and Your Profile is now distinguished by a Featured Contributor Badge and is displayed on the Featured Contributor Board. Thank you!

POSTED BY: EDITORIAL BOARD
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard