All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 Ice Cream Sundae Surmise (Posted on 2022-12-11)
o Bruce, Caitlin, Felicia, and Harold went to a bar to have ice cream sundaes.

o Each of them ordered precisely two flavors from amongst the following: chocolate, vanilla, raspberry, and strawberry.

It is known that:

1. Bruce did NOT have chocolate.
2. Caitlin did NOT have vanilla.
3. Felicia did NOT have raspberry.
4. Caitlin and Felicia did NOT have any flavors in common.
5. Two of them had strawberry.
6. Two of them had chocolate.
7. Three of them ordered vanilla.
8. Harold did NOT have strawberry
From the above-mentioned clues, determine the two ice-cream flavors ordered by each of the four individuals.

 See The Solution Submitted by K Sengupta Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
 computer solution | Comment 1 of 2
Item 8 was not needed, nor used in the program:

clearvars,clc
bruce=1; caitlin=2; felicia=3; harold=4;
name=["bruce";"caitlin";"felicia";"harold"];
combo=nchoosek('cvrs',2);
n=size(combo,1);
for a=1:n
ch(bruce,:)=combo(a,:);
for b=1:n
ch(caitlin,:)=combo(b,:);
for c=1:n
ch(felicia,:)=combo(c,:);
for d=1:n
ch(harold,:)=combo(d,:);

if ~ismember('c',ch(bruce,:)) && ~ismember('v',ch(caitlin,:)) && ~ismember('r',ch(felicia,:))
if length(intersect(ch(caitlin,:),ch(felicia,:)))==0
if length(strfind([ch(caitlin,:),ch(bruce,:),ch(harold,:),ch(felicia,:)],'s'))==2
if length(strfind([ch(caitlin,:),ch(bruce,:),ch(harold,:),ch(felicia,:)],'c'))==2
if length(strfind([ch(caitlin,:),ch(bruce,:),ch(harold,:),ch(felicia,:)],'v'))==3
if ismember('s',ch(caitlin,:))
for i=bruce:harold
fprintf('%-7s %2s\n',name(i), ch(i,:))
end
end
end
end
end
end
end

end
end
end
end

Results showing initials of the flavors had by each:

`bruce   vscaitlin rsfelicia cvharold  cv`

 Posted by Charlie on 2022-12-11 11:19:00

 Search: Search body:
Forums (0)
Random Problem
Site Statistics
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox: