Challenge #432: Sequential Logic
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi Maveryx,
A solution to last week’s challenge can be found here.
Patrick Digan (@patrick_digan) submitted this challenge that will test your logic skills. Thank you, Patrick, for submitting this great challenge!
You have a dataset that looks like this:
Record |
A |
B |
C |
1 |
1.0 |
0.0 |
0.0 |
2 |
1.0 |
0.0 |
0.0 |
3 |
2.0 |
1.0 |
0.0 |
4 |
? |
? |
? |
Your task is to generate rows for records 4 through 25 (1 to 3 will stay the same), and calculate the values of A, B, and C for each row.
The general logic to determine the values in columns A, B, and C for records 4-25 is:
- Column A: Calculate the sum of all numbers in the previous row.
- Column B: Subtract B from A in the previous row.
- Column C: Subtract B and C from A in the previous row.
Hint: You will need to make sure that you calculate the values record by record.
Example for Record 4:
A=2+1+0=3
B=2-1=1
C=2-1-0=1
Example for Record 5:
A=3+1+1=5
B=3-1=2
C=3-1-1=1
Need a refresher? Review the following lessons in Academy to gear up.
Good luck!
- Labels:
- Basic
- Core
- Data Analysis
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
My solution. I think there is an easier solution than mine. But my brain has no idea except this one.
Hmm...It's a bit complex expression!
IF [ABC]="::" THEN
ToString(
ToNumber(GetLeft([Row-1:ABC], ":"))+
ToNumber(GetPart([Row-1:ABC], ":",1))+
ToNumber(GetPart([Row-1:ABC], ":",2))
)+":"+
ToString(
ToNumber(GetLeft([Row-1:ABC], ":"))-
ToNumber(GetPart([Row-1:ABC], ":",1))
)+":"+
ToString(
ToNumber(GetLeft([Row-1:ABC], ":"))-
ToNumber(GetPart([Row-1:ABC], ":",1))-
ToNumber(GetPart([Row-1:ABC], ":",2))
)
ELSE [ABC]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I'm glad to see this problem made it to the weekly challenges! After you've solved it, here's something interesting:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Fibonacci rewritten ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator