Oxygen Basic

Information => Open Forum => Topic started by: jack on August 04, 2014, 07:07:24 PM

Title: unusual mathematical problems
Post by: jack on August 04, 2014, 07:07:24 PM
seen a couple of interesting and rather unusual problems brought up at the Mathematica forum, the first "Fruit grid sums"
http://community.wolfram.com/groups/-/m/t/307516?p_p_auth=vHs9FlgA
and the follow up "Use Machine Learning to find the best movie ever!" http://community.wolfram.com/groups/-/m/t/309928?p_p_auth=vHs9FlgA
Title: Re: unusual mathematical problems
Post by: Mike Lobanovsky on August 05, 2014, 06:57:32 AM
Hi Jack,

Are these really Mathematica or still Wolfram problems? I always thought Wolfram was a more advanced (i.e. general-purpose, common knowledge) environment with its Internet access, analysis, and self-learning capabilities as compared to the former's strictly mathematical application domain.
Title: Re: unusual mathematical problems
Post by: jack on August 05, 2014, 03:15:35 PM
Hi Mike,
the problems are in Mathematica, Wolfram added quite a number of new functions to version 10 of Mathematica, honestly I don't what exactly the Wolfram language is.
Title: Re: unusual mathematical problems
Post by: Mike Lobanovsky on August 05, 2014, 04:17:06 PM
The Wolfram Language (http://www.wolfram.com/language/fast-introduction-for-programmers/interactive-usage/) : knowledge-based Programming Cloud environment.

Currently, sort of a rudimentary artificial intelligence on the net. Ultimately, this:

(http://youoffendmeyouoffendmyfamily.com/wordpress/wp-content/uploads/2010/03/hal-9000-hal-9000-computer-demotiva.jpg)


(http://www.fbsl.net/phpbb2/images/smilies/icon_ml_bananadevil.gif)
Title: Re: unusual mathematical problems
Post by: jack on August 05, 2014, 05:07:12 PM
apparently I am not the only person confused as to what the Wolfram Language is http://community.wolfram.com/groups/-/m/t/158447?p_p_auth=0EDASTq1
someone was clever enough to ask Wolfram Alpha, still when you go to the Wolfram website there's no way of purchasing the language, although it's freely available for the Raspberry Pi.
Title: Re: unusual mathematical problems
Post by: Mike Lobanovsky on August 05, 2014, 05:45:21 PM
Jack,

In my understanding, WL is a concept. In my inner perception (call it intuition, if you will), it is exactly what's shown in the picture above: "I'm sorry, Dave. I'm afraid I can't do that." (c)

Have a look at the chain of comments below your example problems. It is applicable and it does work but its assumptions and conclusions are not always predictable, so - beware!

 ::)
Title: Re: unusual mathematical problems
Post by: jack on August 05, 2014, 05:52:14 PM
Mike, I am not sure it's just a concept, Mathematica 10 was supposed to have been re-written in the Wolfram Language.
Title: Re: unusual mathematical problems
Post by: Mike Lobanovsky on August 05, 2014, 06:03:03 PM
No, my meaning of "concept" here was not just a "prototype" or "skeleton" but rather an "ideology". I certainly do not like the idea of unlimited-power, uncontrollable and depersonalized cloud (= crowd) computing with free acces to real big data. I am afraid of doctors Jekyll and Frankensteins of all sorts. I've been living behind the Commie curtain for decades and I saw some such degenerates with my own eyes, Jack.

Pedobytes and terrorbytes. (c)2014 Charles E V Pegge, "Horrors of Modern Computing", thinBasic Publishing House
Title: Re: unusual mathematical problems
Post by: jack on August 05, 2014, 06:20:09 PM
I am concerned as well about the cloud metaphor, especially since we know that the powers that be are monitoring all communications.
I am off to bed, have a long day at work tomorrow.
Title: Re: unusual mathematical problems
Post by: Mike Lobanovsky on August 05, 2014, 06:41:06 PM
G'night Jack.
Title: Re: unusual mathematical problems
Post by: Charles Pegge on August 06, 2014, 12:29:10 AM
Quote
Pedobytes and terrorbytes. (c)2014 Charles E V Pegge, "Horrors of Modern Computing", thinBasic Publishing House

femabytes

(http://www.secretsofthefed.com/wp-content/uploads/2013/02/concentration_camp.jpg)
Title: Re: unusual mathematical problems
Post by: jack on August 06, 2014, 03:19:01 PM
thank you Charles, love your humor. :)
Title: Re: unusual mathematical problems
Post by: Mike Lobanovsky on August 06, 2014, 04:38:48 PM
(http://news.store-1.net/wp-content/uploads/2014/07/crash-coverup-of-malaysia-airlines-flight-mh17-likely-impossible.jpg)

Homobites of faminine gender.

Stay tuned. More horrors to follow.
Title: Re: unusual mathematical problems
Post by: Charles Pegge on August 07, 2014, 02:07:49 AM

Solving the fruit grid:

A few manual rules included  dramatically shortens the processing time.

Code: [Select]

'Fruit grid sums
================
'http://community.wolfram.com/groups/-/m/t/307516?p_p_auth=vHs9FlgA

'MANUAL OPTIMISATIONS
'limes=6 [y5]
'pear+avocado=8 [y3]
'melon+cherry+strawberry+apple=18 [y2]
'banana+melon+pine+pine+apple=22 [x1]


'RUN PERMUTATIONS
sys ok
'   lime,apple,pear,avocado,melon,cherry,strawberry,banana,grape,pineapple
sys li,ap,pe,av,me,ch,st,ba,gr,pn
li=6
for pe=0 to 9
for av=0 to 9
if pe+av=8 then
for ap=0 to 9
for me=0 to 9
for ch=0 to 9
for st=0 to 9
if me+ch+st+ap=18 then
for ba=0 to 9
for gr=0 to 9
for pn=0 to 9
  'row tests
  if ba+st+gr+ap+pn+pe<>26 then jmp fwd ns
  if me+av+ch+st+pe+ap<>26 then jmp fwd ns
' if av+pe+av+pe+av+pe<>24 then jmp fwd ns
  if pn+ch+st+ba+me+gr<>22 then jmp fwd ns
' if li+li+li+li+li+li<>36 then jmp fwd ns
  if ap+ba+pn+ch+ba+st<>30 then jmp fwd ns
  if pe+me+gr+st+me+ch<>19 then jmp fwd ns
  if pn+av+ba+ch+pe+gr<>23 then jmp fwd ns
  'column tests
  if ba+me+av+pn+li+ap+pe+pn<>35 then jmp fwd ns
  if st+av+pe+ch+li+ba+me+av<>38 then jmp fwd ns
  if gr+ch+av+st+li+pn+gr+ba<>36 then jmp fwd ns
  if ap+st+pe+ba+li+ch+st+ch<>34 then jmp fwd ns
  if pn+pe+av+me+li+ba+me+pe<>31 then jmp fwd ns
  if pe+ap+pe+gr+li+st+ch+gr<>32 then jmp fwd ns
  ok=1 : jmp fwd done
  ns:
next
next
next
end if
next
next         
next
next
end if
next
next

'RESULTS
done:
if not ok then
  print "no solution"
else
print "
lime " li "
apple " ap "
pear " pe "
avocado " av "
melon " me "
cherry " ch "
strawberry " st "
banana " ba "
grape " gr "
"
end if
Title: Re: unusual mathematical problems
Post by: Peter on August 07, 2014, 03:14:17 AM
Wow,  what for an old style  source code!  And so many fruits.
Title: Re: unusual mathematical problems
Post by: RobbeK on August 07, 2014, 03:40:35 AM
https://www.youtube.com/watch?v=c8N72t7aScY    ;)

Above ,  I think with pen & paper and the Gauß-Jordan matrix eleminations , it can be done within a "reasonable" time (probably faster than writing any code solving it ...  but FBmath (Jean Debord) has everything and more to solve these things.

You can try this one ::   (inscription on the grave of Diophantus )  :

'Here lies Diophantus , God gave him his boyhood one-sixth of his life, One twelfth more as youth while whiskers grew rife; And then yet one-seventh ere marriage begun; In five years there came a bouncing new son. Alas, the dear child of master and sage After attaining half the measure of his father's life chill fate took him. After consoling his fate by the science of numbers for four years, he ended his life.'

..  how many years ???

 ::)

best Rob
Title: Re: unusual mathematical problems
Post by: Mike Lobanovsky on August 07, 2014, 04:49:39 AM
Charles,

Why don't you implement iterate or continue instead of low-level jmp fwd nxt?



Rob,

Quote
Gauß-Jordan

I beg your pardon? Gauss? :D
Title: Re: unusual mathematical problems
Post by: Charles Pegge on August 07, 2014, 05:18:35 AM

Mike,

In Oxygen, this will make a perpetual loop, since the iterator is stepped by next:

Code: [Select]
for i=1 to 10
  continue for
next

PS: Cracking this grid manually is no easy task, but I do enjoy computing with fruit, though buns, bagels, doughnuts, eclairs, and sandwiches would be equally effective :)
Title: Re: unusual mathematical problems
Post by: Mike Lobanovsky on August 07, 2014, 05:35:12 AM
I'd opt for buns, bagels, doughnuts, eclairs, and sandwiches leaving fruit to women. :)