Apr 1, 2020 4:47 AM
| Last Modified: Apr 25, 2020 7:39 AM
Welcome to the first in what I plan to be a series of regular JMP challenges! For the most part, these challenges will focus on the JMP Scripting Language (JSL), but occasionally, I'll sneak something in that can be doe without scripting.
On or around the first of every month, I hope to offer you a problem that will test your JMP abilities. Each challenge will look to emphasize certain programming and data-oriented skills as they apply to JMP. I’d like to encourage everybody, regardless of your ability level, to give them a try. During my career, I have learned more by trying to do what seemed impenetrable, beyond my skills, coming up with a solution, and then learning (or discovering) a better way to do things.
With each new post, I’ll call out the best performers from the previous challenge and share their solutions along with other interesting solutions. I’ll talk about what I think made the previous challenge challenging, and try to offer bits of wisdom.
As time goes on, I’ll keep track of the top performers. The challenge will be open to everyone, but I’ll keep the staff entries separate from the rest. As you might expect, we have a few ringers at JMP.
The rules are simple:
Everything must be done completely in JMP, without invoking any application outside of JMP such as SAS, R, or Python, or using external sources of supplementary information.
A script must complete its task in a reasonable time, as specified in the challenge.
It must run on Catalina or Windows 10.
While I prefer using JMP 15, I am willing to consider testing it on JMP 14. If this is your preference, you need to let me know in your entry.
Post your entries to the blog. I must receive your final entry by 11:59 PM Eastern Time on the day of the deadline. I will consider only one entry per person.
Points will be awarded each month to the top-performing scripts based on criteria appropriate for the challenge. While the challenge is going on, I will moderate the comments section to keep hints, clues, submissions, etc., from inadvertently getting out. I will let you know when I receive your entry.
JSL Challenge 1
I love a good word puzzle. This challenge is inspired by Spelling Bee in The New York Times. In it, you must create words from a list of seven letters with the condition that one of the letters is always used. The other letters can be used once, more than once, or not at all. I am modifying the conditions to make things a bit trickier.
Given seven letters, find:
The longest word using all seven letters and only those seven letters. Letters may be used more than once.
The longest word using all seven letters and any other letters.
The longest word using all seven letters and any other letters where no letter from the set of seven is used more than once.
The longest word in which 5 of the 7 letters appears. Any letter including those outside of the 7 may appear once or more except the two unused letters from the list of 7, which may not appear at all.
For all four items, there may be no words that meet the criteria or multiple words. Scripts must accept a list of seven lower case alphabetical character (a-z) strings that will be stored in a global variable named letterSetList. For example, if the first item in the list is "abcdefl", the answers would be:
"formaldehydesulphoxylate" and "scientificophilosophical"
All scripts will be tested on the same three seven-letter sets. All words will be taken from the dictionary posted below. Please access it as a JMP data table when your script executes. Write all words to the log. Make sure to include the item number with the output. You will have a time limit of five minutes total. Entries must be received by 11:59 PM Eastern Time on Wednesday, April 15.
Scoring: Two points for each correct solution. Two additional points for solving all four. The three fastest scripts (total time to answer all four items correctly) will be awarded 6, 3, and 1 points. Two points for any script that can produce the correct answer that is half the size or less of the second shortest of the three fastest solutions (total non-white space character count and with comments removed). Three points if your script runs as fast or faster than the fasted submitted by a staff member.