Is this even solvable?

Me and Python has given up.

Can these two problems be solved with only the provided information?

Other urls found in this thread:

cs.stackexchange.com/questions/84052/is-this-backtracking-dynamic-programming-problem-solvable-using-only-the-given-i
pastebin.com/bgg8AKKJ
twitter.com/AnonBabble

Also posted this to CS stack exchange.

rules dont even make any sense

The same thing I was wondering. It's like they omitted telling us something important.

Is it missing some kind of initial starting score?

Link to my question on CS stack exchange:

cs.stackexchange.com/questions/84052/is-this-backtracking-dynamic-programming-problem-solvable-using-only-the-given-i

Yes

Initial score is irrelevant

Also homework help belongs on

The game of darts I play kinda works like this lads.

You start at 701, and then you throw three darts to try and hit something on the board. Each spot on the dart board corresponds to a point total that subtracts from 701. To end the game, you gotta hit a double (the outer edge of the board) or the bullseye. For example, if you've got 26 points remaining, you'd hit double 13.

Find all possible combinations of 1, 2, and 3 darts where at least one dart is in the center or outer ring.

>Initial score is irrelevant
It's not irrelevant if it's asking you for scores that finish the game in one turn you spanner.

Can you tell me how, and why is the initial score is irrelevant?

>You start at 701

And that's my problem. No "starting score" in the problem text.

>implying you couldn't make a score up

Pretty much this. It doesn't matter if you put starting score at 100 or 1000 the teacher doesn't give a fuck they just want to see how you'd solve it.

You can't.

Read the question nerd
You don't need a starting score to solve these

6187 people solved it on projecteuler.net, so yes it is possible.

You're supposed to find the initial scores from which you can end the game in one turn, you barnacleheads. For example, if the score was 50, you could end the game with 1 dart on the bullseye. If the score was 52, you could hit two 1's and the bullseye, or a 2 and the bullseye. This is what it means.

Not the same exact question and they were provided much more helpful information.

>How many distinct ways can a player checkout with a score less than 100?
Fucking retard.

Thanks for doing my homework
Cuck

I'm OP. I don't know why this idiot is lying:

Let me know how your Programming-in-Vague-English 101 professor likes the solution.

>find the scores from which it is possible to end the game in one turn
You aren't given a starting score because you're supposed to find the starting score, that's the problem you're supposed to solve

The reason there wasn't an initial score is because sometimes different dart games have different starting points. Sometimes if we want a short game, we do 501. For all intensive porpoises you could use 701.

No, it's not, you fucking autist. The problem is finding the 3 "shots" which clear the points in 1 turn. The number of points is missing.

"From", not "with".
For example, the player brings the score to exactly zero FROM 52 WITH 1, 1, and 50. The question asks for the scores FROM which it is possible to end the game in one turn.

I'll just assume you're baiting and not illitarate

...

This is easy. If you can't solve this you don't deserve to be called a programmer

Last dart either hits 50 or 2*x where x = [1,20]
=> 21 possible results
Two darts remain
Second darts can hit anything, so either 50 or 25 or 1*x or 2*x or 3*x where x = [1,20]
=> 62 possible results
One dart remains
Third dart is equal to second one
=> 62 possible results

Number of scores: 21 + 62 + 62 = 145 (including duplicates)

Next step: Find these 145 scores and ignore the duplicates

>where x = [1,20]

How can anyone who has never played dart know that? Also why does the pic in show numbers as high as 40-60?

>Also why does the pic in (OP) show numbers as high as 40-60?

these are the 3*x numbers
the thin rings are multiplicators (2*x or 3*x)

You understand the question because of Problem 108 on Project Euler.

But can anyone who doesn't know dart and only given the vague description in solve the problem?

>108
109

What? I thought it was relatively straightforward. You find combinations of one, two, or three dart throws that could end the game (since it only asked for one turn). You'd need DP techniques, which should be easy, using a hash table or something.

So for 1 throw, it's all the outermost, + the bullseye.

For 2 throws, you start working backwards.

I'm sure python can handle this. The problem space doesn't seem that huge at one turn.

That's not the dart I know.
I always throw 3 times and highest score wins.

What the fuck is this complicated bullshit?

That's the official dart rules. 501 for short games, 701 points for long games, and you have to clear it exactly.

professional dart differs from drunk-assholes-playing-dart-in-a-smelly-bar-dart

>these are the 3*x numbers

Nowhere in does it explain than there are x3 multipliers.

The question is too vague.

>End of the game is to hit bull's-eye (50 pointssssss) with a SINGLE DART

you are literally too braindead to be in CS

>drunk-assholes-playing-dart-in-a-smelly-bar-dart
That's the only true dart though.

Vague description + diagram, yes.
Vague description alone, no.

It doesn't need to explain why those values are associated with those spaces on the board. The question in combination with the diagram has enough information.

This is possible. You need to take the current score from the user (some value between 1 and 180) and then iterate through whatever logic you use to determine every possible combination that arrives at a score of 0.
What that logic is, however, I have no idea. The laziest thing I can think of is using a few loops and constant values to populate an array, sorting it from highest to lowest, and then using that to loop through all possible combinations. This is COMICALLY inefficient, but I think even I could make it work.

What the question means by dynamic and backtracking, I don't know. Programming is clearly not my thing.

Too vague. Is your professor a Pajeet?

>You need to take the current score from the user
Where is this stated in the assignment?

It isn't but the solution requires an initial score, and it needs to come from somewhere. If you feel like a real asshole pull it from a RNG and display it before your solutions (don't do this).

>It isn't but the solution requires an initial score
Not according to the autismos in this thread.

Think of each starting value as a tree that is going down, you can write a recursive algorithm that subtracts each number from the total if the number is small enough to reach zero. Everytime you are able to hit zero return 1 + recursivecall

^^^ It doesn't, have you ever used a parameter?

Here's the thing, my professors always tried to beat the habit of assuming things or adding features out of us because the jobs they were training us for routinely told them they hated that shit. Scope creep from above is bad enough without every code monkey throwing their shit in the pot too.
I don't like filling in gaps in instruction for that very reason. But in this case there is a value missing. You can write the LOGIC to accomplish this task without ever getting that value. But for testing it would be required.

you need to know starting score, but that might be an argument
my shitty solution: pastebin.com/bgg8AKKJ
note that there is too many solutions since you can miss+miss+1 on every turn

You can use induction for proofs, there is no number needed. What are you on about?

idk python but I can write this in C or java if anyone wants. I'm too lazy to do the proof though

Jesus if that's a weekly exercice thats kinda rough

Maybe in a highschool course. This is not time consuming to write once you get it, assuming OP has been familiarized with recursion

You need to square this value because there are 2 of each number.

Here, this is very similar.

public static void findAllSolutionsStatic(int index, int[] denominations, int cents, int[] coinsSolution) {
//base cases
if(cents < 0) {
return;
}
if(cents == 0) { //found combination
System.out.println(Arrays.toString(coinsSolution));
return;
}
if(index == denominations.length) { //iterated through possible denominations
return;
}
//recursive
int current = denominations[index]; //current denomination used
for(int i = 0; i

from itertools import permutations

# config
targets = range(1,61)
bounds = [50,40,2,36,8,26,12,20,30,4,34,6,38,14,32,16,22,28,18,24,10]
turnlength = 3

# algo
answers = set()

for depth in range(1,turnlength + 1):
for series in permutations(targets,depth):
if series[-1] in bounds:
answers.add(sum(series))

print(answers)

Is it possible to win this game with a score of 1 or 3?

>targets = range(1,61)
>bounds = [50,40,2,36,8,26,12,20,30,4,34,6,38,14,32,16,22,28,18,24,10]
>bounds =
[50,40,2,36,8,26,12,20,30,4,34,6,38,14,32,16,22,28,18,24,10]

Has science gone too far?

You cannot win with a score of 1.

You can win with a score of 3, for example by hitting 1 and then 2.

>each number
I don't mean the set of numbers used, I mean every number on the board including duplicates

>Has science gone too far?

What's the matter? Too pseudo code for ya?

this is interesting practice for a metamorphic engine

I blame Python

Why? How can a program that solves this problem reproduce itself differently?

OP, you are a fucking moron.

The algorithm methods are literally given in the description:
-Backtracking
-Dynamic programming


Now be a good boy, loop up on google what that means and then realize it is a piece of cake if you know how.

The point is that the program works no matter what the initial score is fucking shit retards

1) make list of all scores
2) make list of ending scores
3) for i in all, for j in all, for k in ending put i+j+k to set
4) print elements in set
this will give you 161 unique numbers between 1 to 170

Well it didn't say winning points, so it's kind of hard to do any calculations at this stage.

{2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 160, 161, 164, 167, 170}

That card...

I've seen something like this in zero time dilemma.

You managed to miss 1.

>end the game in one turn
>a turn is throwing one
implies (at least) one number on that board is an instant win

yeah man, that series is basically puzzles like this thrown in alongside the main plot

That you can hit the same spot more than once

This right here is the winner

>this entire fucking thread