BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

labVIEW games

 


How are these LabVIEW games, exactly?

 

 

they arent anymore :smileywink:. I starteddifferently though.

 

 

But I am enjoying the response for these puzzle. So Iam thinking of continuing........

Message 31 of 141
(13,850 Views)

And for today...........

 

 

Find a number consisting of 9 digits in which each of the digits from 1 to 9 appears only once. This number should satisfy the following requirements:
a. The number should be divisible by 9.
b. If the most right digit is removed, the remaining number should be divisible by 8.
c. If then again the most right digit is removed, the remaining number should be divisible by 7.
d. etc. until the last remaining number of one digit which should be divisible by 1.
Message 32 of 141
(13,846 Views)
--------------------------------------------
So Iam thinking of continuing........
--------------------------------------------

Please go on Muks. I love such kind of puzzles so much.
0 Kudos
Message 33 of 141
(13,846 Views)

muks wrote:
Find a number consisting of 9 digits in which each of the digits from 1 to 9 appears only once. This number should satisfy the following requirements:
a. The number should be divisible by 9.
b. If the most right digit is removed, the remaining number should be divisible by 8.
c. If then again the most right digit is removed, the remaining number should be divisible by 7.
d. etc. until the last remaining number of one digit which should be divisible by 1.

OK, to bring this topic back to LabVIEW, we want to see some actual LabVIEW code to solve this. 😄

 

(I probably won't have time this week, though... :()

Message 34 of 141
(13,821 Views)

altenbach wrote:

we want to see some actual LabVIEW code to solve this. 😄


My thought too, but my quick examination revealed it would take longer to write the divisibility checks and the surrounding code than I wanted to put in.

 

What I can say is that I know what one of the digits is and that the rest can be divided into two groups of four which we know something about. The details are in white font below:

 

The fifth digit is 5.

The odd digits are odd and the even digits are even.


___________________
Try to take over the world!
Message 35 of 141
(13,815 Views)
The power of the pyramid in the following VI tells me: 381654729.  The block diagram is more a work of art than an example of fine LV style, but it gets the answer.  I will point out that I did not simply check all possible combinations, a couple of minutes with the pencil cut down the number of checks.  Unfortunately I only remembered a few of my divisibility rules.  Given the speed of LV, probably faster to have skipped to the coding.
Message 36 of 141
(13,795 Views)

Looks good to me.

 

I'm curious about how you decided to break the even numbers into 2,6 or 4,8 for the particular positions.  The even vs. odd I figured out on my own.  The location of the 5 made sense once I read it.  But you went once step further breaking up the evens.  I'm curious what was your rationale for that?

Message 37 of 141
(13,791 Views)
Odd/even was pretty straightforward.  5 was also an easy one.  Divisibility by 4 requires looking at the last two digits, the possibilities were 12,16,32,36,72,76,92,96 (only 2 or 6 for fourth digit).  Divisibility by 8 is a little funky, you look at the last three digits.  Since we know the first digit is odd, the number is divisible by 8 when the last two digits + 4 is.  When you go through the possibilities, again you see that the eighth digit must be 2 or 6.  That means the other two digits (second and sixth) must be 4 or 8.  At that point I decided I had cut it down enough and should let LV do some of the work.
Message 38 of 141
(13,787 Views)

see here and here

0 Kudos
Message 39 of 141
(13,780 Views)

Who needs all these division rules??? 😮

 

Here's dumb, all blue solution the does not know anything about division and thus needs to try all permutations. It still solves the problem in under 1 second and even proves that there is only one solution.

 

 

I'ts probably buggy so feel free to modify it. I initially wrote it in 8.6 using the "in-place structure". Unfortunately, this structure is not available in the posted 8.0 version.

 

you can even change the number of digits. There are/is:

 

no solution for n=4, 5, or 7

one solution for n=9 (381654729),n=8 (38165472), n=2 (12), or n=1 (1)

two solutions for n=6 (123654, 321654), or n=3 (123, 321)

Message Edited by altenbach on 08-10-2009 09:58 PM
Download All
Message 40 of 141
(13,771 Views)