20
$\begingroup$

Enter image description here

A circle with number x means:
“This circle is connected (straight line) to x circles with a true statement
This is valid only if the statement in the circle is True.

If a circle is False, then it could be interpreted like this:
“This circle is NOT connected (straight line) to x circles with a true statement
Thus, the number of True statements connected to a False circle should be different than the number in the False circle itself.

Let’s say a true circle is a circle with a true statement.
So if the number is 3 it means the circle is connected by 3 true circles.
Some circles are true and some are not.
Each circle is connected to 5 other circles, except the middle circle.
The middle circle is connected to 10 other circles.
Create another star with Boolean (T/F) input, to show which circles are true, and which circles are false.

Example

Enter image description here

This is a variation from this puzzle.

Only for those who are still confused:

A is connected to (B,C,D,E,F)
B is connected to (A,C,F,G,J)
C is connected to (A,B,D,F,G)
D is connected to (A,C,F,H,E)
E is connected to (A,D,F,H,K)
F is connected to (A,B,C,D,E,G,H,I,J,K)
G is connected to (B,C,F,I,J)
H is connected to (E,D,F,I,K)
I is connected to (J,G,F,H,K)
J is connected to (B,G,F,I,K)
K is connected to (J,I,F,H,E)

$\endgroup$
5
  • $\begingroup$ Why is the "0" circle connected to 3 True circles? Shouldn't that mean it must have had a different value than 0? $\endgroup$
    – Ivanhoe
    Sep 28, 2016 at 7:41
  • $\begingroup$ @Ivanhoe So the circle is False (F) $\endgroup$ Sep 28, 2016 at 7:43
  • $\begingroup$ @JamalSenjaya I think it would be best if you add an explanation on how this type of puzzle actually works. Because it was confusing at first for me. And as I can see from the answers/comments - not only for me. $\endgroup$ Sep 28, 2016 at 8:03
  • $\begingroup$ @MariaDeleva I have tried to explain clearly, but maybe still confusing for some persons. Anyone can edit my puzzle to make it more clear. $\endgroup$ Sep 28, 2016 at 8:12
  • $\begingroup$ @JamalSenjaya no problem. :) $\endgroup$ Sep 28, 2016 at 8:28

3 Answers 3

12
$\begingroup$

The following truth values should solve the puzzle:

The numbers in parentheses are the number of wanted/connected True nodes
A = True (3/3)
B = True (2/2)
C = False (3/4)
D = True (2/2)
E = True (2/2)
F = False (7/6)
G = True (2/2)
H = False (4/3)
I = True (1/1)
J = False (0/3)
K = False (3/2)

Steps I used to find the solution:

Assume J is true, this makes B, G, I, K false, this makes F and H false, which would make I true, a contradiction, thus J is false.
Assume I is true, this makes F, H, K false and thus G true. Now assume E is true, this makes A and D true. It follows that C must be false and B must be true. This gives a correct solution.

$\endgroup$
2
  • $\begingroup$ I appreciate the steps towards the solution. A lot easier for me to know where to start on a puzzle like this now. Thanks! $\endgroup$
    – Brian J
    Sep 28, 2016 at 12:48
  • 1
    $\begingroup$ Maybe a small comment on how I chose the nodes to start from. I looked for nodes with small numbers that had nodes with high numbers around them. Assuming those as true will lead to several implications that should lead to a contradiction or solution very fast. $\endgroup$
    – w l
    Sep 28, 2016 at 12:56
6
$\begingroup$

I know this has been answered but I worked on it for a while and I don't want it to go to waste. I would have answered sooner but there was a fire drill in the building and had to leave.

I thought about brute forcing this since there are only $2^{11}$ possible combinations.
The idea is to write a base 2 number that contains 0 on a position if the circle is false and 1 if it's true.
I used PHP to go through all the possible values.
This is in no way the optimal approach.

The code below returns the following result

Array
(
[0] => Array
(
[a] => 1
[b] => 1
[c] => 0
[d] => 1
[e] => 1
[f] => 0
[g] => 1
[h] => 0
[i] => 1
[j] => 0
[k] => 0
)
)

<?php

class Star 
{
    protected $values;
    protected $around;
    protected $size;
    public function __construct($values, $around)
    {
        $this->values = $values;
        $this->around = $around;
        $this->size = count($values);
    }
    protected function generateTrueFalse($number)
    {
        $value = base_convert($number, 10, 2);
        $value = str_pad($value, $this->size, '0', STR_PAD_LEFT);
        $array = array();
        for ($i = 0;$i<strlen($value);$i++) {
            $array[chr(ord('a')+$i)] = $value[$i];
        }
        return $array;
    }
    protected function sumAround($char, $trueFalse) 
    {
        $sum = 0;
        foreach ($this->around[$char] as $near) {
            $sum += $trueFalse[$near];
        }
        return $sum;
    }

    public function run()
    {
        $results = array();
        for ($i = 0; $i<pow(2, $this->size);$i++) {
            $base2Array = $this->generateTrueFalse($i);
            $valid = true;
            foreach ($this->values as $key => $value) {
                $sum = $this->sumAround($key, $base2Array);
                if (($sum != $value && $base2Array[$key] == 1) || ($sum == $value && $base2Array[$key] == 0)) {
                    $valid = false;
                    break;
                }
            }
            if ($valid) {
                $results[] = $base2Array;
            }
        }
        return $results;
    }
}
$values = array(
    'a' => 3,
    'b' => 2,
    'c' => 3,
    'd' => 2,
    'e' => 2,
    'f' => 7,
    'g' => 2,
    'h' => 4,
    'i' => 1,
    'j' => 0,
    'k' => 3
);

$around = array(
	'a' => array('b','c', 'd', 'e', 'f'),
	'b' => array('a','c', 'f', 'g', 'j'),
	'c' => array('a','b', 'd', 'f', 'g'),
	'd' => array('a','c', 'f', 'h', 'e'),
	'e' => array('a','d', 'f', 'h', 'k'),
	'f' => array('a','b', 'c', 'd', 'e', 'h', 'i', 'j', 'k'),
	'g' => array('b','c', 'f', 'i', 'j'),
	'h' => array('e','d', 'f', 'i', 'j'),
	'i' => array('j','g', 'f', 'h', 'k'),
	'j' => array('b','g', 'f', 'i', 'k'),
	'k' => array('e','f', 'h', 'i', 'j')
);
$star = new Star($values, $around);
echo "<pre>"; print_r($star->run());
$\endgroup$
3
  • $\begingroup$ So you have proved the question have a unique answer. $\endgroup$ Sep 28, 2016 at 10:11
  • $\begingroup$ No because I stop the execution when i find the first solution. I will change it to run through all the possible combinations. $\endgroup$
    – Marius
    Sep 28, 2016 at 10:22
  • 1
    $\begingroup$ @JamalSenjaya. I've modified my class to return all the possible results. And indeed it returns only one combination. $\endgroup$
    – Marius
    Sep 28, 2016 at 11:09
0
$\begingroup$

My answer below is found WRONG. see comments.


It seems like there are multiple solutions.
Below is the one I found.

Image1

$\endgroup$
1
  • 1
    $\begingroup$ you solution is contradictory - H states 4. You put a True value inside it, yet none of the circles surrounding it contain True value (if it is T, and the statement is 4, then there should be 4 circles linked to it with T). $\endgroup$ Sep 28, 2016 at 7:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.